1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "STARCDCoordinateRotation.H"
28 #include "mathematicalConstants.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 defineTypeNameAndDebug(STARCDCoordinateRotation, 0);
36 addToRunTimeSelectionTable
39 STARCDCoordinateRotation,
45 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
47 void Foam::STARCDCoordinateRotation::calcTransform
61 x *= constant::mathematical::pi/180.0;
62 y *= constant::mathematical::pi/180.0;
63 z *= constant::mathematical::pi/180.0;
70 cos(y)*cos(z) - sin(x)*sin(y)*sin(z),
72 sin(x)*cos(y)*sin(z) + sin(y)*cos(z),
74 cos(y)*sin(z) + sin(x)*sin(y)*cos(z),
76 sin(y)*sin(z) - sin(x)*cos(y)*cos(z),
86 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
88 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation()
94 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
96 const vector& rotZrotXrotY,
104 rotZrotXrotY.component(vector::X),
105 rotZrotXrotY.component(vector::Y),
106 rotZrotXrotY.component(vector::Z),
112 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
122 calcTransform(rotZ, rotX, rotY, inDegrees);
126 Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
128 const dictionary& dict
133 vector rotation(dict.lookup("rotation"));
137 rotation.component(vector::X),
138 rotation.component(vector::Y),
139 rotation.component(vector::Z),
140 dict.lookupOrDefault("degrees", true)
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //