Chombo + EB  3.2
CoordinateSystem.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
8  */
9 #endif
10
11 #ifndef _COORDINATESYSTEM_H_
12 #define _COORDINATESYSTEM_H_
13
14 #if defined(CH_Darwin) && defined(__GNUC__) && ( __GNUC__ == 3 )
15 // deal with the broken isnan()/isinf() in GCC on MacOS
16 #include <unistd.h>
17 #define _GLIBCPP_USE_C99 1
18 #endif
19
20
21 #include <map>
22 using std::map;
23 #include "Vector.H"
24 #include "REAL.H"
25 #include "IndexTM.H"
26
27 #include "Notation.H"
28 #include "IFSlicer.H"
29
30 using std::endl;
31 using std::cerr;
33
34 template <int dim> class CoordinateSystem
35 {
36 public:
37  // data types for vector of int and Real in dimension "dim"
40
41  // member data
44
45  // empty constructor
47
48  // copy constructor
50
51  // makes an CoordinateSystem from a origin and dx
52  CoordinateSystem(const RvDim & a_origin,
53  const RvDim & a_dx);
54
55  // makes a reduced CoordinateSystem
56  CoordinateSystem(const CoordinateSystem<dim+1> & a_hISystem,
57  const int & a_idir);
58
59  // destructor
61
62  // convert "a_point" in coordinate system "a_system" to a point in the
63  // current coordinate system.
64  RvDim convert(const RvDim & a_point,
65  const CoordinateSystem<dim> & a_system) const;
66
67  // convert "a_coord" in direction "a_dir" in coordinate system "a_system"
68  // to a value in "a_dir" in the current coordinate system.
69  Real convertDir(const Real & a_coord,
70  const CoordinateSystem<dim> & a_system,
71  const int & a_dir) const;
72
73  // output functions
74  void print(ostream& out) const;
75
76  // operators
77  void operator=(const CoordinateSystem<dim> & a_coordinateSystem);
78 };
79
80 #include "NamespaceFooter.H"
81
82 #include "CoordinateSystemImplem.H"
83
84 #endif
IndexTM< Real, dim > RvDim
Definition: CoordinateSystem.H:39
RvDim convert(const RvDim &a_point, const CoordinateSystem< dim > &a_system) const
Definition: CoordinateSystemImplem.H:67
Definition: CoordinateSystem.H:34
RvDim m_dx
Definition: CoordinateSystem.H:43
void print(ostream &out) const
Definition: CoordinateSystemImplem.H:107
Definition: IndexTM.H:36
IndexTM< int, dim > IvDim
Definition: CoordinateSystem.H:38
RvDim m_origin
Definition: CoordinateSystem.H:42
~CoordinateSystem()
Definition: CoordinateSystemImplem.H:63
double Real
Definition: REAL.H:33
CoordinateSystem()
Definition: CoordinateSystemImplem.H:25
Real convertDir(const Real &a_coord, const CoordinateSystem< dim > &a_system, const int &a_dir) const
Definition: CoordinateSystemImplem.H:91
void operator=(const CoordinateSystem< dim > &a_coordinateSystem)
Definition: CoordinateSystemImplem.H:138