solidBodyMotionFunction.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) 2011-2026 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 Namespace
25  Foam::solidBodyMotionFunctions
26 
27 Description
28  Namespace for solid-body motions
29 
30 
31 Class
32  Foam::solidBodyMotionFunction
33 
34 Description
35  Base class for defining solid-body motions
36 
37 SourceFiles
38  solidBodyMotionFunction.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef solidBodyMotionFunction_H
43 #define solidBodyMotionFunction_H
44 
45 #include "Time.H"
46 #include "dictionary.H"
47 #include "septernion.H"
48 #include "autoPtr.H"
49 #include "runTimeSelectionTables.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class solidBodyMotionFunction Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 {
62 protected:
63 
64  // Protected data
65 
66  const word name_;
68  const Time& time_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("solidBodyMotionFunction");
75 
76 
77  // Declare run-time constructor selection table
78 
80  (
81  autoPtr,
83  dictionary,
84  (
85  const word& name,
86  const dictionary& SBMFCoeffs,
87  const Time& runTime
88  ),
89  (name, SBMFCoeffs, runTime)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct from the SBMFCoeffs dictionary and Time
97  (
98  const word& name,
99  const dictionary& dict,
100  const Time& runTime
101  );
102 
103  //- Disallow default bitwise copy construction
105 
106  //- Construct and return a clone
107  virtual autoPtr<solidBodyMotionFunction> clone() const = 0;
108 
109 
110  // Selectors
111 
112  //- Select constructed from the SBMFCoeffs dictionary and Time
114  (
115  const dictionary& SBMFCoeffs,
116  const Time& runTime,
117  const word& name = "solidBodyMotionFunction"
118  );
119 
120 
121  //- Destructor
122  virtual ~solidBodyMotionFunction();
123 
124 
125  // Member Functions
126 
127  const word& name() const
128  {
129  return name_;
130  }
131 
132  //- Return the solid-body motion transformation septernion
133  virtual septernion transformation() const = 0;
134 
135  //- Update properties from given dictionary
136  virtual bool read(const dictionary& dict) = 0;
137 
138  //- Write in dictionary format
139  virtual void writeData(Ostream&) const;
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const solidBodyMotionFunction&) = delete;
146 };
147 
148 
149 void writeEntry(Ostream& os, const solidBodyMotionFunction& f);
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:66
Base class for defining solid-body motions.
virtual autoPtr< solidBodyMotionFunction > clone() const =0
Construct and return a clone.
virtual bool read(const dictionary &dict)=0
Update properties from given dictionary.
TypeName("solidBodyMotionFunction")
Runtime type information.
virtual ~solidBodyMotionFunction()
Destructor.
virtual septernion transformation() const =0
Return the solid-body motion transformation septernion.
void operator=(const solidBodyMotionFunction &)=delete
Disallow default bitwise assignment.
declareRunTimeSelectionTable(autoPtr, solidBodyMotionFunction, dictionary,(const word &name, const dictionary &SBMFCoeffs, const Time &runTime),(name, SBMFCoeffs, runTime))
virtual void writeData(Ostream &) const
Write in dictionary format.
solidBodyMotionFunction(const word &name, const dictionary &dict, const Time &runTime)
Construct from the SBMFCoeffs dictionary and Time.
static autoPtr< solidBodyMotionFunction > New(const dictionary &SBMFCoeffs, const Time &runTime, const word &name="solidBodyMotionFunction")
Select constructed from the SBMFCoeffs dictionary and Time.
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
labelList f(nPoints)
Macros to ease declaration of run-time selection tables.
dictionary dict