1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | 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"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class toroidalCS Declaration
52 \*---------------------------------------------------------------------------*/
56 public coordinateSystem
60 //- Radius of the torus
63 //- Are angles in degrees? (default = true)
67 // Private Member Functions
69 //- Convert from local coordinate system to the global Cartesian system
70 // with optional translation for the origin
71 virtual vector localToGlobal(const vector&, bool translate) const;
73 //- Convert from local coordinate system to the global Cartesian system
74 // with optional translation for the origin
75 virtual tmp<vectorField> localToGlobal
81 //- Convert from global Cartesian system to the local coordinate system
82 // with optional translation for the origin
83 virtual vector globalToLocal(const vector&, bool translate) const;
85 //- Convert from global Cartesian system to the local coordinate system
86 // with optional translation for the origin
87 virtual tmp<vectorField> globalToLocal
95 //- Runtime type information
101 //- Construct from origin, rotation and radius
106 const coordinateRotation&,
108 const bool inDegrees = true
112 //- Construct from dictionary
113 toroidalCS(const word& name, const dictionary&);
116 virtual autoPtr<coordinateSystem> clone() const
118 return autoPtr<coordinateSystem>(new toroidalCS(*this));
124 // Global information about the coordinate system
126 //- Directions in which the span is limited
127 virtual spanInfo spanLimited() const;
130 virtual boundBox spanBounds() const;
133 //- Are angles in degrees?
134 bool inDegrees() const;
136 //- Non-const access to inDegrees
140 scalar radius() const
146 virtual void write(Ostream&) const;
149 virtual void writeDict(Ostream&, bool subDict = true) const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //