rigidBodyPoints.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) 2022-2024 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::rigidBodyPoints
26 
27 Description
28  Writes the position, linear and angular velocities and accelerations of a
29  list of points on a body specified in the body local coordinate system.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  type | type name: rigidBodyPoints | yes |
35  angularVelocityUnits | units in which angular velocities are \\
36  written | no | [rad/s]
37  angularAccelerationUnits | units in which angular accelerations are \\
38  written | no | [rad/s^2]
39  body | name of the body | yes |
40  points | list of points on the body | yes |
41  \endtable
42 
43  Example of function object specification:
44  \verbatim
45  rigidBodyPoints
46  {
47  type rigidBodyPoints;
48  libs ("librigidBodyState.so");
49 
50  angularVelocityUnits [rpm];
51  angularAccelerationUnits [rad/s^2];
52 
53  body floatingObject;
54 
55  points
56  (
57  point1 (0 0 0)
58  point2 (0.1 0.1 0.25)
59  );
60  }
61  \endverbatim
62 
63 See also
64  Foam::functionObjects::fvMeshFunctionObject
65  Foam::functionObjects::logFiles
66 
67 SourceFiles
68  rigidBodyPoints.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef rigidBodyPoints_H
73 #define rigidBodyPoints_H
74 
75 #include "fvMeshFunctionObject.H"
76 #include "logFiles.H"
77 #include "namedUnitConversion.H"
78 #include "rigidBodyMotion.H"
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 namespace functionObjects
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class rigidBodyPoints Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class rigidBodyPoints
92 :
93  public fvMeshFunctionObject,
94  public logFiles
95 {
96  // Private Data
97 
98  //- Units in which to write the angular velocities
99  namedUnitConversion angularVelocityUnits_;
100 
101  //- Units in which to write the angular accelerations
102  namedUnitConversion angularAccelerationUnits_;
103 
104  //- Name of the body
105  word body_;
106 
107  //- List of points on the body
108  List<point> points_;
109 
110  //- Names of the body point files
111  wordList names_;
112 
113 
114  // Private Member Functions
115 
116  const RBD::rigidBodyMotion& motion() const;
117 
118 
119 protected:
120 
121  // Protected Member Functions
122 
123  //- overloaded writeFileHeader from writeFile
124  virtual void writeFileHeader(const label i = 0);
125 
126 
127 public:
128 
129  //- Runtime type information
130  TypeName("rigidBodyPoints");
131 
132 
133  // Constructors
134 
135  //- Construct from Time and dictionary
137  (
138  const word& name,
139  const Time& runTime,
140  const dictionary& dict
141  );
142 
143  //- Disallow default bitwise copy construction
144  rigidBodyPoints(const rigidBodyPoints&) = delete;
145 
146 
147  //- Destructor
148  virtual ~rigidBodyPoints();
149 
150 
151  // Member Functions
152 
153  //- Read the rigidBodyPoints data
154  virtual bool read(const dictionary&);
155 
156  //- Return the list of fields required
157  virtual wordList fields() const
158  {
159  return wordList::null();
160  }
161 
162  //- Execute, currently does nothing
163  virtual bool execute();
164 
165  //- Write the rigidBodyPoints
166  virtual bool write();
167 
168 
169  // Member Operators
170 
171  //- Disallow default bitwise assignment
172  void operator=(const rigidBodyPoints&) = delete;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace functionObjects
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
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:162
const word & name() const
Return the name of this functionObject.
Writes the position, linear and angular velocities and accelerations of a list of points on a body sp...
virtual wordList fields() const
Return the list of fields required.
void operator=(const rigidBodyPoints &)=delete
Disallow default bitwise assignment.
rigidBodyPoints(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.
TypeName("rigidBodyPoints")
Runtime type information.
virtual bool write()
Write the rigidBodyPoints.
virtual bool read(const dictionary &)
Read the rigidBodyPoints 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