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