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
25 \*---------------------------------------------------------------------------*/
27 #include "STARCDCoordinateRotation.H"
30 #include "mathematicalConstants.H"
31 #include "dictionary.H"
32 #include "addToRunTimeSelectionTable.H"
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(STARCDCoordinateRotation, 0);
39 addToRunTimeSelectionTable
42 STARCDCoordinateRotation,
48 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
50 void Foam::STARCDCoordinateRotation::calcTransform
64 x *= mathematicalConstant::pi/180.0;
65 y *= mathematicalConstant::pi/180.0;
66 z *= mathematicalConstant::pi/180.0;
73 cos(y)*cos(z) - sin(x)*sin(y)*sin(z),
75 sin(x)*cos(y)*sin(z) + sin(y)*cos(z),
77 cos(y)*sin(z) + sin(x)*sin(y)*cos(z),
79 sin(y)*sin(z) - sin(x)*cos(y)*cos(z),
89 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
91 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation()
97 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
99 const vector& rotZrotXrotY,
107 rotZrotXrotY.component(vector::X),
108 rotZrotXrotY.component(vector::Y),
109 rotZrotXrotY.component(vector::Z),
115 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
125 calcTransform(rotZ, rotX, rotY, inDegrees);
129 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
131 const dictionary& dict
136 vector rotation(dict.lookup("rotation"));
140 rotation.component(vector::X),
141 rotation.component(vector::Y),
142 rotation.component(vector::Z),
143 dict.lookupOrDefault<Switch>("degrees", true)
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //