sixDoFRigidBodyMotionPlaneConstraint.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::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
64 
65  //- Normal to plane
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 // ************************************************************************* //
sixDoFRigidBodyMotionConstraint.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::sixDoFRigidBodyMotionConstraints::plane::clone
virtual autoPtr< sixDoFRigidBodyMotionConstraint > clone() const
Construct and return a clone.
Definition: sixDoFRigidBodyMotionPlaneConstraint.H:85
Foam::sixDoFRigidBodyMotionConstraints::plane
Translation constraint on the centre of rotation: may only move on a plane.
Definition: sixDoFRigidBodyMotionPlaneConstraint.H:55
Foam::pointConstraint
Accumulates point constraints through successive applications of the applyConstraint function.
Definition: pointConstraint.H:56
Foam::sixDoFRigidBodyMotionConstraint
Base class for defining constraints for sixDoF motions.
Definition: sixDoFRigidBodyMotionConstraint.H:65
Foam::sixDoFRigidBodyMotionConstraints::plane::normal_
vector normal_
Normal to plane.
Definition: sixDoFRigidBodyMotionPlaneConstraint.H:65
Foam::sixDoFRigidBodyMotionConstraints::plane::TypeName
TypeName("plane")
Runtime type information.
Foam::sixDoFRigidBodyMotionConstraints::plane::read
virtual bool read(const dictionary &sDoFRBMCCoeff)
Update properties from given dictionary.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:97
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::sixDoFRigidBodyMotionConstraints::point
Translation constraint on the centre of rotation: fixed in space.
Definition: sixDoFRigidBodyMotionPointConstraint.H:56
Foam::sixDoFRigidBodyMotionConstraints::plane::constrainRotation
virtual void constrainRotation(pointConstraint &) const
Apply and accumulate rotational constraints.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:90
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::sixDoFRigidBodyMotionConstraints::plane::setCentreOfRotation
virtual void setCentreOfRotation(point &) const
Set the centre of rotation to the projection of the.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:72
Foam::sixDoFRigidBodyMotionConstraints::plane::~plane
virtual ~plane()
Destructor.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:65
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::sixDoFRigidBodyMotion
Six degree of freedom motion for a rigid body.
Definition: sixDoFRigidBodyMotion.H:66
Foam::sixDoFRigidBodyMotionConstraints::plane::constrainTranslation
virtual void constrainTranslation(pointConstraint &) const
Apply and accumulate translational constraints.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:81
Foam::Vector< scalar >
Foam::sixDoFRigidBodyMotionConstraint::name
const word & name() const
Return the name.
Definition: sixDoFRigidBodyMotionConstraint.H:136
Foam::sixDoFRigidBodyMotionConstraints::plane::plane
plane(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Construct from components.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:51
Foam::sixDoFRigidBodyMotionConstraints::plane::write
virtual void write(Ostream &) const
Write.
Definition: sixDoFRigidBodyMotionPlaneConstraint.C:116
Foam::sixDoFRigidBodyMotionConstraints::plane::centreOfRotation_
point centreOfRotation_
Centre of rotation on plane.
Definition: sixDoFRigidBodyMotionPlaneConstraint.H:62
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53