1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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 "runTimeSelectionTables.H"
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 /*---------------------------------------------------------------------------*\
85 Class coordinateRotation Declaration
86 \*---------------------------------------------------------------------------*/
88 class coordinateRotation
94 //- the combination of local axes to be used
103 // Private Member Functions
105 //- Calculate transformation tensor
110 const axisOrder& order = e3e1
116 //- Runtime type information
117 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 // ************************************************************************* //