cylindricalCS.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2014 OpenFOAM Foundation
9  Copyright (C) 2018-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::coordSystem::cylindrical
29 
30 Description
31  A cylindrical coordinate system (r-theta-z).
32  The coordinate system angle theta is always in radians.
33 
34  \heading Dictionary entries
35  \table
36  Property | Description | Required | Default
37  type | type name: cylindrical | yes |
38  \endtable
39 
40 SourceFiles
41  cylindricalCS.C
42  cylindricalCSTransform.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef cylindricalCS_H
47 #define cylindricalCS_H
48 
49 #include "coordinateSystem.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace coordSystem
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class coordSystem::cylindrical Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class cylindrical
63 :
64  public coordinateSystem
65 {
66 protected:
67 
68  // Protected Member Functions
69 
70  //- From local coordinate system to the global Cartesian system
71  //- with optional translation for the origin
72  virtual vector localToGlobal
73  (
74  const vector& local,
75  bool translate
76  ) const;
77 
78  //- From local coordinate system to the global Cartesian system
79  //- with optional translation for the origin
81  (
82  const vectorField& local,
83  bool translate
84  ) const;
85 
86  //- From global Cartesian system to the local coordinate system
87  //- with optional translation for the origin
88  virtual vector globalToLocal
89  (
90  const vector& global,
91  bool translate
92  ) const;
93 
94  //- Convert from global Cartesian system to the local coordinate system
95  //- with optional translation for the origin
97  (
98  const vectorField& global,
99  bool translate
100  ) const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeNameNoDebug("cylindrical");
107 
108 
109  // Static Members
110 
111  //- Global (identity) cylindrical coordinate system
112  static const cylindrical null;
113 
114 
115  // Constructors
116 
117  //- Default construct. This is an identity coordinate system
118  cylindrical();
119 
120  //- Copy construct
121  cylindrical(const cylindrical& csys) = default;
122 
123  //- Move construct
124  cylindrical(cylindrical&& csys) = default;
125 
126  //- Copy construct from another coordinateSystem type
127  explicit cylindrical(const coordinateSystem& csys);
128 
129  //- Move construct from another coordinateSystem type
130  explicit cylindrical(coordinateSystem&& csys);
131 
132  //- Move construct from autoPtr of another coordinateSystem type
133  explicit cylindrical(autoPtr<coordinateSystem>&& csys);
134 
135  //- Copy construct from rotation with origin=0
136  explicit cylindrical(const coordinateRotation& crot);
137 
138  //- Construct from origin and rotation
139  cylindrical(const point& origin, const coordinateRotation& crot);
140 
141  //- Construct from origin and single axis
142  cylindrical(const point& origin, const vector& axis);
143 
144  //- Construct from origin and single axis
145  cylindrical(const word& name, const point& origin, const vector& axis);
146 
147  //- Construct from origin and two axes
149  (
150  const point& origin,
151  const vector& axis,
152  const vector& dirn
153  );
154 
155  //- Construct from origin and two axes
157  (
158  const word& name,
159  const point& origin,
160  const vector& axis,
161  const vector& dirn
162  );
163 
164  //- Construct from dictionary with a given name
165  cylindrical(const word& name, const dictionary& dict);
166 
167  //- Construct from dictionary without a name
168  explicit cylindrical(const dictionary& dict);
169 
170  //- Construct from dictionary with optional subDict lookup.
171  //
172  // \param dictName If non-empty, the sub-dictionary to use.
173  cylindrical(const dictionary& dict, const word& dictName);
174 
175  //- Return clone
176  virtual autoPtr<coordinateSystem> clone() const
177  {
179  }
180 
181 
182  //- Destructor
183  virtual ~cylindrical() = default;
184 
185 
186  // Member Functions
187 
188  //- Treat the rotation tensor as non-uniform
189  virtual bool uniform() const
190  {
191  return false;
192  }
193 
194 
195  // Rotations
196 
197  //- Position-dependent rotation tensors at multiple points
199 
200  //- Position-dependent rotation tensor at a single point
201  //- \return tensor
202  virtual tensor R(const point& global) const;
203 
204 
205  // Member Operators
206 
207  //- Copy assignment
208  cylindrical& operator=(const cylindrical&) = default;
209 
210  //- Move assignment
211  cylindrical& operator=(cylindrical&&) = default;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace coordSystem
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 //- Compatibility typedef 1806
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::coordinateSystem::name
virtual const word & name() const
Return the name.
Definition: coordinateSystem.H:457
Foam::coordSystem::cylindrical::TypeNameNoDebug
TypeNameNoDebug("cylindrical")
Runtime type information.
dictName
const word dictName("faMeshDefinition")
coordinateSystem.H
Foam::coordinateSystem::origin
virtual const point & origin() const
Return origin.
Definition: coordinateSystem.H:469
Foam::Field< vector >
Foam::coordSystem::cylindrical::cylindrical
cylindrical()
Default construct. This is an identity coordinate system.
Definition: cylindricalCS.C:87
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:78
Foam::coordSystem::cylindrical::localToGlobal
virtual vector localToGlobal(const vector &local, bool translate) const
Definition: cylindricalCS.C:261
Foam::cylindricalCS
coordSystem::cylindrical cylindricalCS
Compatibility typedef 1806.
Definition: cylindricalCS.H:231
Foam::coordSystem::cylindrical::globalToLocal
virtual vector globalToLocal(const vector &global, bool translate) const
Definition: cylindricalCS.C:300
Foam::coordSystem::cylindrical::~cylindrical
virtual ~cylindrical()=default
Destructor.
Foam::coordSystem::cylindrical
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
Definition: cylindricalCS.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::coordSystem::cylindrical::operator=
cylindrical & operator=(const cylindrical &)=default
Copy assignment.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
Foam::coordSystem::cylindrical::clone
virtual autoPtr< coordinateSystem > clone() const
Return clone.
Definition: cylindricalCS.H:185
Foam::coordSystem::cylindrical::uniform
virtual bool uniform() const
Treat the rotation tensor as non-uniform.
Definition: cylindricalCS.H:198
Foam::coordinateSystem
Base class for coordinate system specification, the default coordinate system type is cartesian .
Definition: coordinateSystem.H:132
Foam::coordinateSystem::R
virtual const tensor & R() const
Return const reference to the rotation tensor.
Definition: coordinateSystem.H:475