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-2021 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 | Required | Default
50  type | Type name: starcd (or STARCDRotation) | yes |
51  angles | The z-x-y rotation angles | yes |
52  degrees | Angles are in degrees | no | true
53  \endtable
54 
55 SourceFiles
56  STARCDCoordinateRotation.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef coordinateRotations_starcd_H
61 #define coordinateRotations_starcd_H
62 
63 #include "coordinateRotation.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace coordinateRotations
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class coordinateRotations::starcd Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class starcd
77 :
78  public coordinateRotation
79 {
80  // Private Data
81 
82  //- The rotation angles
83  vector angles_;
84 
85  //- Angles measured in degrees
86  bool degrees_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeNameNoDebug("starcd");
93 
94 
95  // Constructors
96 
97  //- Default construct - an identity transform
98  starcd();
99 
100  //- Copy construct
101  starcd(const starcd& crot);
102 
103  //- Construct from rotation vector
104  starcd(const vector& rotZrotXrotY, bool degrees);
105 
106  //- Construct from components of rotation vector
107  starcd(scalar rotZ, scalar rotX, scalar rotY, bool degrees);
108 
109  //- Construct from dictionary
110  explicit starcd(const dictionary& dict);
111 
112  //- Return clone
114  {
115  return
118  }
119 
120 
121  //- Destructor
122  virtual ~starcd() = default;
123 
124 
125  // Static Member Functions
126 
127  //- The rotation tensor calculated for the specified STARCD angles
128  //- interpreted as rotate-Z, rotate-X, rotate-Y
129  static tensor rotation(const vector& angles, bool degrees);
130 
131 
132  // Member Functions
133 
134  //- Reset specification
135  virtual void clear();
136 
137  //- The rotation tensor calculated for the specified STARCD angles.
138  virtual tensor R() const;
139 
140  //- Write information
141  virtual void write(Ostream& os) const;
142 
143  //- Write dictionary entry
144  virtual void writeEntry(const word& keyword, Ostream& os) const;
145 
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 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::coordinateRotations::starcd::R
virtual tensor R() const
The rotation tensor calculated for the specified STARCD angles.
Definition: STARCDCoordinateRotation.C:156
Foam::coordinateRotations::starcd::clear
virtual void clear()
Reset specification.
Definition: STARCDCoordinateRotation.C:149
Foam::STARCDCoordinateRotation
coordinateRotations::starcd STARCDCoordinateRotation
Compatibility typedef 1806.
Definition: STARCDCoordinateRotation.H:173
Foam::coordinateRotations::starcd::writeEntry
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
Definition: STARCDCoordinateRotation.C:169
Foam::coordinateRotations::starcd
A coordinateRotation defined by the STAR-CD convention.
Definition: STARCDCoordinateRotation.H:95
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:78
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::coordinateRotations::starcd::clone
autoPtr< coordinateRotation > clone() const
Return clone.
Definition: STARCDCoordinateRotation.H:132
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::coordinateRotations::starcd::write
virtual void write(Ostream &os) const
Write information.
Definition: STARCDCoordinateRotation.C:162
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::coordinateRotations::starcd::TypeNameNoDebug
TypeNameNoDebug("starcd")
Runtime type information.
Foam::Vector< scalar >
coordinateRotation.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::coordinateRotations::starcd::starcd
starcd()
Default construct - an identity transform.
Definition: STARCDCoordinateRotation.C:97
Foam::coordinateRotations::starcd::~starcd
virtual ~starcd()=default
Destructor.
Foam::coordinateRotations::starcd::rotation
static tensor rotation(const vector &angles, bool degrees)
Definition: STARCDCoordinateRotation.C:65