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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::coordSystem::cylindrical
29
30Description
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
40SourceFiles
41 cylindricalCS.C
42 cylindricalCSTransform.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef Foam_cylindricalCS_H
47#define Foam_cylindricalCS_H
48
49#include "coordinateSystem.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55namespace coordSystem
56{
57
58/*---------------------------------------------------------------------------*\
59 Class coordSystem::cylindrical Declaration
60\*---------------------------------------------------------------------------*/
61
62class cylindrical
63:
64 public coordinateSystem
65{
66protected:
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
103public:
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
131
132 //- Move construct from autoPtr of another coordinateSystem type
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
186 // Member Functions
187
188 //- Treat the rotation tensor as non-uniform
189 virtual bool uniform() const
190 {
191 return false;
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221//- Compatibility typedef 1806
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226} // End namespace Foam
227
228// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229
230#endif
232// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
Definition: cylindricalCS.H:74
virtual bool uniform() const
Treat the rotation tensor as non-uniform.
virtual ~cylindrical()=default
Destructor.
cylindrical & operator=(const cylindrical &)=default
Copy assignment.
cylindrical & operator=(cylindrical &&)=default
Move assignment.
virtual vector globalToLocal(const vector &global, bool translate) const
virtual vector localToGlobal(const vector &local, bool translate) const
static const cylindrical null
Global (identity) cylindrical coordinate system.
cylindrical()
Default construct. This is an identity coordinate system.
Definition: cylindricalCS.C:87
TypeNameNoDebug("cylindrical")
Runtime type information.
cylindrical(const cylindrical &csys)=default
Copy construct.
cylindrical(cylindrical &&csys)=default
Move construct.
virtual const tensor & R() const
Position-dependent rotation tensors at multiple points.
virtual autoPtr< coordinateSystem > clone() const
Return clone.
User specification of a coordinate rotation.
Base class for coordinate system specification, the default coordinate system type is cartesian .
virtual const word & name() const
Return the name.
virtual const point & origin() const
Return origin.
virtual const tensor & R() const
Return const reference to the rotation tensor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
const word dictName("faMeshDefinition")
Namespace for OpenFOAM.
coordSystem::cylindrical cylindricalCS
Compatibility typedef 1806.
dictionary dict
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68