sixDoFRigidBodyMotionPointConstraint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::sixDoFRigidBodyMotionConstraints::point
26 
27 Description
28  Translation constraint on the centre of rotation:
29  fixed in space.
30 
31  If 'centreOfRotation' is not provided in the dictionary the centre of mass
32  is used.
33 
34 SourceFiles
35  sixDoFRigidBodyMotionPointConstraint.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef sixDoFRigidBodyMotionPointConstraint_H
40 #define sixDoFRigidBodyMotionPointConstraint_H
41 
43 #include "point.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 namespace sixDoFRigidBodyMotionConstraints
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class point Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class point
58 :
60 {
61  // Private data
62 
63  //- Fixed centre of rotation
64  Foam::point centreOfRotation_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("point");
71 
72 
73  // Constructors
74 
75  //- Construct from components
76  point
77  (
78  const word& name,
79  const dictionary& sDoFRBMCDict,
80  const sixDoFRigidBodyMotion& motion
81  );
82 
83  //- Construct and return a clone
85  {
87  (
88  new point(*this)
89  );
90  }
91 
92 
93  //- Destructor
94  virtual ~point();
95 
96 
97  // Member Functions
98 
99  //- Set the centre of rotation to the point
100  virtual void setCentreOfRotation(Foam::point&) const;
101 
102  //- Apply and accumulate translational constraints
103  virtual void constrainTranslation(pointConstraint&) const;
104 
105  //- Apply and accumulate rotational constraints
106  virtual void constrainRotation(pointConstraint&) const;
107 
108  //- Update properties from given dictionary
109  virtual bool read(const dictionary& sDoFRBMCCoeff);
110 
111  //- Write
112  virtual void write(Ostream&) const;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace solidBodyMotionFunctions
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Six degree of freedom motion for a rigid body.
const word & name() const
Return the name.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual bool read(const dictionary &sDoFRBMCCoeff)
Update properties from given dictionary.
virtual autoPtr< sixDoFRigidBodyMotionConstraint > clone() const
Construct and return a clone.
Base class for defining constraints for sixDoF motions.
virtual void constrainTranslation(pointConstraint &) const
Apply and accumulate translational constraints.
TypeName("point")
Runtime type information.
virtual void constrainRotation(pointConstraint &) const
Apply and accumulate rotational constraints.
A class for handling words, derived from string.
Definition: word.H:59
Accumulates point constraints through successive applications of the applyConstraint function...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
point(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Construct from components.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Translation constraint on the centre of rotation: fixed in space.
virtual void setCentreOfRotation(Foam::point &) const
Set the centre of rotation to the point.
Namespace for OpenFOAM.