sixDoFRigidBodyMotionPlaneConstraint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 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::plane
26 
27 Description
28  Translation constraint on the centre of rotation:
29  may only move on a plane.
30 
31  If 'centreOfRotation' is not provided in the dictionary the centre of mass
32  is used.
33 
34 SourceFiles
35  sixDoFRigidBodyMotionPlaneConstraint.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef sixDoFRigidBodyMotionPlaneConstraint_H
40 #define sixDoFRigidBodyMotionPlaneConstraint_H
41 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace sixDoFRigidBodyMotionConstraints
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class plane Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class plane
57 :
59 {
60  // Private Data
61 
62  //- Centre of rotation on plane
63  point centreOfRotation_;
64 
65  //- Normal to plane
66  vector normal_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("plane");
73 
74 
75  // Constructors
76 
77  //- Construct from components
78  plane
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 plane(*this)
91  );
92  }
93 
94 
95  //- Destructor
96  virtual ~plane();
97 
98 
99  // Member Functions
100 
101  //- Set the centre of rotation to the projection of the
102  // centre of mass onto the plane
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 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Accumulates point constraints through successive applications of the applyConstraint function.
Base class for defining constraints for sixDoF motions.
Translation constraint on the centre of rotation: may only move on a plane.
virtual autoPtr< sixDoFRigidBodyMotionConstraint > clone() const
Construct and return a clone.
plane(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Construct from components.
virtual void setCentreOfRotation(point &) const
Set the centre of rotation to the projection of the.
virtual void constrainRotation(pointConstraint &) const
Apply and accumulate rotational constraints.
virtual bool read(const dictionary &sDoFRBMCCoeff)
Update properties from given dictionary.
virtual void constrainTranslation(pointConstraint &) const
Apply and accumulate translational constraints.
TypeName("plane")
Runtime type information.
Translation constraint on the centre of rotation: fixed in space.
Six degree of freedom motion for a rigid body.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.