sixDoFRigidBodyMotionLineConstraint.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::line
26 
27 Description
28  Translation constraint on the centre of rotation:
29  may only move along a line.
30 
31  If 'centreOfRotation' is not provided in the dictionary the centre of mass
32  is used.
33 
34 SourceFiles
35  sixDoFRigidBodyMotionLineConstraint.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef sixDoFRigidBodyMotionLineConstraint_H
40 #define sixDoFRigidBodyMotionLineConstraint_H
41 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace sixDoFRigidBodyMotionConstraints
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class line Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class line
57 :
59 {
60  // Private data
61 
62  //- Centre of rotation on line
63  point centreOfRotation_;
64 
65  //- Direction of the constraining line
66  vector direction_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("line");
73 
74 
75  // Constructors
76 
77  //- Construct from components
78  line
79  (
80  const word& name,
81  const dictionary& sDoFRBMCDict,
82  const sixDoFRigidBodyMotion& motion
83  );
84 
85  //- Construct and return a clone
87  {
89  (
90  new line(*this)
91  );
92  }
93 
94 
95  //- Destructor
96  virtual ~line();
97 
98 
99  // Member Functions
100 
101  //- Set the centre of rotation to the projection of the
102  // centre of mass onto the line
103  virtual void setCentreOfRotation(point&) const;
104 
105  //- Apply and accumulate translational constraints
106  virtual void constrainTranslation(pointConstraint&) const;
107 
108  //- Apply and accumulate rotational constraints
109  virtual void constrainRotation(pointConstraint&) const;
110 
111  //- Update properties from given dictionary
112  virtual bool read(const dictionary& sDoFRBMCCoeff);
113 
114  //- Write
115  virtual void write(Ostream&) const;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace solidBodyMotionFunctions
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
Six degree of freedom motion for a rigid body.
const word & name() const
Return the name.
virtual void constrainRotation(pointConstraint &) const
Apply and accumulate rotational constraints.
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 void constrainTranslation(pointConstraint &) const
Apply and accumulate translational constraints.
Base class for defining constraints for sixDoF motions.
virtual autoPtr< sixDoFRigidBodyMotionConstraint > clone() const
Construct and return a clone.
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
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
virtual void setCentreOfRotation(point &) const
Set the centre of rotation to the projection of the.
Translation constraint on the centre of rotation: fixed in space.
Translation constraint on the centre of rotation: may only move along a line.
line(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Construct from components.
TypeName("line")
Runtime type information.
Namespace for OpenFOAM.