1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::coordinateRotation
29 A coordinate rotation specified per local axes and the base class for
30 other rotation specifications
32 The rotation is defined by a combination of local vectors (e1/e2), (e2/e3)
33 or (e3/e1). Any nonorthogonality will be absorbed into the second vector.
35 For convenience, the dictionary constructor forms allow a few shortcuts:
36 - if the @c type is not otherwise specified, the type @c axes
38 - if an axes specification (eg, e3/e1) is used, the coordinateRotation
39 sub-dictionary can be dropped.
41 Specifying the rotation by an EulerCoordinateRotation
42 (type "EulerRotation") or by a STARCDCoordinateRotation
43 (type "STARCDRotation") requires the coordinateRotation sub-dictionary.
53 - the rotation angles are in degrees, unless otherwise explictly specified:
60 rotation (0 0 3.141592654);
65 Specifying the local vectors as an @c axis (corresponding to e3) and a
66 @c direction (corresponding to e1), is allowed for backwards
67 compatibility, but this terminology is generally a bit confusing.
69 \*---------------------------------------------------------------------------*/
71 #ifndef coordinateRotation_H
72 #define coordinateRotation_H
76 #include "runTimeSelectionTables.H"
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 /*---------------------------------------------------------------------------*\
86 Class coordinateRotation Declaration
87 \*---------------------------------------------------------------------------*/
89 class coordinateRotation
95 //- the combination of local axes to be used
104 // Private Member Functions
106 //- Calculate transformation tensor
111 const axisOrder& order = e3e1
117 //- Runtime type information
118 TypeName("coordinateRotation");
123 coordinateRotation();
125 //- Construct from 2 axes
132 //- Construct from 1 vector and angle
139 //- Construct from dictionary
140 coordinateRotation(const dictionary&);
143 autoPtr<coordinateRotation> clone() const
145 return autoPtr<coordinateRotation>(new coordinateRotation(*this));
148 // Declare run-time constructor selection table
151 declareRunTimeSelectionTable
157 const dictionary& dict
166 //- Select constructed from Istream
167 static autoPtr<coordinateRotation> New
169 const dictionary& dict
175 virtual ~coordinateRotation()
181 //- Return local-to-global transformation tensor
182 const tensor& R() const
187 //- Return local Cartesian x-axis
190 return tensor::T().x();
193 //- Return local Cartesian y-axis
196 return tensor::T().y();
199 //- Return local Cartesian z-axis
202 return tensor::T().z();
208 //- assign from dictionary
209 void operator=(const dictionary&);
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // ************************************************************************* //