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