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-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 Namespace
28  Foam::coordinateRotations
29 
30 Description
31  Namespace for coordinate system rotations.
32 
33 Class
34  Foam::coordinateRotation
35 
36 Description
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 
56 SourceFiles
57  coordinateRotation.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef coordinateRotation_H
62 #define coordinateRotation_H
63 
64 #include "autoPtr.H"
65 #include "vector.H"
66 #include "tensor.H"
67 #include "dictionary.H"
68 #include "runTimeSelectionTables.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class coordinateRotation Declaration
77 \*---------------------------------------------------------------------------*/
78 
80 {
81 protected:
82 
83  // Protected Member Functions
84 
85  //- Determine best-guess for an orthogonal axis
86  static vector findOrthogonal(const vector& axis);
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeNameNoDebug("coordinateRotation");
93 
94  // Declare run-time constructor selection table from dictionary
96  (
97  autoPtr,
99  dictionary,
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 constructed from dictionary
119 
120 
121  //- Destructor
122  virtual ~coordinateRotation() = default;
123 
124 
125  // Member Functions
126 
127  //- Reset specification
128  virtual void clear() = 0;
129 
130  //- Calculate and return the rotation tensor
131  virtual tensor R() const = 0;
132 
133 
134  // Write
135 
136  //- Write information
137  virtual void write(Ostream& os) const = 0;
138 
139  //- Write dictionary entry
140  virtual void writeEntry(const word& keyword, Ostream& os) const = 0;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Foam::coordinateRotation::New
static autoPtr< coordinateRotation > New(const dictionary &dict)
Select constructed from dictionary.
Definition: coordinateRotation.C:71
Foam::Tensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::coordinateRotation::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, coordinateRotation, dictionary,(const dictionary &dict),(dict))
Foam::coordinateRotation::TypeNameNoDebug
TypeNameNoDebug("coordinateRotation")
Runtime type information.
Foam::coordinateRotation::~coordinateRotation
virtual ~coordinateRotation()=default
Destructor.
tensor.H
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:78
Foam::coordinateRotation::R
virtual tensor R() const =0
Calculate and return the rotation tensor.
Foam::coordinateRotation::write
virtual void write(Ostream &os) const =0
Write information.
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::coordinateRotation::writeEntry
virtual void writeEntry(const word &keyword, Ostream &os) const =0
Write dictionary entry.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::coordinateRotation::clear
virtual void clear()=0
Reset specification.
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.
Foam::Vector< scalar >
dictionary.H
vector.H
Foam::coordinateRotation::clone
virtual autoPtr< coordinateRotation > clone() const =0
Construct and return a clone.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::coordinateRotation::findOrthogonal
static vector findOrthogonal(const vector &axis)
Determine best-guess for an orthogonal axis.
Definition: coordinateRotation.C:43
autoPtr.H