sixDoFRigidBodyMotionConstraint.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2014 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Namespace
27 Foam::sixDoFRigidBodyMotionConstraints
28
29Description
30 Namespace for six DoF motion constraints
31
32
33Class
34 Foam::sixDoFRigidBodyMotionConstraint
35
36Description
37 Base class for defining constraints for sixDoF motions
38
39SourceFiles
40 sixDoFRigidBodyMotionConstraint.C
41 sixDoFRigidBodyMotionConstraintNew.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef sixDoFRigidBodyMotionConstraint_H
46#define sixDoFRigidBodyMotionConstraint_H
47
48#include "Time.H"
49#include "dictionary.H"
50#include "autoPtr.H"
51#include "point.H"
52#include "pointConstraint.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60// Forward declaration of classes
61class sixDoFRigidBodyMotion;
62
63
64/*---------------------------------------------------------------------------*\
65 Class sixDoFRigidBodyMotionConstraint Declaration
66\*---------------------------------------------------------------------------*/
69{
70
71protected:
72
73 // Protected data
74
75 //- Name of the constraint
76 word name_;
77
78 //- Constraint model specific coefficient dictionary
80
81 //- Reference to the body motion
83
84
85public:
86
87 //- Runtime type information
88 TypeName("sixDoFRigidBodyMotionConstraint");
89
90
91 // Declare run-time constructor selection table
94 (
95 autoPtr,
98 (
99 const word& name,
100 const dictionary& sDoFRBMCDict,
101 const sixDoFRigidBodyMotion& motion
102 ),
103 (name, sDoFRBMCDict, motion)
104 );
105
106
107 // Constructors
108
109 //- Construct from the sDoFRBMCDict dictionary and Time
111 (
112 const word& name,
113 const dictionary& sDoFRBMCDict,
114 const sixDoFRigidBodyMotion& motion
115 );
116
117 //- Construct and return a clone
119
120
121 // Selectors
122
123 //- Select constructed from the sDoFRBMCDict dictionary and Time
125 (
126 const word& name,
127 const dictionary& sDoFRBMCDict,
128 const sixDoFRigidBodyMotion& motion
129 );
130
131
132 //- Destructor
134
135
136 // Member Functions
137
138 //- Return the name
139 const word& name() const
140 {
141 return name_;
142 }
143
144 //- Set the centre of rotation if not the centre of mass
145 virtual void setCentreOfRotation(point&) const
146 {}
147
148 //- Apply and accumulate translational constraints
149 virtual void constrainTranslation(pointConstraint&) const = 0;
150
151 //- Apply and accumulate rotational constraints
152 virtual void constrainRotation(pointConstraint&) const = 0;
153
154 //- Update properties from given dictionary
155 virtual bool read(const dictionary& sDoFRBMCDict);
156
157 // Access
158
159 // Return access to sDoFRBMCCoeffs
160 inline const dictionary& coeffDict() const
161 {
162 return sDoFRBMCCoeffs_;
163 }
164
165 //- Write
166 virtual void write(Ostream&) const;
167};
168
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172} // End namespace Foam
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176#endif
177
178// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Accumulates point constraints through successive applications of the applyConstraint function.
Base class for defining constraints for sixDoF motions.
TypeName("sixDoFRigidBodyMotionConstraint")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, sixDoFRigidBodyMotionConstraint, dictionary,(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion),(name, sDoFRBMCDict, motion))
virtual void constrainRotation(pointConstraint &) const =0
Apply and accumulate rotational constraints.
virtual autoPtr< sixDoFRigidBodyMotionConstraint > clone() const =0
Construct and return a clone.
virtual void setCentreOfRotation(point &) const
Set the centre of rotation if not the centre of mass.
dictionary sDoFRBMCCoeffs_
Constraint model specific coefficient dictionary.
static autoPtr< sixDoFRigidBodyMotionConstraint > New(const word &name, const dictionary &sDoFRBMCDict, const sixDoFRigidBodyMotion &motion)
Select constructed from the sDoFRBMCDict dictionary and Time.
const sixDoFRigidBodyMotion & motion_
Reference to the body motion.
virtual void constrainTranslation(pointConstraint &) const =0
Apply and accumulate translational constraints.
virtual bool read(const dictionary &sDoFRBMCDict)
Update properties from given dictionary.
Six degree of freedom motion for a rigid body.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73