FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

sixDoFRigidBodyMotionRestraint.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Namespace
00025     Foam::sixDoFRigidBodyMotionRestraints
00026 
00027 Description
00028     Namespace for six DoF motion restraints
00029 
00030 
00031 Class
00032     Foam::sixDoFRigidBodyMotionRestraint
00033 
00034 Description
00035     Base class for defining restraints for sixDoF motions
00036 
00037 SourceFiles
00038     sixDoFRigidBodyMotionRestraint.C
00039     newDynamicFvMesh.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef sixDoFRigidBodyMotionRestraint_H
00044 #define sixDoFRigidBodyMotionRestraint_H
00045 
00046 #include <OpenFOAM/Time.H>
00047 #include <OpenFOAM/dictionary.H>
00048 #include <OpenFOAM/autoPtr.H>
00049 #include <OpenFOAM/vector.H>
00050 #include <OpenFOAM/runTimeSelectionTables.H>
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 // Forward declaration of classes
00058 class sixDoFRigidBodyMotion;
00059 
00060 
00061 /*---------------------------------------------------------------------------*\
00062                 Class sixDoFRigidBodyMotionRestraint Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 class sixDoFRigidBodyMotionRestraint
00066 {
00067 
00068 protected:
00069 
00070     // Protected data
00071 
00072         //- Restraint model specific coefficient dictionary
00073         dictionary sDoFRBMRCoeffs_;
00074 
00075 
00076 public:
00077 
00078     //- Runtime type information
00079     TypeName("sixDoFRigidBodyMotionRestraint");
00080 
00081 
00082     // Declare run-time constructor selection table
00083 
00084         declareRunTimeSelectionTable
00085         (
00086             autoPtr,
00087             sixDoFRigidBodyMotionRestraint,
00088             dictionary,
00089             (const dictionary& sDoFRBMRDict),
00090             (sDoFRBMRDict)
00091         );
00092 
00093 
00094     // Constructors
00095 
00096         //- Construct from the sDoFRBMRDict dictionary and Time
00097         sixDoFRigidBodyMotionRestraint
00098         (
00099             const dictionary& sDoFRBMRDict
00100         );
00101 
00102         //- Construct and return a clone
00103         virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const = 0;
00104 
00105 
00106     // Selectors
00107 
00108         //- Select constructed from the sDoFRBMRDict dictionary and Time
00109         static autoPtr<sixDoFRigidBodyMotionRestraint> New
00110         (
00111             const dictionary& sDoFRBMRDict
00112         );
00113 
00114 
00115     // Destructor
00116 
00117         virtual ~sixDoFRigidBodyMotionRestraint();
00118 
00119 
00120     // Member Functions
00121 
00122         //- Calculate the restraint position, force and moment.
00123         //  Global reference frame vectors.
00124         virtual void restrain
00125         (
00126             const sixDoFRigidBodyMotion& motion,
00127             vector& restraintPosition,
00128             vector& restraintForce,
00129             vector& restraintMoment
00130         ) const = 0;
00131 
00132         //- Update properties from given dictionary
00133         virtual bool read(const dictionary& sDoFRBMRDict);
00134 
00135         // Access
00136 
00137             // Return access to sDoFRBMRCoeffs
00138             inline const dictionary& coeffDict() const
00139             {
00140                 return sDoFRBMRCoeffs_;
00141             }
00142 
00143         //- Write
00144         virtual void write(Ostream&) const = 0;
00145 };
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 } // End namespace Foam
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 #endif
00155 
00156 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines