Chombo + EB + MF  3.2
CartesianCoordSys.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _CARTESIANCOORDSYS_H_
12 #define _CARTESIANCOORDSYS_H_
13 
14 #include <utility>
15 using std::pair;
16 
17 #include "REAL.H"
18 #include "DisjointBoxLayout.H"
19 #include "RealVect.H"
20 #include "IntVect.H"
21 #include "LevelData.H"
22 #include "FArrayBox.H"
23 #include "FluxBox.H"
24 #include "Vector.H"
25 #include "FourthOrderCoordSys.H"
26 
27 #include "NamespaceHeader.H"
28 
29 /// Basic Cartesian Coordinates
30 /**
31  The CartesianCoordSys class implements the FourthOrderCoordSys class
32  for simple Cartesian coordinates
33 */
35 {
36 public:
37  /// default constructor
39  {
40  m_isDefined = false;
41  }
42 
43  /**
44  Destructor.
45  */
46  virtual ~CartesianCoordSys();
47 
48  void define(const DisjointBoxLayout& a_grids,
49  const ProblemDomain& a_domain,
50  const RealVect& a_cellSpacing,
51  const IntVect& a_ghostVect);
52 
53  void stretch(const RealVect& a_stretch)
54  {
55  m_stretch = a_stretch;
56  }
57 
58  void regrid(const DisjointBoxLayout& a_newGrids);
59 
60  RealVect realCoord(const RealVect& a_X) const;
61 
62  RealVect mappedCoord(const RealVect& a_x) const;
63 
64  Real pointwiseJ(const RealVect& a_X) const;
65 
66  RealVect stretch() const
67  {
68  return m_stretch;
69  }
70 
72  const LevelData<FluxBox>& a_F) const;
73 
74  virtual Real dXdXi(const RealVect& a_X, int a_dirX, int a_dirXi) const;
75 
76 protected:
77 
79 
80  // allows for stretched cartesian grids
82 
84 
85 
86 };
87 
88 /// factory for CartesianCoordSys
89 /**
90  */
91 class
93 {
94 
95 public:
96  /// constructor
97  /** baseDomain is problemDomain at coarsest level (level 0)
98  vectRefRefine are refinement ratios
99  baseDx is cell spacing at level 0
100  maxLevel is defined by vectRefRefine.size() + 1
101  */
102  CartesianCoordSysFactory(const ProblemDomain& a_baseDomain,
103  const Vector<int>& a_vectRefRatios,
104  const RealVect& a_baseDx,
105  const RealVect& a_stretch = RealVect::Unit);
106 
107 
108 
109 
110 
111  virtual CoordSys<FArrayBox, FluxBox>* getCoordSys(const DisjointBoxLayout& grids,
112  const ProblemDomain& levelDomain,
113  const IntVect& a_ghostVect) const;
114 
115 
116 protected:
117 
118  ///
120 
121  ///
123 
124  ///
126 
127  ///
129 };
130 
131 
132 #include "NamespaceFooter.H"
133 
134 
135 #endif
Vector< RealVect > m_dxVect
Definition: CartesianCoordSys.H:125
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
one dimensional dynamic array
Definition: Vector.H:53
CartesianCoordSys()
default constructor
Definition: CartesianCoordSys.H:38
Vector< int > m_vectRefRatios
Definition: CartesianCoordSys.H:122
Vector< LevelData< FluxBox > * > m_dNdXi
Definition: CartesianCoordSys.H:78
Vector< ProblemDomain > m_vectDomains
Definition: CartesianCoordSys.H:119
Virtual base class encapsulating fourth-order CoordSys.
Definition: FourthOrderCoordSys.H:36
static const RealVect Unit
Definition: RealVect.H:427
Real pointwiseJ(const RealVect &a_X) const
Jacobian evaluated at location X in real space.
RealVect mappedCoord(const RealVect &a_x) const
given coordinate in real space, return its location in the mapped space
RealVect m_stretch
Definition: CartesianCoordSys.H:81
RealVect stretch() const
Definition: CartesianCoordSys.H:66
void mappedGridDivergence(LevelData< FArrayBox > &a_divF, const LevelData< FluxBox > &a_F) const
void stretch(const RealVect &a_stretch)
Definition: CartesianCoordSys.H:53
void define(const DisjointBoxLayout &a_grids, const ProblemDomain &a_domain, const RealVect &a_cellSpacing, const IntVect &a_ghostVect)
this define should probably be called from the derived-class define
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
RealVect realCoord(const RealVect &a_X) const
given coordinate in mapped space, return its location in real space
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual ~CartesianCoordSys()
void regrid(const DisjointBoxLayout &a_newGrids)
bool m_isDefined
Definition: CartesianCoordSys.H:83
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
RealVect m_stretch
Definition: CartesianCoordSys.H:128
factory for CartesianCoordSys
Definition: CartesianCoordSys.H:91
Basic Cartesian Coordinates.
Definition: CartesianCoordSys.H:34
virtual Real dXdXi(const RealVect &a_X, int a_dirX, int a_dirXi) const
note that a_X is in real (not mapped) space.