cartesianCS.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::cartesian
26 
27 Description
28  Cylindrical coordinate system
29 
30 SourceFiles
31  cartesianCS.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cartesianCS_H
36 #define cartesianCS_H
37 
38 #include "coordinateSystem.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace coordinateSystems
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cartesian Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class cartesian
52 :
53  public coordinateSystem
54 {
55  // Private Member Functions
56 
57  //- Convert from local coordinate system to the global Cartesian system
58  // with optional translation for the origin
59  virtual vector localToGlobal(const vector&, bool translate) const;
60 
61  //- Convert from local coordinate system to the global Cartesian system
62  // with optional translation for the origin
63  virtual tmp<vectorField> localToGlobal
64  (
65  const vectorField&,
66  bool translate
67  ) const;
68 
69  //- Convert from global Cartesian system to the local coordinate system
70  // with optional translation for the origin
71  virtual vector globalToLocal(const vector&, bool translate) const;
72 
73  //- Convert from global Cartesian system to the local coordinate system
74  // with optional translation for the origin
75  virtual tmp<vectorField> globalToLocal
76  (
77  const vectorField&,
78  bool translate
79  ) const;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("cartesian");
86 
87 
88  // Constructors
89 
90  //- Construct from origin and rotation
91  cartesian
92  (
93  const word& name,
94  const point& origin,
95  const coordinateRotation&
96  );
97 
98  //- Construct from origin and 2 axes
99  cartesian
100  (
101  const word& name,
102  const point& origin,
103  const vector& axis,
104  const vector& dirn
105  );
106 
107  //- Construct from dictionary
108  cartesian(const word&, const dictionary&);
109 
110  //- Construct and return a clone
111  virtual autoPtr<coordinateSystem> clone() const
112  {
113  return autoPtr<coordinateSystem>(new cartesian(*this));
114  }
115 
116 
117  //- Destructor
118  virtual ~cartesian();
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 } // End namespace coordinateSystems
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
Base class for other coordinate system specifications.
Abstract base class for coordinate rotation.
cartesian(const word &name, const point &origin, const coordinateRotation &)
Construct from origin and rotation.
Definition: cartesianCS.C:86
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName("cartesian")
Runtime type information.
const word & name() const
Return name.
Cylindrical coordinate system.
Definition: cartesianCS.H:50
const point & origin() const
Return origin.
virtual autoPtr< coordinateSystem > clone() const
Construct and return a clone.
Definition: cartesianCS.H:110
A class for handling words, derived from string.
Definition: word.H:59
virtual ~cartesian()
Destructor.
Definition: cartesianCS.C:120
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.