STARCDCoordinateRotation.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-2017 OpenFOAM Foundation
9 Copyright (C) 2017-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
27Class
28 Foam::coordinateRotations::starcd
29
30Description
31 A coordinateRotation defined by the STAR-CD convention.
32
33 The 3 rotations are defined in the STAR-CD convention
34 (around Z, around X' and around Y'').
35 The order of the parameter arguments matches this rotation order.
36
37 - the rotation angles are in degrees, unless otherwise explicitly specified:
38
39 \verbatim
40 rotation
41 {
42 type starcd;
43 angles (0 0 180);
44 }
45 \endverbatim
46
47 \heading Dictionary entries
48 \table
49 Property | Description | Reqd | Default
50 type | Type name: starcd | yes |
51 angles | The z-x-y rotation angles | yes |
52 degrees | Angles are in degrees | no | true
53 \endtable
54
55Note
56 Also accepts "STARCDRotation" (OpenFOAM-v1806) for the type.
57
58SourceFiles
59 STARCDCoordinateRotation.C
60
61\*---------------------------------------------------------------------------*/
62
63#ifndef Foam_coordinateRotations_starcd_H
64#define Foam_coordinateRotations_starcd_H
65
66#include "coordinateRotation.H"
67
68// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69
70namespace Foam
71{
72namespace coordinateRotations
73{
74
75/*---------------------------------------------------------------------------*\
76 Class coordinateRotations::starcd Declaration
77\*---------------------------------------------------------------------------*/
78
79class starcd
80:
81 public coordinateRotation
82{
83 // Private Data
84
85 //- The rotation angles
86 vector angles_;
87
88 //- Angles measured in degrees
89 bool degrees_;
90
91
92public:
93
94 //- Runtime type information
95 TypeNameNoDebug("starcd");
96
97
98 // Constructors
99
100 //- Default construct - an identity transform
101 starcd();
102
103 //- Copy construct
104 starcd(const starcd& crot);
105
106 //- Construct from rotation vector
107 starcd(const vector& rotZrotXrotY, bool degrees);
108
109 //- Construct from components of rotation vector
110 starcd(scalar rotZ, scalar rotX, scalar rotY, bool degrees);
111
112 //- Construct from dictionary
113 explicit starcd(const dictionary& dict);
115 //- Return clone
117 {
118 return
121 }
122
123
124 //- Destructor
125 virtual ~starcd() = default;
126
127
128 // Static Member Functions
129
130 //- Rotation tensor calculated for the specified STARCD angles
131 //- interpreted as rotate-Z, rotate-X, rotate-Y
132 static tensor rotation(const vector& angles, bool degrees);
133
134
135 // Member Functions
136
137 //- Reset specification
138 virtual void clear();
139
140 //- The rotation tensor calculated for the specified STARCD angles.
141 virtual tensor R() const;
142
143 //- Write information
144 virtual void write(Ostream& os) const;
145
146 //- Write dictionary entry
147 virtual void writeEntry(const word& keyword, Ostream& os) const;
148};
149
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153} // End namespace coordinateRotations
154
155//- Compatibility typedef 1806
157
158} // End namespace Foam
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#endif
163
164// ************************************************************************* //
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.
A coordinateRotation defined by the STAR-CD convention.
starcd()
Default construct - an identity transform.
virtual tensor R() const
The rotation tensor calculated for the specified STARCD angles.
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
virtual ~starcd()=default
Destructor.
virtual void clear()
Reset specification.
TypeNameNoDebug("starcd")
Runtime type information.
static tensor rotation(const vector &angles, bool degrees)
autoPtr< coordinateRotation > clone() const
Return clone.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
coordinateRotations::starcd STARCDCoordinateRotation
Compatibility typedef 1806.
runTime write()
dictionary dict
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68