Chombo + EB + MF  3.2
CubedSphereSolidCS.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 _CUBEDSPHERESOLIDCS_H_
12 #define _CUBEDSPHERESOLIDCS_H_
13 
14 //#include <utility>
15 // using std::pair;
16 
17 #include "REAL.H"
18 #include "RealVect.H"
19 #include "MultiBlockCoordSys.H"
20 
21 #include "NamespaceHeader.H"
22 
23 /// Multiblock coordinate system for cubed sphere shell
24 /// with variable-thickness spherical layers
25 /**
26  The CubedSphereSolidCS coordinate system class is a multiblock example
27  that takes place on a 3D spherical region.
28  There are an inner cube and six sectors, each sector centered on
29  a coordinate axis.
30 
31  From: Diener, Dorband, Schnetter and Tiglio,
32  "Optimized High-Order Derivative and Dissipation Operators
33  Satisfying Summation by Parts, and Applications in Three-dimensional
34  Multi-block Evolutions", J. Sci. Comp. 32:1 (2007)
35  DOI: 10.1007/s10915-006-9123-7
36 */
38 {
39 public:
40 
41  /// default constructor
43 
44  /// constructor with resolution
45  CubedSphereSolidCS(int a_nResolution, Real a_r0 = 1., Real a_r1 = 3.);
46 
47  /**
48  Destructor.
49  */
50  virtual ~CubedSphereSolidCS();
51 
52  virtual void define(int a_nResolution, Real a_r0 = 1., Real a_r1 = 3.);
53 
54  virtual void define(const ProblemDomain& a_levelDomain,
55  const RealVect& a_dx);
56 
57  void setR0(Real a_r0);
58 
59  void setR1(Real a_r1);
60 
61  Real getR0() const { return m_r0; }
62 
63  Real getR1() const { return m_r1; }
64 
65  virtual void blockRemapping(RealVect& a_xi_valid,
66  int& a_n_valid,
67  const RealVect& a_xiSrc,
68  int a_nSrc) const;
69 
70 protected:
71 
72  const static int NUMBLOCKS = 7;
73 
74  const static int XPOS = 0;
75  const static int YPOS = 1;
76  const static int XNEG = 2;
77  const static int YNEG = 3;
78  const static int ZPOS = 4;
79  const static int ZNEG = 5;
80  const static int CENTRAL = 6;
81 
82  // Resolution per element
84 
85  // half-width of inner cube in physical space
87 
88  // radius of sphere in physical space
90 
91  // define m_boundaries, called by define()
92  void defineBoundaries();
93 };
94 
95 
97 {
98 public:
99 
101  {
102  m_r0 = 1.;
103  m_r1 = 3.;
104  }
105 
107  {
108  }
109 
110  virtual MultiBlockCoordSys* getCoordSys(const ProblemDomain& levelDomain,
111  const RealVect& a_dx) const;
112 
113  void setR0(Real a_r0)
114  {
115  m_r0 = a_r0;
116  }
117 
118  void setR1(Real a_r1)
119  {
120  m_r1 = a_r1;
121  }
122 
123 protected:
124 
126 
128 };
129 
130 #include "NamespaceFooter.H"
131 
132 #endif
Real m_r0
Definition: CubedSphereSolidCS.H:125
virtual ~CubedSphereSolidCS()
static const int NUMBLOCKS
Definition: CubedSphereSolidCS.H:72
void setR0(Real a_r0)
Definition: CubedSphereSolidCS.H:113
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int m_nResolution
Definition: CubedSphereSolidCS.H:83
static const int CENTRAL
Definition: CubedSphereSolidCS.H:80
void setR0(Real a_r0)
static const int XPOS
Definition: CubedSphereSolidCS.H:74
Real getR0() const
Definition: CubedSphereSolidCS.H:61
Real m_r0
Definition: CubedSphereSolidCS.H:86
virtual void blockRemapping(RealVect &a_xi_valid, int &a_n_valid, const RealVect &a_xiSrc, int a_nSrc) const
block mapping conversion function
static const int XNEG
Definition: CubedSphereSolidCS.H:76
static const int ZPOS
Definition: CubedSphereSolidCS.H:78
Real getR1() const
Definition: CubedSphereSolidCS.H:63
double Real
Definition: REAL.H:33
static const int YNEG
Definition: CubedSphereSolidCS.H:77
virtual const NewCoordSys * getCoordSys(int a_n) const
Return the mapping which corresponds to the block with the given index.
Definition: MultiBlockCoordSys.H:250
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
static const int ZNEG
Definition: CubedSphereSolidCS.H:79
void setR1(Real a_r1)
Definition: CubedSphereSolidCS.H:118
static const int YPOS
Definition: CubedSphereSolidCS.H:75
Real m_r1
Definition: CubedSphereSolidCS.H:89
CubedSphereSolidCSFactory()
Definition: CubedSphereSolidCS.H:100
virtual ~CubedSphereSolidCSFactory()
Definition: CubedSphereSolidCS.H:106
virtual void define(int a_nResolution, Real a_r0=1., Real a_r1=3.)
pure-virtual base class defining factory interface for MultiBlockCoordSys
Definition: MultiBlockCoordSys.H:409
Real m_r1
Definition: CubedSphereSolidCS.H:127
void setR1(Real a_r1)
Definition: CubedSphereSolidCS.H:96
CubedSphereSolidCS()
default constructor
Definition: CubedSphereSolidCS.H:37