sixDoFRigidBodyState.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017 OpenFOAM Foundation
9  Copyright (C) 2018-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::sixDoFRigidBodyState
29 
30 Group
31  grpSixDoFRigidBodyFunctionObjects
32 
33 Description
34  Writes the 6-DoF motion state.
35 
36  Example of function object specification:
37  \verbatim
38  sixDoFRigidBodyState
39  {
40  type sixDoFRigidBodyState;
41  libs (sixDoFRigidBodyState);
42  angleFormat degrees;
43  }
44  \endverbatim
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  type | type name: sixDoFRigidBodyState | yes |
50  angleFormat | degrees or radians | no | radian
51  \endtable
52 
53 See also
54  Foam::functionObjects::fvMeshFunctionObject
55  Foam::functionObjects::writeFile
56 
57 SourceFiles
58  sixDoFRigidBodyState.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef sixDoFRigidBodyState_H
63 #define sixDoFRigidBodyState_H
64 
65 #include "fvMeshFunctionObject.H"
66 #include "writeFile.H"
67 #include "Enum.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace functionObjects
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class sixDoFRigidBodyState Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class sixDoFRigidBodyState
81 :
82  public fvMeshFunctionObject,
83  public writeFile
84 {
85  // Private data
86 
87  enum class angleTypes
88  {
89  RADIANS,
90  DEGREES
91  };
92 
93  //- Angle type names
94  static const Enum<angleTypes> angleTypeNames_;
95 
96  //- Angle format
97  angleTypes angleFormat_;
98 
99 
100  // Private Member Functions
101 
102  //- No copy construct
104 
105  //- No copy assignment
106  void operator=(const sixDoFRigidBodyState&) = delete;
107 
108 
109 protected:
110 
111  // Protected Member Functions
112 
113  //- Overloaded writeFileHeader from writeFile
114  virtual void writeFileHeader(Ostream& os);
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("sixDoFRigidBodyState");
121 
122 
123  // Constructors
124 
125  //- Construct from Time and dictionary
127  (
128  const word& name,
129  const Time& runTime,
130  const dictionary& dict
131  );
132 
133 
134  //- Destructor
135  virtual ~sixDoFRigidBodyState() = default;
136 
137 
138  // Member Functions
139 
140  //- Read the sixDoFRigidBodyState data
141  virtual bool read(const dictionary&);
142 
143  //- Execute, currently does nothing
144  virtual bool execute();
145 
146  //- Write the sixDoFRigidBodyState
147  virtual bool write();
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace functionObjects
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
writeFile.H
Foam::Enum< angleTypes >
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::sixDoFRigidBodyState::writeFileHeader
virtual void writeFileHeader(Ostream &os)
Overloaded writeFileHeader from writeFile.
Definition: sixDoFRigidBodyState.C:65
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fvMeshFunctionObject.H
Foam::functionObjects::sixDoFRigidBodyState
Writes the 6-DoF motion state.
Definition: sixDoFRigidBodyState.H:94
Foam::functionObjects::sixDoFRigidBodyState::execute
virtual bool execute()
Execute, currently does nothing.
Definition: sixDoFRigidBodyState.C:119
Foam::functionObjects::sixDoFRigidBodyState::read
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
Definition: sixDoFRigidBodyState.C:100
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::sixDoFRigidBodyState::~sixDoFRigidBodyState
virtual ~sixDoFRigidBodyState()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::functionObjects::sixDoFRigidBodyState::write
virtual bool write()
Write the sixDoFRigidBodyState.
Definition: sixDoFRigidBodyState.C:125
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::sixDoFRigidBodyState::TypeName
TypeName("sixDoFRigidBodyState")
Runtime type information.
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Enum.H