sixDoFMotion: Adding restraints and constraints to the motion of objects.
[OpenFOAM-1.6.x.git] / src / postProcessing / functionObjects / forces / pointPatchFields / derived / sixDoFRigidBodyDisplacement / sixDoFRigidBodyDisplacementPointPatchVectorField.H
blobfee0c157f771cf61213705c3d141b73556a4224f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
28 Description
29     Foam::sixDoFRigidBodyDisplacementPointPatchVectorField
31 SourceFiles
32     sixDoFRigidBodyDisplacementPointPatchVectorField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef sixDoFRigidBodyDisplacementPointPatchVectorField_H
37 #define sixDoFRigidBodyDisplacementPointPatchVectorField_H
39 #include "fixedValuePointPatchField.H"
40 #include "sixDoFRigidBodyMotion.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48         Class sixDoFRigidBodyDisplacementPointPatchVectorField Declaration
49 \*---------------------------------------------------------------------------*/
51 class sixDoFRigidBodyDisplacementPointPatchVectorField
53     public fixedValuePointPatchField<vector>
55     // Private data
57         //- Six dof motion object
58         sixDoFRigidBodyMotion motion_;
60         //- Initial positions of points on the patch
61         pointField initialPoints_;
63         //- Reference density required by the forces object for
64         //  incompressible calculations
65         scalar rhoInf_;
68 public:
70     //- Runtime type information
71     TypeName("sixDoFRigidBodyDisplacement");
74     // Constructors
76         //- Construct from patch and internal field
77         sixDoFRigidBodyDisplacementPointPatchVectorField
78         (
79             const pointPatch&,
80             const DimensionedField<vector, pointMesh>&
81         );
83         //- Construct from patch, internal field and dictionary
84         sixDoFRigidBodyDisplacementPointPatchVectorField
85         (
86             const pointPatch&,
87             const DimensionedField<vector, pointMesh>&,
88             const dictionary&
89         );
91         //- Construct by mapping given patchField<vector> onto a new patch
92         sixDoFRigidBodyDisplacementPointPatchVectorField
93         (
94             const sixDoFRigidBodyDisplacementPointPatchVectorField&,
95             const pointPatch&,
96             const DimensionedField<vector, pointMesh>&,
97             const pointPatchFieldMapper&
98         );
100         //- Construct and return a clone
101         virtual autoPtr<pointPatchField<vector> > clone() const
102         {
103             return autoPtr<pointPatchField<vector> >
104             (
105                 new sixDoFRigidBodyDisplacementPointPatchVectorField
106                 (
107                     *this
108                 )
109             );
110         }
112         //- Construct as copy setting internal field reference
113         sixDoFRigidBodyDisplacementPointPatchVectorField
114         (
115             const sixDoFRigidBodyDisplacementPointPatchVectorField&,
116             const DimensionedField<vector, pointMesh>&
117         );
119         //- Construct and return a clone setting internal field reference
120         virtual autoPtr<pointPatchField<vector> > clone
121         (
122             const DimensionedField<vector, pointMesh>& iF
123         ) const
124         {
125             return autoPtr<pointPatchField<vector> >
126             (
127                 new sixDoFRigidBodyDisplacementPointPatchVectorField
128                 (
129                     *this,
130                     iF
131                 )
132             );
133         }
136     // Member functions
138         // Mapping functions
140             //- Map (and resize as needed) from self given a mapping object
141             virtual void autoMap
142             (
143                 const pointPatchFieldMapper&
144             );
146             //- Reverse map the given pointPatchField onto this pointPatchField
147             virtual void rmap
148             (
149                 const pointPatchField<vector>&,
150                 const labelList&
151             );
154         // Evaluation functions
156             //- Update the coefficients associated with the patch field
157             virtual void updateCoeffs();
160         //- Write
161         virtual void write(Ostream&) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //