All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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  angleFormat degrees;
37  }
38  \endverbatim
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  type | type name: sixDoFRigidBodyState | 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  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 angleFormat_;
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  //- Execute, currently does nothing
135  virtual bool execute();
136 
137  //- Write the sixDoFRigidBodyState
138  virtual bool write();
139 
140 
141  // Member Operators
142 
143  //- Disallow default bitwise assignment
144  void operator=(const sixDoFRigidBodyState&) = delete;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace functionObjects
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
dictionary dict
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
const word & name() const
Return the name of this functionObject.
vector velocity() const
Return the current body velocity.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
vector angularVelocity() const
Return the current body angular velocity.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool execute()
Execute, currently does nothing.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
A class for handling words, derived from string.
Definition: word.H:59
TypeName("sixDoFRigidBodyState")
Runtime type information.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
sixDoFRigidBodyState(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool write()
Write the sixDoFRigidBodyState.
void operator=(const sixDoFRigidBodyState &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.