sixDoFRigidBodyMotionRestraint.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-2013 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::sixDoFRigidBodyMotionRestraints
28
29Description
30 Namespace for six DoF motion restraints
31
32
33Class
34 Foam::sixDoFRigidBodyMotionRestraint
35
36Description
37 Base class for defining restraints for sixDoF motions
38
39SourceFiles
40 sixDoFRigidBodyMotionRestraint.C
41 sixDoFRigidBodyMotionRestraintNew.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef sixDoFRigidBodyMotionRestraint_H
46#define sixDoFRigidBodyMotionRestraint_H
47
48#include "Time.H"
49#include "dictionary.H"
50#include "autoPtr.H"
51#include "vector.H"
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59// Forward declaration of classes
60class sixDoFRigidBodyMotion;
61
62
63/*---------------------------------------------------------------------------*\
64 Class sixDoFRigidBodyMotionRestraint Declaration
65\*---------------------------------------------------------------------------*/
68{
69
70protected:
71
72 // Protected data
73
74 //- Name of the restraint
75 word name_;
76
77 //- Restraint model specific coefficient dictionary
79
80
81public:
82
83 //- Runtime type information
84 TypeName("sixDoFRigidBodyMotionRestraint");
85
86
87 // Declare run-time constructor selection table
90 (
91 autoPtr,
94 (const word& name, const dictionary& sDoFRBMRDict),
95 (name, sDoFRBMRDict)
96 );
97
98
99 // Constructors
100
101 //- Construct from the sDoFRBMRDict dictionary and Time
103 (
104 const word& name,
105 const dictionary& sDoFRBMRDict
106 );
107
108 //- Construct and return a clone
110
111
112 // Selectors
113
114 //- Select constructed from the sDoFRBMRDict dictionary and Time
116 (
117 const word& name,
118 const dictionary& sDoFRBMRDict
119 );
120
121
122 //- Destructor
124
125
126 // Member Functions
127
128 //- Return the name
129 const word& name() const
130 {
131 return name_;
132 }
133
134 //- Calculate the restraint position, force and moment.
135 // Global reference frame vectors.
136 virtual void restrain
137 (
138 const sixDoFRigidBodyMotion& motion,
139 vector& restraintPosition,
140 vector& restraintForce,
141 vector& restraintMoment
142 ) const = 0;
143
144 //- Update properties from given dictionary
145 virtual bool read(const dictionary& sDoFRBMRDict);
146
147 // Access
148
149 // Return access to sDoFRBMRCoeffs
150 inline const dictionary& coeffDict() const
151 {
152 return sDoFRBMRCoeffs_;
153 }
154
155 //- Write
156 virtual void write(Ostream&) const = 0;
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
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
Base class for defining restraints for sixDoF motions.
virtual void write(Ostream &) const =0
Write.
static autoPtr< sixDoFRigidBodyMotionRestraint > New(const word &name, const dictionary &sDoFRBMRDict)
Select constructed from the sDoFRBMRDict dictionary and Time.
const word & name() const
Return the name.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const =0
Calculate the restraint position, force and moment.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
declareRunTimeSelectionTable(autoPtr, sixDoFRigidBodyMotionRestraint, dictionary,(const word &name, const dictionary &sDoFRBMRDict),(name, sDoFRBMRDict))
virtual autoPtr< sixDoFRigidBodyMotionRestraint > clone() const =0
Construct and return a clone.
TypeName("sixDoFRigidBodyMotionRestraint")
Runtime type information.
dictionary sDoFRBMRCoeffs_
Restraint model specific coefficient 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