1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
28 Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
31 sixDoFRigidBodyDisplacementPointPatchVectorField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef sixDoFRigidBodyDisplacementPointPatchVectorField_H
36 #define sixDoFRigidBodyDisplacementPointPatchVectorField_H
38 #include "fixedValuePointPatchField.H"
39 #include "sixDoFRigidBodyMotion.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class sixDoFRigidBodyDisplacementPointPatchVectorField Declaration
48 \*---------------------------------------------------------------------------*/
50 class sixDoFRigidBodyDisplacementPointPatchVectorField
52 public fixedValuePointPatchField<vector>
56 //- Six dof motion object
57 sixDoFRigidBodyMotion motion_;
59 //- Initial positions of points on the patch
60 pointField initialPoints_;
62 //- Reference density required by the forces object for
63 // incompressible calculations, required if rhoName == rhoInf
66 //- Name of density field, optional unless used for an
67 // incompressible simulation, when this needs to be specified
71 //- State of gravity lookup:
72 // -1 = not determined yet, as the BC may be instantiated before g has
73 // been read into the db yet. Determination deferred until first
74 // call to updateCoeffs. A g keyword was not supplied to the
76 // -2 = as for -1, but a gravity value was specified in the dictionary,
77 // specifying a value in the dictionary is considered a fatal
78 // error if g is available from the db.
79 // 0 = Use this boundary condition's own value of gravity, as not
80 // available from the db.
81 // 1 = Lookup gravity from db.
84 //- Gravity vector to store when not available from the db
90 //- Runtime type information
91 TypeName("sixDoFRigidBodyDisplacement");
96 //- Construct from patch and internal field
97 sixDoFRigidBodyDisplacementPointPatchVectorField
100 const DimensionedField<vector, pointMesh>&
103 //- Construct from patch, internal field and dictionary
104 sixDoFRigidBodyDisplacementPointPatchVectorField
107 const DimensionedField<vector, pointMesh>&,
111 //- Construct by mapping given patchField<vector> onto a new patch
112 sixDoFRigidBodyDisplacementPointPatchVectorField
114 const sixDoFRigidBodyDisplacementPointPatchVectorField&,
116 const DimensionedField<vector, pointMesh>&,
117 const pointPatchFieldMapper&
120 //- Construct and return a clone
121 virtual autoPtr<pointPatchField<vector> > clone() const
123 return autoPtr<pointPatchField<vector> >
125 new sixDoFRigidBodyDisplacementPointPatchVectorField
132 //- Construct as copy setting internal field reference
133 sixDoFRigidBodyDisplacementPointPatchVectorField
135 const sixDoFRigidBodyDisplacementPointPatchVectorField&,
136 const DimensionedField<vector, pointMesh>&
139 //- Construct and return a clone setting internal field reference
140 virtual autoPtr<pointPatchField<vector> > clone
142 const DimensionedField<vector, pointMesh>& iF
145 return autoPtr<pointPatchField<vector> >
147 new sixDoFRigidBodyDisplacementPointPatchVectorField
160 //- Map (and resize as needed) from self given a mapping object
163 const pointPatchFieldMapper&
166 //- Reverse map the given pointPatchField onto this pointPatchField
169 const pointPatchField<vector>&,
174 // Evaluation functions
176 //- Update the coefficients associated with the patch field
177 virtual void updateCoeffs();
181 virtual void write(Ostream&) const;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //