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