Remove trailing whitespace systematically
[foam-extend-3.2.git] / src / foam / coordinateSystems / toroidalCS.H
blobf42baa465aff226c00ce102c847bc0cf3bf4ce42
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::toroidalCS
27 Description
28     Toroidal coordinate system, always in degrees
30 Note
31     The maintenance of this class may lag that of the main types.
33 SourceFiles
34     toroidalCS.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef toroidalCS_H
39 #define toroidalCS_H
41 #include "coordinateSystem.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                         Class toroidalCS Declaration
51 \*---------------------------------------------------------------------------*/
53 class toroidalCS
55     public coordinateSystem
57     // Private data
59         //- Radius of the torus
60         scalar radius_;
62         //- Are angles in degrees? (default = true)
63         bool inDegrees_;
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
75         (
76             const vectorField&,
77             bool translate
78         ) const;
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
87         (
88             const vectorField&,
89             bool translate
90         ) const;
92 public:
94     //- Runtime type information
95     TypeName("toroidal");
98     // Constructors
100         //- Construct from origin, rotation and radius
101         toroidalCS
102         (
103             const word& name,
104             const point& origin,
105             const coordinateRotation&,
106             const scalar radius,
107             const bool inDegrees = true
108         );
111         //- Construct from dictionary
112         toroidalCS(const word& name, const dictionary&);
114         //- Return clone
115         virtual autoPtr<coordinateSystem> clone() const
116         {
117             return autoPtr<coordinateSystem>(new toroidalCS(*this));
118         }
121     // Member Functions
123         // Global information about the coordinate system
125             //- Directions in which the span is limited
126             virtual spanInfo spanLimited() const;
128             //- Span bounds
129             virtual boundBox spanBounds() const;
132         //- Are angles in degrees?
133         bool  inDegrees() const;
135         //- Non-const access to inDegrees
136         bool& inDegrees();
138         //- Return radius
139         scalar radius() const
140         {
141             return radius_;
142         }
144         //- Write
145         virtual void write(Ostream&) const;
147         //- Write dictionary
148         virtual void writeDict(Ostream&, bool subDict=true) const;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 #endif
160 // ************************************************************************* //