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 "ellipticCylindricalCS.H"
30 #include "mathematicalConstants.H"
31 #include "addToRunTimeSelectionTable.H"
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(ellipticCylindricalCS, 0);
38 addToRunTimeSelectionTable
41 ellipticCylindricalCS,
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 Foam::ellipticCylindricalCS::ellipticCylindricalCS(const bool inDegrees)
57 Foam::ellipticCylindricalCS::ellipticCylindricalCS
59 const coordinateSystem& cs,
69 Foam::ellipticCylindricalCS::ellipticCylindricalCS
72 const coordinateSystem& cs,
76 coordinateSystem(name, cs),
82 Foam::ellipticCylindricalCS::ellipticCylindricalCS
86 const coordinateRotation& cr,
91 coordinateSystem(name, origin, cr),
97 Foam::ellipticCylindricalCS::ellipticCylindricalCS
102 const vector& direction,
107 coordinateSystem(name, origin, axis, direction),
109 inDegrees_(inDegrees)
113 Foam::ellipticCylindricalCS::ellipticCylindricalCS
116 const dictionary& dict
119 coordinateSystem(name, dict),
120 a_(readScalar(dict.lookup("a"))),
121 inDegrees_(dict.lookupOrDefault<Switch>("degrees", true))
125 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
127 Foam::vector Foam::ellipticCylindricalCS::localToGlobal
133 // Notation: u = local.x() v = local.y() z = local.z();
135 local.y()*( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 );
137 return coordinateSystem::localToGlobal
141 a_*cosh(local.x())*cos(theta),
142 a_*sinh(local.x())*sin(theta),
149 Foam::tmp<Foam::vectorField> Foam::ellipticCylindricalCS::localToGlobal
151 const vectorField& local,
156 local.component(vector::Y)*
157 ( inDegrees_ ? mathematicalConstant::pi/180.0 : 1.0 );
159 vectorField lc(local.size());
163 a_*cosh(local.component(vector::X))*cos(theta)
169 a_*sinh(local.component(vector::X))*sin(theta)
175 local.component(vector::Z)
178 return coordinateSystem::localToGlobal(lc, translate);
182 Foam::vector Foam::ellipticCylindricalCS::globalToLocal
184 const vector& global,
190 "ellipticCylindricalCS::globalToLocal(const vector&, bool) const"
196 Foam::tmp<Foam::vectorField> Foam::ellipticCylindricalCS::globalToLocal
198 const vectorField& global,
204 "ellipticCylindricalCS::globalToLocal(const vectorField&, bool) const"
207 return tmp<vectorField>(vectorField::null());
211 // ************************************************************************* //