solidBodyMotionFunction.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 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 Namespace
28  Foam::solidBodyMotionFunctions
29 
30 Description
31  Namespace for solid-body motions
32 
33 
34 Class
35  Foam::solidBodyMotionFunction
36 
37 Description
38  Base class for defining solid-body motions
39 
40 SourceFiles
41  solidBodyMotionFunction.C
42  solidBodyMotionFunctionNew.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef Foam_solidBodyMotionFunction_H
47 #define Foam_solidBodyMotionFunction_H
48 
49 #include "Time.H"
50 #include "dictionary.H"
51 #include "septernion.H"
52 #include "autoPtr.H"
53 #include "runTimeSelectionTables.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class solidBodyMotionFunction Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66 protected:
67 
68  // Protected Data
69 
71 
72  const Time& time_;
73 
74 
75  // Protected Member Functions
76 
77  //- No copy construct
79 
80  //- No copy assignment
81  void operator=(const solidBodyMotionFunction&) = delete;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("solidBodyMotionFunction");
88 
89 
90  // Declare run-time constructor selection table
91 
93  (
94  autoPtr,
96  dictionary,
97  (const dictionary& SBMFCoeffs, const Time& runTime),
98  (SBMFCoeffs, runTime)
99  );
100 
101 
102  // Constructors
103 
104  //- Construct from the coefficients dictionary and Time
106  (
107  const dictionary& SBMFCoeffs,
108  const Time& runTime
109  );
110 
111  //- Construct and return a clone
112  virtual autoPtr<solidBodyMotionFunction> clone() const = 0;
113 
114 
115  // Selectors
116 
117  //- Construct and dispatch motionType with dictionary and Time.
118  // Returns nullptr if motionType is empty
120  (
121  const word& motionType,
122  const dictionary& dict,
123  const Time& runTime
124  );
125 
126  //- Select "solidBodyMotionFunction" type from dictionary
127  //- and create with Time.
129  (
130  const dictionary& dict,
131  const Time& runTime
132  );
133 
134  //- Select "solidBodyMotionFunction" type (if present) from dictionary
135  //- and create with Time.
137  (
138  const dictionary& dict,
139  const Time& runTime
140  );
141 
142 
143  //- Destructor
144  virtual ~solidBodyMotionFunction() = default;
145 
146 
147  // Member Functions
148 
149  //- Return the solid-body motion transformation septernion
150  virtual septernion transformation() const = 0;
151 
152  //- Update properties from given dictionary
153  virtual bool read(const dictionary& SBMFCoeffs) = 0;
154 
155  //- Write in dictionary format
156  virtual void writeData(Ostream&) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
dictionary dict
declareRunTimeSelectionTable(autoPtr, solidBodyMotionFunction, dictionary,(const dictionary &SBMFCoeffs, const Time &runTime),(SBMFCoeffs, runTime))
virtual ~solidBodyMotionFunction()=default
Destructor.
solidBodyMotionFunction(const solidBodyMotionFunction &)=delete
No copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
static autoPtr< solidBodyMotionFunction > New(const word &motionType, const dictionary &dict, const Time &runTime)
Construct and dispatch motionType with dictionary and Time.
virtual void writeData(Ostream &) const
Write in dictionary format.
engineTime & runTime
virtual autoPtr< solidBodyMotionFunction > clone() const =0
Construct and return a clone.
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
TypeName("solidBodyMotionFunction")
Runtime type information.
Base class for defining solid-body motions.
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual bool read(const dictionary &SBMFCoeffs)=0
Update properties from given dictionary.
static autoPtr< solidBodyMotionFunction > NewIfPresent(const dictionary &dict, const Time &runTime)
Select "solidBodyMotionFunction" type (if present) from dictionary and create with Time...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual septernion transformation() const =0
Return the solid-body motion transformation septernion.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Macros to ease declaration of run-time selection tables.
void operator=(const solidBodyMotionFunction &)=delete
No copy assignment.
Namespace for OpenFOAM.