initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / meshTools / coordinateSystems / coordinateRotation / EulerCoordinateRotation.H
blobd64e0ef5a43a90b5160a273c82186fce3755377a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::EulerCoordinateRotation
28 Description
29     A coordinateRotation defined in the z-x-y Euler convention.
31     The 3 rotations are defined in the Euler convention
32     (around Z, around X' and around Z').
33     For reference and illustration, see
34     http://mathworld.wolfram.com/EulerAngles.html
35     Note, however, that it is the reverse transformation
36     (local->global) that is defined here.
38     - the rotation angles are in degrees, unless otherwise explictly specified:
40     @verbatim
41         coordinateRotation
42         {
43             type        EulerRotation
44             degrees     false;
45             rotation    (0 0 3.141592654);
46         }
47     @endverbatim
49 \*---------------------------------------------------------------------------*/
51 #ifndef EulerCoordinateRotation_H
52 #define EulerCoordinateRotation_H
54 #include "coordinateRotation.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace Foam
61 /*---------------------------------------------------------------------------*\
62                    Class EulerCoordinateRotation Declaration
63 \*---------------------------------------------------------------------------*/
65 class EulerCoordinateRotation
67     public coordinateRotation
69     // Private member functions
71         //- Calculate transformation tensor
72         void calcTransform
73         (
74             const scalar phiAngle,
75             const scalar thetaAngle,
76             const scalar psiAngle,
77             const bool inDegrees = true
78         );
81 public:
83     //- Runtime type information
84     TypeName("EulerRotation");
87     // Constructors
89         //- Construct null
90         EulerCoordinateRotation();
92         //- Construct from rotation vector
93         EulerCoordinateRotation
94         (
95             const vector& phiThetaPsi,
96             const bool inDegrees = true
97         );
99         //- Construct from components of rotation vector
100         EulerCoordinateRotation
101         (
102             const scalar phiAngle,
103             const scalar thetaAngle,
104             const scalar psiAngle,
105             const bool inDegrees = true
106         );
108         //- Construct from dictionary
109         EulerCoordinateRotation(const dictionary&);
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 } // End namespace Foam
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 #endif
122 // ************************************************************************* //