rigidBodyState.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) 2019-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::functionObjects::rigidBodyState
26 
27 Description
28  Writes the rigid body motion state.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  type | type name: rigidBodyState | yes |
34  angleUnits | units in which angles are written \\
35  | no | [rad]
36  angularVelocityUnits | units in which angular velocities are written \\
37  | no | [rad/s]
38  \endtable
39 
40  Example of function object specification:
41  \verbatim
42  rigidBodyState
43  {
44  type rigidBodyState;
45  libs ("librigidBodyState.so");
46  angleUnits [deg];
47  angularVelocityUnits [rpm];
48  }
49  \endverbatim
50 
51 See also
52  Foam::functionObjects::fvMeshFunctionObject
53  Foam::functionObjects::logFiles
54 
55 SourceFiles
56  rigidBodyState.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef rigidBodyState_H
61 #define rigidBodyState_H
62 
63 #include "fvMeshFunctionObject.H"
64 #include "logFiles.H"
65 #include "namedUnitConversion.H"
66 #include "rigidBodyMotion.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace functionObjects
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class rigidBodyState Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class rigidBodyState
80 :
81  public fvMeshFunctionObject,
82  public logFiles
83 {
84  // Private Data
85 
86  //- Units in which to write the angles
87  namedUnitConversion angleUnits_;
88 
89  //- Units in which to write the angular velocities
90  namedUnitConversion angularVelocityUnits_;
91 
92  //- List of the names of the rigid bodies
93  wordList names_;
94 
95 
96  // Private Member Functions
97 
98  const RBD::rigidBodyMotion& motion() const;
99 
100 
101 protected:
102 
103  // Protected Member Functions
104 
105  //- overloaded writeFileHeader from writeFile
106  virtual void writeFileHeader(const label i = 0);
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("rigidBodyState");
113 
114 
115  // Constructors
116 
117  //- Construct from Time and dictionary
119  (
120  const word& name,
121  const Time& runTime,
122  const dictionary& dict
123  );
124 
125  //- Disallow default bitwise copy construction
126  rigidBodyState(const rigidBodyState&) = delete;
127 
128 
129  //- Destructor
130  virtual ~rigidBodyState();
131 
132 
133  // Member Functions
134 
135  //- Read the rigidBodyState data
136  virtual bool read(const dictionary&);
137 
138  //- Return the list of fields required
139  virtual wordList fields() const
140  {
141  return wordList::null();
142  }
143 
144  //- Execute, currently does nothing
145  virtual bool execute();
146 
147  //- Write the rigidBodyState
148  virtual bool write();
149 
150 
151  // Member Operators
152 
153  //- Disallow default bitwise assignment
154  void operator=(const rigidBodyState&) = delete;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace functionObjects
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Six degree of freedom motion for a rigid body.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Writes the rigid body motion state.
virtual wordList fields() const
Return the list of fields required.
TypeName("rigidBodyState")
Runtime type information.
rigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
void operator=(const rigidBodyState &)=delete
Disallow default bitwise assignment.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the rigidBodyState.
virtual bool read(const dictionary &)
Read the rigidBodyState data.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:54
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict