cylindricalCS.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::coordinateSystems::cylindrical
26 
27 Description
28  Cylindrical coordinate system
29 
30 SourceFiles
31  cylindricalCS.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cylindricalCS_H
36 #define cylindricalCS_H
37 
38 #include "coordinateSystem.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace coordinateSystems
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cylindrical Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class cylindrical
52 :
53  public coordinateSystem
54 {
55  // Private Data members
56 
57  //- Are angles in degrees? (default = true)
58  bool inDegrees_;
59 
60 
61  // Private Member Functions
62 
63 
64  //- Convert from local coordinate system to the global Cartesian system
65  // with optional translation for the origin
66  virtual vector localToGlobal(const vector&, bool translate) const;
67 
68  //- Convert from local coordinate system to the global Cartesian system
69  // with optional translation for the origin
70  virtual tmp<vectorField> localToGlobal
71  (
72  const vectorField&,
73  bool translate
74  ) const;
75 
76  //- Convert from global Cartesian system to the local coordinate system
77  // with optional translation for the origin
78  virtual vector globalToLocal(const vector&, bool translate) const;
79 
80  //- Convert from global Cartesian system to the local coordinate system
81  // with optional translation for the origin
82  virtual tmp<vectorField> globalToLocal
83  (
84  const vectorField&,
85  bool translate
86  ) const;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("cylindrical");
93 
94 
95  // Constructors
96 
97  //- Construct from origin and rotation
99  (
100  const word& name,
101  const point& origin,
102  const coordinateRotation&,
103  const bool inDegrees=true
104  );
105 
106  //- Construct from origin and 2 axes
108  (
109  const word& name,
110  const point& origin,
111  const vector& axis,
112  const vector& dirn,
113  const bool inDegrees=true
114  );
115 
116  //- Construct from dictionary and name
117  cylindrical(const word&, const dictionary&);
118 
119  //- Construct and return a clone
120  virtual autoPtr<coordinateSystem> clone() const
121  {
122  return autoPtr<coordinateSystem>(new cylindrical(*this));
123  }
124 
125 
126  //- Destructor
127  virtual ~cylindrical();
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 } // End namespace coordinateSystems
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Base class for other coordinate system specifications.
Abstract base class for coordinate rotation.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & name() const
Return name.
cylindrical(const word &name, const point &origin, const coordinateRotation &, const bool inDegrees=true)
Construct from origin and rotation.
Cylindrical coordinate system.
Definition: cylindricalCS.H:50
TypeName("cylindrical")
Runtime type information.
const point & origin() const
Return origin.
virtual ~cylindrical()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
virtual autoPtr< coordinateSystem > clone() const
Construct and return a clone.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.