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-2024 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 Class
28  Foam::coordinateRotations::starcd
29 
30 Description
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 
55 Note
56  Also accepts "STARCDRotation" (OpenFOAM-v1806) for the type.
57 
58 SourceFiles
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 
70 namespace Foam
71 {
72 namespace coordinateRotations
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class coordinateRotations::starcd Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class 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 
92 public:
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);
114 
115  //- Return clone
117  {
118  return coordinateRotation::Clone(*this);
119  }
120 
121 
122  //- Destructor
123  virtual ~starcd() = default;
124 
125 
126  // Static Member Functions
127 
128  //- Rotation tensor calculated for the specified STARCD angles
129  //- interpreted as rotate-Z, rotate-X, rotate-Y
130  static tensor rotation(const vector& angles, bool degrees);
131 
132 
133  // Member Functions
134 
135  //- Reset specification
136  virtual void clear();
137 
138  //- The rotation tensor calculated for the specified STARCD angles.
139  virtual tensor R() const;
140 
141  //- Write information
142  virtual void write(Ostream& os) const;
143 
144  //- Write dictionary entry
145  virtual void writeEntry(const word& keyword, Ostream& os) const;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace coordinateRotations
152 
153 //- Compatibility typedef 1806
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
coordinateRotations::starcd STARCDCoordinateRotation
Compatibility typedef 1806.
dictionary dict
virtual tensor R() const
The rotation tensor calculated for the specified STARCD angles.
static autoPtr< coordinateRotation > Clone(const Derived &crot)
Clone a coordinate rotation.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void write(Ostream &os) const
Write information.
starcd()
Default construct - an identity transform.
static tensor rotation(const vector &angles, bool degrees)
Rotation tensor calculated for the specified STARCD angles interpreted as rotate-Z, rotate-X, rotate-Y.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Vector< scalar > vector
Definition: vector.H:57
TypeNameNoDebug("starcd")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual ~starcd()=default
Destructor.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
virtual void clear()
Reset specification.
A coordinateRotation defined by the STAR-CD convention.
autoPtr< coordinateRotation > clone() const
Return clone.
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Tensor of scalars, i.e. Tensor<scalar>.
Namespace for OpenFOAM.