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 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  coordinateRotation
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 "vectorField.H"
65 #include "tensorField.H"
66 #include "dictionary.H"
67 #include "runTimeSelectionTables.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class coordinateRotation Declaration
76 \*---------------------------------------------------------------------------*/
77 
79 {
80 protected:
81 
82  // Protected Member Functions
83 
84  //- Determine best-guess for an orthogonal axis
85  static vector findOrthogonal(const vector& axis);
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeNameNoDebug("coordinateRotation");
92 
93  // Declare run-time constructor selection table from dictionary
95  (
96  autoPtr,
98  dictionary,
99  (
100  const dictionary& dict
101  ),
102  (dict)
103  );
104 
105 
106  // Constructors
107 
108  // Uses all default constructors
109 
110  //- Construct and return a clone
111  virtual autoPtr<coordinateRotation> clone() const = 0;
112 
113 
114  // Selectors
115 
116  //- Select constructed from dictionary
118 
119 
120  //- Destructor
121  virtual ~coordinateRotation() = default;
122 
123 
124  // Member Functions
125 
126  //- Reset specification
127  virtual void clear() = 0;
128 
129  //- Calculate and return the rotation tensor
130  virtual tensor R() const = 0;
131 
132 
133  // Write
134 
135  //- Write information
136  virtual void write(Ostream& os) const = 0;
137 
138  //- Write dictionary entry
139  virtual void writeEntry(const word& keyword, Ostream& os) const = 0;
140 
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:72
Foam::Tensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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.
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:77
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:121
Foam::coordinateRotation::writeEntry
virtual void writeEntry(const word &keyword, Ostream &os) const =0
Write dictionary entry.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
tensorField.H
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 >
vectorField.H
dictionary.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:44