coordinateRotation.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) 2018-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Namespace
28 Foam::coordinateRotations
29
30Description
31 Namespace for coordinate system rotations.
32
33Class
34 Foam::coordinateRotation
35
36Description
37 User specification of a coordinate rotation.
38
39 \verbatim
40 rotation
41 {
42 type axes
43 e1 (1 0 0);
44 e2 (0 1 0);
45 }
46 \endverbatim
47
48 Types of coordinateRotations:
49 -# \link coordinateRotations::identity none \endlink
50 -# \link coordinateRotations::axes axes \endlink
51 -# \link coordinateRotations::axisAngle axisAngle \endlink
52 -# \link coordinateRotations::cylindrical cylindrical \endlink
53 -# \link coordinateRotations::euler euler \endlink
54 -# \link coordinateRotations::starcd starcd \endlink
55
56SourceFiles
57 coordinateRotation.C
58
59\*---------------------------------------------------------------------------*/
60
61#ifndef Foam_coordinateRotation_H
62#define Foam_coordinateRotation_H
63
64#include "autoPtr.H"
65#include "vector.H"
66#include "tensor.H"
67#include "dictionary.H"
69
70// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71
72namespace Foam
73{
74
75/*---------------------------------------------------------------------------*\
76 Class coordinateRotation Declaration
77\*---------------------------------------------------------------------------*/
80{
81protected:
82
83 // Protected Member Functions
84
85 //- Determine best-guess for an orthogonal axis
86 static vector findOrthogonal(const vector& axis);
87
88
89public:
90
91 //- Runtime type information
92 TypeNameNoDebug("coordinateRotation");
93
94 // Declare run-time constructor selection table from dictionary
96 (
97 autoPtr,
100 (
101 const dictionary& dict
102 ),
103 (dict)
104 );
105
106
107 // Constructors
108
109 // Uses all default constructors
110
111 //- Construct and return a clone
112 virtual autoPtr<coordinateRotation> clone() const = 0;
113
114
115 // Selectors
116
117 //- Select construct the specified coordinate rotation type
118 //
119 // An empty modelType will be treated as "axes" (eg, e1/e3)
121 (
122 word modelType,
123 const dictionary& dict
124 );
125
126 //- Select construct from dictionary (requires the "type" entry)
128
129
130 //- Destructor
131 virtual ~coordinateRotation() = default;
132
133
134 // Member Functions
135
136 //- Reset specification
137 virtual void clear() = 0;
138
139 //- Calculate and return the rotation tensor
140 virtual tensor R() const = 0;
141
142
143 // Write
144
145 //- Write information
146 virtual void write(Ostream& os) const = 0;
147
148 //- Write dictionary entry
149 virtual void writeEntry(const word& keyword, Ostream& os) const = 0;
150};
151
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155} // End namespace Foam
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#endif
160
161// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
User specification of a coordinate rotation.
static vector findOrthogonal(const vector &axis)
Determine best-guess for an orthogonal axis.
virtual void clear()=0
Reset specification.
static autoPtr< coordinateRotation > New(word modelType, const dictionary &dict)
Select construct the specified coordinate rotation type.
virtual tensor R() const =0
Calculate and return the rotation tensor.
TypeNameNoDebug("coordinateRotation")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, coordinateRotation, dictionary,(const dictionary &dict),(dict))
virtual void writeEntry(const word &keyword, Ostream &os) const =0
Write dictionary entry.
virtual ~coordinateRotation()=default
Destructor.
virtual autoPtr< coordinateRotation > clone() const =0
Construct and return a clone.
virtual void write(Ostream &os) const =0
Write information.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68