All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
coordinateRotation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::coordinateRotation
26 
27 Description
28  Abstract base class for coordinate rotation
29 
30  \verbatim
31  coordinateRotation
32  {
33  type axesRotation
34  e1 (1 0 0);
35  e2 (0 1 0);
36  }
37  \endverbatim
38 
39  Types of coordinateRotation:
40  -# axesRotation
41  -# STARCDRotation
42  -# cylindrical
43  -# EulerCoordinateRotation
44 
45 SourceFiles
46  coordinateRotation.C
47  coordinateRotationNew.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef coordinateRotation_H
52 #define coordinateRotation_H
53 
54 #include "vector.H"
55 #include "tensor.H"
56 #include "tensorField.H"
57 #include "dictionary.H"
58 #include "runTimeSelectionTables.H"
59 #include "objectRegistry.H"
60 #include "polyMesh.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class coordinateRotation Declaration
69 \*---------------------------------------------------------------------------*/
70 
72 {
73 protected:
74 
75  // Protected member functions
76 
77  //- Transform the vector as if it is a diagonal tensor
79  (
80  const tensor&,
81  const vector&
82  ) const;
83 
84 
85 public:
86 
87 
88  //- Runtime type information
89  TypeName("coordinateRotation");
90 
91 
92  // Declare run-time constructor selection table
93  // for constructors with dictionary
95  (
96  autoPtr,
98  dictionary,
99  (
100  const dictionary& dict
101  ),
102  (dict)
103  );
104 
105  // Declare run-time constructor selection table
106  // for constructors with dictionary and list of points
108  (
109  autoPtr,
111  points,
112  (
113  const dictionary& dict, const UList<vector>& points
114  ),
115  (dict, points)
116  );
117 
118 
119  // Constructors
120 
121  //- Construct and return a clone
122  virtual autoPtr<coordinateRotation> clone() const = 0;
123 
124 
125  // Selectors
126 
127  //- Select constructed from dictionary and list of points
129  (
130  const dictionary& dict, const UList<vector>& points
131  );
132 
133  //- Select constructed from dictionary
135  (
136  const dictionary& dict
137  );
138 
139 
140  //- Destructor
141  virtual ~coordinateRotation()
142  {}
143 
144 
145  // Member Functions
146 
147  //- Update the rotation for a list of points
148  virtual void updatePoints(const UList<vector>& points) = 0;
149 
150  //- Return local-to-global transformation tensor
151  virtual const tensor& R() const = 0;
152 
153  //- Return local Cartesian x-axis
154  virtual const vector e1() const = 0;
155 
156  //- Return local Cartesian y-axis
157  virtual const vector e2() const = 0;
158 
159  //- Return local Cartesian z-axis
160  virtual const vector e3() const = 0;
161 
162  //- Return true if the rotation tensor is uniform
163  virtual bool uniform() const
164  {
165  return true;
166  }
167 
168  //- Transform vector using transformation tensor
169  virtual vector transform(const vector& v) const = 0;
170 
171  //- Transform vectorField using transformation tensor field
172  virtual tmp<vectorField> transform(const vectorField& vf) const = 0;
173 
174  //- Inverse transform vector using transformation tensor
175  virtual vector invTransform(const vector& v) const = 0;
176 
177  //- Inverse transform vectorField using transformation tensor field
178  virtual tmp<vectorField> invTransform(const vectorField& vf) const = 0;
179 
180  //- Transform tensor using transformation tensorField
181  virtual tensor transform
182  (
183  const vector& p,
184  const tensor& t
185  ) const = 0;
186 
187  //- Transform tensor field using transformation tensorField
189  (
190  const tensorField& tf
191  ) const = 0;
192 
193  //- Transform diagTensor masquerading as a vector using transformation
194  // tensor and return symmTensor
196  (
197  const vector& p,
198  const vector& v
199  ) const = 0;
200 
201  //- Transform diagTensorField masquerading as a vectorField
202  // using transformation tensorField and return symmTensorField
204  (
205  const vectorField& vf
206  ) const = 0;
207 
208 
209  // Write
210 
211  //- Write
212  virtual void write(Ostream&) const = 0;
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:74
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Abstract base class for coordinate rotation.
virtual bool uniform() const
Return true if the rotation tensor is uniform.
virtual void write(Ostream &) const =0
Write.
static autoPtr< coordinateRotation > New(const dictionary &dict, const UList< vector > &points)
Select constructed from dictionary and list of points.
TypeName("coordinateRotation")
Runtime type information.
virtual void updatePoints(const UList< vector > &points)=0
Update the rotation for a list of points.
virtual const vector e2() const =0
Return local Cartesian y-axis.
virtual vector invTransform(const vector &v) const =0
Inverse transform vector using transformation tensor.
virtual autoPtr< coordinateRotation > clone() const =0
Construct and return a clone.
virtual symmTensor transformDiagTensor(const vector &p, const vector &v) const =0
Transform diagTensor masquerading as a vector using transformation.
virtual const tensor & R() const =0
Return local-to-global transformation tensor.
declareRunTimeSelectionTable(autoPtr, coordinateRotation, dictionary,(const dictionary &dict),(dict))
virtual const vector e1() const =0
Return local Cartesian x-axis.
virtual ~coordinateRotation()
Destructor.
virtual vector transform(const vector &v) const =0
Transform vector using transformation tensor.
symmTensor transformVectorDiagTensor(const tensor &, const vector &) const
Transform the vector as if it is a diagonal tensor.
virtual const vector e3() const =0
Return local Cartesian z-axis.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for managing temporary objects.
Definition: tmp.H:55
const tensorField & tf
const pointField & points
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
dictionary dict
volScalarField & p