1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 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.
68 \*---------------------------------------------------------------------------*/
70 #ifndef coordinateRotation_H
71 #define coordinateRotation_H
75 #include "dictionary.H"
76 #include "runTimeSelectionTables.H"
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 /*---------------------------------------------------------------------------*\
84 Class coordinateRotation Declaration
85 \*---------------------------------------------------------------------------*/
87 class coordinateRotation
93 //- the combination of local axes to be used
101 // Private Member Functions
103 //- Calculate transformation tensor
108 const axisOrder& order = e3e1
113 //- Runtime type information
114 TypeName("coordinateRotation");
119 coordinateRotation();
121 //- Construct from 2 axes
128 //- Construct from dictionary
129 coordinateRotation(const dictionary&);
132 autoPtr<coordinateRotation> clone() const
134 return autoPtr<coordinateRotation>(new coordinateRotation(*this));
137 // Declare run-time constructor selection table
139 declareRunTimeSelectionTable
145 const dictionary& dict
153 //- Select constructed from Istream
154 static autoPtr<coordinateRotation> New
156 const dictionary& dict
162 virtual ~coordinateRotation()
168 //- Return local-to-global transformation tensor
169 const tensor& R() const
174 //- Return local Cartesian x-axis
175 const vector e1() const
177 return tensor::T().x();
180 //- Return local Cartesian y-axis
181 const vector e2() const
183 return tensor::T().y();
186 //- Return local Cartesian z-axis
187 const vector e3() const
189 return tensor::T().z();
195 //- assign from dictionary
196 void operator=(const dictionary&);
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //