BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / postProcessing / functionObjects / forces / pointPatchFields / derived / sixDoFRigidBodyDisplacement / sixDoFRigidBodyDisplacementPointPatchVectorField.H
blob697c60c88beee50d33f4ee14a8b62e496b25a834
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
27 Description
28     Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
30 SourceFiles
31     sixDoFRigidBodyDisplacementPointPatchVectorField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef sixDoFRigidBodyDisplacementPointPatchVectorField_H
36 #define sixDoFRigidBodyDisplacementPointPatchVectorField_H
38 #include "fixedValuePointPatchField.H"
39 #include "sixDoFRigidBodyMotion.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47         Class sixDoFRigidBodyDisplacementPointPatchVectorField Declaration
48 \*---------------------------------------------------------------------------*/
50 class sixDoFRigidBodyDisplacementPointPatchVectorField
52     public fixedValuePointPatchField<vector>
54     // Private data
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
64         scalar rhoInf_;
66         //- Name of density field, optional unless used for an
67         //  incompressible simulation, when this needs to be specified
68         //  as rhoInf
69         word rhoName_;
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
75         //       dictionary.
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.
82         label lookupGravity_;
84         //- Gravity vector to store when not available from the db
85         vector g_;
88 public:
90     //- Runtime type information
91     TypeName("sixDoFRigidBodyDisplacement");
94     // Constructors
96         //- Construct from patch and internal field
97         sixDoFRigidBodyDisplacementPointPatchVectorField
98         (
99             const pointPatch&,
100             const DimensionedField<vector, pointMesh>&
101         );
103         //- Construct from patch, internal field and dictionary
104         sixDoFRigidBodyDisplacementPointPatchVectorField
105         (
106             const pointPatch&,
107             const DimensionedField<vector, pointMesh>&,
108             const dictionary&
109         );
111         //- Construct by mapping given patchField<vector> onto a new patch
112         sixDoFRigidBodyDisplacementPointPatchVectorField
113         (
114             const sixDoFRigidBodyDisplacementPointPatchVectorField&,
115             const pointPatch&,
116             const DimensionedField<vector, pointMesh>&,
117             const pointPatchFieldMapper&
118         );
120         //- Construct and return a clone
121         virtual autoPtr<pointPatchField<vector> > clone() const
122         {
123             return autoPtr<pointPatchField<vector> >
124             (
125                 new sixDoFRigidBodyDisplacementPointPatchVectorField
126                 (
127                     *this
128                 )
129             );
130         }
132         //- Construct as copy setting internal field reference
133         sixDoFRigidBodyDisplacementPointPatchVectorField
134         (
135             const sixDoFRigidBodyDisplacementPointPatchVectorField&,
136             const DimensionedField<vector, pointMesh>&
137         );
139         //- Construct and return a clone setting internal field reference
140         virtual autoPtr<pointPatchField<vector> > clone
141         (
142             const DimensionedField<vector, pointMesh>& iF
143         ) const
144         {
145             return autoPtr<pointPatchField<vector> >
146             (
147                 new sixDoFRigidBodyDisplacementPointPatchVectorField
148                 (
149                     *this,
150                     iF
151                 )
152             );
153         }
156     // Member functions
158         // Mapping functions
160             //- Map (and resize as needed) from self given a mapping object
161             virtual void autoMap
162             (
163                 const pointPatchFieldMapper&
164             );
166             //- Reverse map the given pointPatchField onto this pointPatchField
167             virtual void rmap
168             (
169                 const pointPatchField<vector>&,
170                 const labelList&
171             );
174         // Evaluation functions
176             //- Update the coefficients associated with the patch field
177             virtual void updateCoeffs();
180         //- Write
181         virtual void write(Ostream&) const;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 #endif
193 // ************************************************************************* //