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-2021 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  Example of function object specification:
31  \verbatim
32  rigidBodyState
33  {
34  type rigidBodyState;
35  libs ("librigidBodyState.so");
36  angleFormat degrees;
37  }
38  \endverbatim
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  type | type name: rigidBodyState | yes |
44  angleFormat | degrees or radians | no | radian
45  \endtable
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 angleFormat_;
82 
83  //- List of the names of the rigid bodies
84  wordList names_;
85 
86 
87 protected:
88 
89  // Protected Member Functions
90 
91  //- overloaded writeFileHeader from writeFile
92  virtual void writeFileHeader(const label i = 0);
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("rigidBodyState");
99 
100 
101  // Constructors
102 
103  //- Construct from Time and dictionary
105  (
106  const word& name,
107  const Time& runTime,
108  const dictionary& dict
109  );
110 
111  //- Disallow default bitwise copy construction
112  rigidBodyState(const rigidBodyState&) = delete;
113 
114 
115  //- Destructor
116  virtual ~rigidBodyState();
117 
118 
119  // Member Functions
120 
121  const RBD::rigidBodyMotion& motion() const;
122 
123  //- Read the rigidBodyState data
124  virtual bool read(const dictionary&);
125 
126  //- Return the list of fields required
127  virtual wordList fields() const
128  {
129  return wordList::null();
130  }
131 
132  //- Execute, currently does nothing
133  virtual bool execute();
134 
135  //- Write the rigidBodyState
136  virtual bool write();
137 
138 
139  // Member Operators
140 
141  //- Disallow default bitwise assignment
142  void operator=(const rigidBodyState&) = delete;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace functionObjects
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
dictionary dict
void operator=(const rigidBodyState &)=delete
Disallow default bitwise assignment.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName("rigidBodyState")
Runtime type information.
static const List< T > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
const RBD::rigidBodyMotion & motion() const
Six degree of freedom motion for a rigid body.
A class for handling words, derived from string.
Definition: word.H:59
rigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Writes the rigid body motion state.
List< word > wordList
A List of words.
Definition: fileName.H:54
virtual bool write()
Write the rigidBodyState.
virtual ~rigidBodyState()
Destructor.
virtual bool execute()
Execute, currently does nothing.
virtual wordList fields() const
Return the list of fields required.
virtual bool read(const dictionary &)
Read the rigidBodyState data.
Namespace for OpenFOAM.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile