1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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/>.
28 Toroidal coordinate system, always in degrees
31 The maintenance of this class may lag that of the main types.
36 \*---------------------------------------------------------------------------*/
41 #include "coordinateSystem.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class toroidalCS Declaration
51 \*---------------------------------------------------------------------------*/
55 public coordinateSystem
59 //- Radius of the torus
62 //- Are angles in degrees? (default = true)
66 // Private Member Functions
68 //- Convert from local coordinate system to the global Cartesian system
69 // with optional translation for the origin
70 virtual vector localToGlobal(const vector&, bool translate) const;
72 //- Convert from local coordinate system to the global Cartesian system
73 // with optional translation for the origin
74 virtual tmp<vectorField> localToGlobal
80 //- Convert from global Cartesian system to the local coordinate system
81 // with optional translation for the origin
82 virtual vector globalToLocal(const vector&, bool translate) const;
84 //- Convert from global Cartesian system to the local coordinate system
85 // with optional translation for the origin
86 virtual tmp<vectorField> globalToLocal
94 //- Runtime type information
100 //- Construct from origin, rotation and radius
105 const coordinateRotation&,
107 const bool inDegrees = true
111 //- Construct from dictionary
112 toroidalCS(const word& name, const dictionary&);
115 virtual autoPtr<coordinateSystem> clone() const
117 return autoPtr<coordinateSystem>(new toroidalCS(*this));
123 // Global information about the coordinate system
125 //- Directions in which the span is limited
126 virtual spanInfo spanLimited() const;
129 virtual boundBox spanBounds() const;
132 //- Are angles in degrees?
133 bool inDegrees() const;
135 //- Non-const access to inDegrees
139 scalar radius() const
145 virtual void write(Ostream&) const;
148 virtual void writeDict(Ostream&, bool subDict=true) const;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //