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-2022 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 | degrees or radians | no | radians
35  \endtable
36 
37  Example of function object specification:
38  \verbatim
39  rigidBodyState
40  {
41  type rigidBodyState;
42  libs ("librigidBodyState.so");
43  angleUnits degrees;
44  }
45  \endverbatim
46 
47 See also
48  Foam::functionObjects::fvMeshFunctionObject
49  Foam::functionObjects::logFiles
50 
51 SourceFiles
52  rigidBodyState.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef rigidBodyState_H
57 #define rigidBodyState_H
58 
59 #include "fvMeshFunctionObject.H"
60 #include "logFiles.H"
61 #include "rigidBodyMotion.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace functionObjects
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class rigidBodyState Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class rigidBodyState
75 :
76  public fvMeshFunctionObject,
77  public logFiles
78 {
79  // Private Data
80 
81  word angleUnits_;
82 
83  //- List of the names of the rigid bodies
84  wordList names_;
85 
86 
87  // Private Member Functions
88 
89  const RBD::rigidBodyMotion& motion() const;
90 
91 
92 protected:
93 
94  // Protected Member Functions
95 
96  //- overloaded writeFileHeader from writeFile
97  virtual void writeFileHeader(const label i = 0);
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("rigidBodyState");
104 
105 
106  // Constructors
107 
108  //- Construct from Time and dictionary
110  (
111  const word& name,
112  const Time& runTime,
113  const dictionary& dict
114  );
115 
116  //- Disallow default bitwise copy construction
117  rigidBodyState(const rigidBodyState&) = delete;
118 
119 
120  //- Destructor
121  virtual ~rigidBodyState();
122 
123 
124  // Member Functions
125 
126  //- Read the rigidBodyState data
127  virtual bool read(const dictionary&);
128 
129  //- Return the list of fields required
130  virtual wordList fields() const
131  {
132  return wordList::null();
133  }
134 
135  //- Execute, currently does nothing
136  virtual bool execute();
137 
138  //- Write the rigidBodyState
139  virtual bool write();
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const rigidBodyState&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace functionObjects
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
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:160
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