1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::coordinateRotation
28 A coordinate rotation specified per local axes and the base class for
29 other rotation specifications
31 The rotation is defined by a combination of local vectors (e1/e2), (e2/e3)
32 or (e3/e1). Any nonorthogonality will be absorbed into the second vector.
34 For convenience, the dictionary constructor forms allow a few shortcuts:
35 - if the \c type is not otherwise specified, the type \c axes
37 - if an axes specification (eg, e3/e1) is used, the coordinateRotation
38 sub-dictionary can be dropped.
40 Specifying the rotation by an EulerCoordinateRotation
41 (type "EulerRotation") or by a STARCDCoordinateRotation
42 (type "STARCDRotation") requires the coordinateRotation sub-dictionary.
52 - the rotation angles are in degrees, unless otherwise explictly specified:
59 rotation (0 0 3.141592654);
64 Specifying the local vectors as an \c axis (corresponding to e3) and a
65 \c direction (corresponding to e1), is allowed for backwards
66 compatibility, but this terminology is generally a bit confusing.
69 \*---------------------------------------------------------------------------*/
71 #ifndef coordinateRotation_H
72 #define coordinateRotation_H
76 #include "dictionary.H"
77 #include "runTimeSelectionTables.H"
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 /*---------------------------------------------------------------------------*\
85 Class coordinateRotation Declaration
86 \*---------------------------------------------------------------------------*/
88 class coordinateRotation
94 //- the combination of local axes to be used
102 // Private Member Functions
104 //- Calculate transformation tensor
109 const axisOrder& order = e3e1
114 //- Runtime type information
115 TypeName("coordinateRotation");
120 coordinateRotation();
122 //- Construct from 2 axes
129 //- Construct from dictionary
130 coordinateRotation(const dictionary&);
133 autoPtr<coordinateRotation> clone() const
135 return autoPtr<coordinateRotation>(new coordinateRotation(*this));
138 // Declare run-time constructor selection table
140 declareRunTimeSelectionTable
146 const dictionary& dict
154 //- Select constructed from Istream
155 static autoPtr<coordinateRotation> New
157 const dictionary& dict
162 virtual ~coordinateRotation()
168 //- Reset rotation to an identity rotation
169 virtual void clear();
171 //- Return local-to-global transformation tensor
172 const tensor& R() const
177 //- Return local Cartesian x-axis
178 const vector e1() const
180 return tensor::T().x();
183 //- Return local Cartesian y-axis
184 const vector e2() const
186 return tensor::T().y();
189 //- Return local Cartesian z-axis
190 const vector e3() const
192 return tensor::T().z();
198 //- assign from dictionary
199 void operator=(const dictionary&);
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //