Chombo + EB + MF  3.2
XPointBlockCoordSys.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 _XPOINTBLOCKCOORDSYS_H_
12 #define _XPOINTBLOCKCOORDSYS_H_
13 
14 #undef PLOT_INVERSE_POINTS
15 
16 #include "NewFourthOrderCoordSys.H"
17 
18 #include "NamespaceHeader.H"
19 
21 {
22 public:
23 
24  /// Constructor
25  /**
26  * Constructor with initialization. Input data is read from
27  * the parm_parse object, the cellSpacing is computed and
28  * the define() member is called.
29  *
30  * @param[in] parm_parse the ParmParse database.
31  * @param[in] domain the configuration space domain.
32  * @param[in] ghostVect vector of ghost cells stored for mapping.
33  */
34  XPointBlockCoordSys( const RealVect& a_origin,
35  const ProblemDomain& a_domain,
36  const int a_block_type);
37 
38  /// Destructor
39  /**
40  */
41  virtual ~XPointBlockCoordSys();
42 
43  /// Returns real coordinate.
44  /**
45  * Returns location \f$x\f$ in real-world coordinates of
46  * mapped-coordinate location \f$\xi\f$.
47  *
48  * @param[in] xi mapped grid coordinate.
49  */
50  virtual RealVect realCoord( const RealVect& xi ) const;
51 
52  /// Returns computational coordinate.
53  /**
54  * Returns location \f$\xi\f$ in mapped coordinate space of real-world
55  * location \f$x\f$.
56  *
57  * @param[in] x physical space coordinate.
58  */
59  virtual RealVect mappedCoord( const RealVect& x ) const;
60 
61  /// Returns the derivatives of the physical coordinates with respect to
62  /// the computational coordinate.
63  /**
64  * Returns the derivatives of the physical coordinates with respect to
65  * the computational coordinates at location \f$xi\f$.
66  *
67  * @param[in] xi mapped coordinate.
68  */
69  virtual Real dXdXi(const RealVect& Xi, int dirX, int dirXi) const;
70 
71  /// Fills the destComp component of a_dxdXi with the derivative of
72  /// x w/ respect to Xi in the dirX direction
73  /**
74  * Fills the destComp component of a_dxdXi with the derivative of
75  * x w/ respect to Xi in the dirX direction
76  *
77  * @param[in] Xi mapped coordinates
78  * @param[in] destComp destination component
79  * @param[in] dirX physical coordinate to be differentiated
80  * @param[in] dirXi computational coordinate
81  * @param[in] box box within which derivatives are computed
82  * @param[out] dxdXi output derivatives
83  */
84  void dXdXi(FArrayBox& dxdXi,
85  const FArrayBox& Xi,
86  int destComp,
87  int dirX,
88  int dirXi,
89  const Box& box) const;
90 
91  virtual Real dX2dXi2( const RealVect& Xi, int dirX, int dirXi0, int dirXi1 ) const;
92 
93  virtual void getRBpoloidal( const int dir, FArrayBox& RBpol, FArrayBox& dRBpoldt ) const;
94 
95  virtual double getRBtoroidal() const {return 1.;}
96 
97  int blockType() const {return m_block_type;}
98 
100 
101  Real centralMajorRadius( ) const { return m_origin[0]; }
102 
103  virtual void computeFieldData( const int dir,
104  FArrayBox& BField,
105  FArrayBox& BFieldMag,
106  FArrayBox& BFieldDirl,
107  FArrayBox& gradBFieldMag,
108  FArrayBox& curlBFieldDir,
109  FArrayBox& BFieldDirdotcurlBFieldDir ) const {;}
110 
111  // from MagBlockCoordSys
112  Real lowerMappedCoordinate(int dir) const {
113  return m_dx[dir] * m_domain.domainBox().smallEnd(dir);
114  };
115 
116  Real upperMappedCoordinate(int dir) const {
117  return m_dx[dir] * (m_domain.domainBox().bigEnd(dir)+1);
118  };
119 
120 protected:
121 
125 
128 
130 #ifdef PLOT_INVERSE_POINTS
131  FILE *m_ipt_file[8];
132 #endif
133 };
134 
135 #include "NamespaceFooter.H"
136 
137 #endif
XPointBlockCoordSys(const RealVect &a_origin, const ProblemDomain &a_domain, const int a_block_type)
Constructor.
Definition: XPointBlockCoordSys.H:20
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
RealVect m_mapped_face_area
Definition: XPointBlockCoordSys.H:124
virtual double getRBtoroidal() const
Definition: XPointBlockCoordSys.H:95
Real m_mapped_cell_volume
Definition: XPointBlockCoordSys.H:123
int blockType() const
Definition: XPointBlockCoordSys.H:97
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewFourthOrderCoordSys.H:77
virtual RealVect realCoord(const RealVect &xi) const
Returns real coordinate.
virtual Real dX2dXi2(const RealVect &Xi, int dirX, int dirXi0, int dirXi1) const
Real m_alpha
Definition: XPointBlockCoordSys.H:129
Definition: EBInterface.H:45
virtual RealVect mappedCoord(const RealVect &x) const
Returns computational coordinate.
const IntVect & bigEnd() const
Definition: Box.H:1784
Real centralMajorRadius() const
Definition: XPointBlockCoordSys.H:101
const IntVect & smallEnd() const
{ Accessors}
Definition: Box.H:1770
double Real
Definition: REAL.H:33
virtual ~XPointBlockCoordSys()
Destructor.
virtual void computeFieldData(const int dir, FArrayBox &BField, FArrayBox &BFieldMag, FArrayBox &BFieldDirl, FArrayBox &gradBFieldMag, FArrayBox &curlBFieldDir, FArrayBox &BFieldDirdotcurlBFieldDir) const
Definition: XPointBlockCoordSys.H:103
IntVect domainSmallEnd() const
Definition: XPointBlockCoordSys.H:99
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real lowerMappedCoordinate(int dir) const
Definition: XPointBlockCoordSys.H:112
RealVect m_dx
Definition: NewFourthOrderCoordSys.H:360
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
const Box & domainBox() const
Returns the logical computational domain.
Definition: ProblemDomain.H:887
ProblemDomain m_domain
Definition: XPointBlockCoordSys.H:118
virtual void getRBpoloidal(const int dir, FArrayBox &RBpol, FArrayBox &dRBpoldt) const
Real upperMappedCoordinate(int dir) const
Definition: XPointBlockCoordSys.H:116
virtual Real dXdXi(const RealVect &Xi, int dirX, int dirXi) const
int m_block_type
Definition: XPointBlockCoordSys.H:126
RealVect m_origin
Definition: XPointBlockCoordSys.H:127