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  dynamicFvMeshNew.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef solidBodyMotionFunction_H
47 #define 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 SBMFCoeffs 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  //- Select constructed from the SBMFCoeffs dictionary and Time
119  (
120  const dictionary& SBMFCoeffs,
121  const Time& runTime
122  );
123 
124 
125  //- Destructor
126  virtual ~solidBodyMotionFunction() = default;
127 
128 
129  // Member Functions
130 
131  //- Return the solid-body motion transformation septernion
132  virtual septernion transformation() const = 0;
133 
134  //- Update properties from given dictionary
135  virtual bool read(const dictionary& SBMFCoeffs) = 0;
136 
137  //- Write in dictionary format
138  virtual void writeData(Ostream&) const;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::solidBodyMotionFunction::transformation
virtual septernion transformation() const =0
Return the solid-body motion transformation septernion.
Foam::solidBodyMotionFunction::~solidBodyMotionFunction
virtual ~solidBodyMotionFunction()=default
Destructor.
Foam::solidBodyMotionFunction::solidBodyMotionFunction
solidBodyMotionFunction(const solidBodyMotionFunction &)=delete
No copy construct.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::solidBodyMotionFunction::New
static autoPtr< solidBodyMotionFunction > New(const dictionary &SBMFCoeffs, const Time &runTime)
Select constructed from the SBMFCoeffs dictionary and Time.
Definition: solidBodyMotionFunctionNew.C:34
Foam::septernion
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:66
Foam::solidBodyMotionFunction::TypeName
TypeName("solidBodyMotionFunction")
Runtime type information.
Foam::solidBodyMotionFunction::clone
virtual autoPtr< solidBodyMotionFunction > clone() const =0
Construct and return a clone.
septernion.H
Foam::solidBodyMotionFunction::SBMFCoeffs_
dictionary SBMFCoeffs_
Definition: solidBodyMotionFunction.H:69
Foam::solidBodyMotionFunction::writeData
virtual void writeData(Ostream &) const
Write in dictionary format.
Definition: solidBodyMotionFunction.C:68
Foam::solidBodyMotionFunction
Base class for defining solid-body motions.
Definition: solidBodyMotionFunction.H:63
Foam::solidBodyMotionFunction::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, solidBodyMotionFunction, dictionary,(const dictionary &SBMFCoeffs, const Time &runTime),(SBMFCoeffs, runTime))
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::solidBodyMotionFunction::read
virtual bool read(const dictionary &SBMFCoeffs)=0
Update properties from given dictionary.
Definition: solidBodyMotionFunction.C:60
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::solidBodyMotionFunction::time_
const Time & time_
Definition: solidBodyMotionFunction.H:71
Foam::solidBodyMotionFunction::operator=
void operator=(const solidBodyMotionFunction &)=delete
No copy assignment.
autoPtr.H