Chombo + EB + MF  3.2
CubedSphereSolidBlockCS.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 _CUBEDSPHERESOLIDBLOCKCS_H_
12 #define _CUBEDSPHERESOLIDBLOCKCS_H_
13 
14 // #include <utility>
15 // using std::pair;
16 
17 #include "REAL.H"
18 #include "RealVect.H"
19 #include "NewFourthOrderCoordSys.H"
20 
21 #include "NamespaceHeader.H"
22 
23 /// Basic single-panel cubed sphere Coordinates
24 /// Multiblock coordinate system for single block of solid cubed sphere.
25 /**
26  The CubedSphereSolidBlockCS class implements the NewFourthOrderCoordSys class
27  for solid cubed sphere block.
28 */
30 {
31 public:
32 
33  /// constructor
34  CubedSphereSolidBlockCS(int a_blockID,
35  const RealVect& a_dxVect,
36  const Box& a_bx);
37 
38  void setR0(Real a_r0)
39  {
40  CH_assert(a_r0 > 0.);
41  m_r0 = a_r0;
42  }
43 
44  Real getR0() const
45  {
46  CH_assert(m_r0 > 0.);
47  return m_r0;
48  }
49 
50  void setR1(Real a_r1)
51  {
52  CH_assert(a_r1 > 0.);
53  m_r1 = a_r1;
54  }
55 
56  Real getR1() const
57  {
58  CH_assert(m_r1 > 0.);
59  return m_r1;
60  }
61 
62  /**
63  Destructor.
64  */
65  virtual ~CubedSphereSolidBlockCS();
66 
67  /// given coordinate in mapped space, return its location in real space
68  RealVect realCoord(const RealVect& a_Xi) const;
69 
70  // void realCoord(FArrayBox& a_x,
71  // const FArrayBox& a_Xi,
72  // const Box& a_box) const;
73 
74  /// given coordinate in real space, return its location in the mapped space
75  RealVect mappedCoord(const RealVect& a_x) const;
76 
77  // Calculate the derivative of each coordinate vector
78  virtual Real dXdXi(const RealVect& a_Xi,
79  int a_dirX,
80  int a_dirXi) const;
81 
82  /// access function to block id
83  int blockID() const
84  {
85  return m_blockID;
86  }
87 
88 protected:
89 
90  const static int XPOS = 0;
91  const static int YPOS = 1;
92  const static int XNEG = 2;
93  const static int YNEG = 3;
94  const static int ZPOS = 4;
95  const static int ZNEG = 5;
96  const static int CENTRAL = 6;
97 
98  // block id (this object has different behavior depending on the panel)
99  int m_blockID;
100 
101  // half-width of inner cube in physical space
103 
104  // radius of sphere in physical space
106 
107  // coordinates of low corner in mapped space
109 
110  // index (0 or 1 or 2) of real variable in radial direction
111  int m_rCoord;
112 
113  // index (0 or 1 or 2) of real variable multiplied by a
114  int m_aCoord;
115 
116  // index (0 or 1 or 2) of real variable multiplied by b
117  int m_bCoord;
118 
119  // signs of real variables
121 };
122 
123 #include "NamespaceFooter.H"
124 
125 #endif
RealVect m_signCoord
Definition: CubedSphereSolidBlockCS.H:120
Real getR0() const
Definition: CubedSphereSolidBlockCS.H:44
#define CH_assert(cond)
Definition: CHArray.H:37
static const int YNEG
Definition: CubedSphereSolidBlockCS.H:93
Definition: CubedSphereSolidBlockCS.H:29
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewFourthOrderCoordSys.H:77
int m_rCoord
Definition: CubedSphereSolidBlockCS.H:111
RealVect realCoord(const RealVect &a_Xi) const
given coordinate in mapped space, return its location in real space
int m_aCoord
Definition: CubedSphereSolidBlockCS.H:114
static const int ZPOS
Definition: CubedSphereSolidBlockCS.H:94
static const int YPOS
Definition: CubedSphereSolidBlockCS.H:91
static const int CENTRAL
Definition: CubedSphereSolidBlockCS.H:96
void setR0(Real a_r0)
Definition: CubedSphereSolidBlockCS.H:38
int m_blockID
Definition: CubedSphereSolidBlockCS.H:99
int m_bCoord
Definition: CubedSphereSolidBlockCS.H:117
Real m_r0
Definition: CubedSphereSolidBlockCS.H:102
double Real
Definition: REAL.H:33
Real getR1() const
Definition: CubedSphereSolidBlockCS.H:56
virtual ~CubedSphereSolidBlockCS()
CubedSphereSolidBlockCS(int a_blockID, const RealVect &a_dxVect, const Box &a_bx)
constructor
void setR1(Real a_r1)
Definition: CubedSphereSolidBlockCS.H:50
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real m_r1
Definition: CubedSphereSolidBlockCS.H:105
static const int ZNEG
Definition: CubedSphereSolidBlockCS.H:95
RealVect mappedCoord(const RealVect &a_x) const
given coordinate in real space, return its location in the mapped space
int blockID() const
access function to block id
Definition: CubedSphereSolidBlockCS.H:83
static const int XPOS
Definition: CubedSphereSolidBlockCS.H:90
RealVect m_mappedLo
Definition: CubedSphereSolidBlockCS.H:108
virtual Real dXdXi(const RealVect &a_Xi, int a_dirX, int a_dirXi) const
note that a_Xi is in mapped space.
static const int XNEG
Definition: CubedSphereSolidBlockCS.H:92