Chombo + EB + MF  3.2
TorusIF.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 _TORUSIF_H_
12 #define _TORUSIF_H_
13 
14 #include "MayDay.H"
15 #include "RealVect.H"
16 
17 #include "BaseIF.H"
18 
19 #include "NamespaceHeader.H"
20 
21 ///
22 /**
23  This implicit function specifies a torus whose axis is parallel to the
24  z-axis
25  */
26 class TorusIF: public BaseIF
27 {
28 public:
29  ///
30  /**
31  Constructor specifying torus major radius (a_majorRadius), minor radius
32  (a_minorRadius), center (a_center), and whether the domain is on the
33  inside (a_inside).
34  */
35  TorusIF(const Real& a_majorRadius,
36  const Real& a_minorRadius,
37  const RealVect& a_center,
38  const bool& a_inside);
39 
40  /// Copy constructor
41  TorusIF(const TorusIF& a_inputIF);
42 
43  /// Destructor
44  virtual ~TorusIF();
45 
46  ///
47  /**
48  Return the parameter information
49  */
50  virtual void GetParams(Real& a_majorRadius,
51  Real& a_minorRadius,
52  RealVect& a_center,
53  bool& a_inside) const;
54 
55  ///
56  /**
57  Set the parameter information
58  */
59  virtual void SetParams(const Real& a_majorRadius,
60  const Real& a_minorRadius,
61  const RealVect& a_center,
62  const bool& a_inside);
63 
64  ///
65  /**
66  Return the value of the function at a_point.
67  */
68  virtual Real value(const RealVect& a_point) const;
69 
70  virtual BaseIF* newImplicitFunction() const;
71 
72 protected:
73  Real m_majorRadius; // major radius
74  Real m_minorRadius; // minor radius
75 
76  RealVect m_center; // center
77 
78  bool m_inside; // inside flag
79 
80  Real m_minorRadius2; // precomputed minor radius squared
81 
82 private:
84  {
85  MayDay::Abort("TorusIF uses strong construction");
86  }
87 
88  void operator=(const TorusIF& a_inputIF)
89  {
90  MayDay::Abort("TorusIF doesn't allow assignment");
91  }
92 };
93 
94 #include "NamespaceFooter.H"
95 #endif
TorusIF()
Definition: TorusIF.H:83
Real m_minorRadius
Definition: TorusIF.H:74
Real m_minorRadius2
Definition: TorusIF.H:80
virtual ~TorusIF()
Destructor.
Definition: TorusIF.H:26
RealVect m_center
Definition: TorusIF.H:76
Definition: BaseIF.H:32
bool m_inside
Definition: TorusIF.H:78
double Real
Definition: REAL.H:33
virtual void SetParams(const Real &a_majorRadius, const Real &a_minorRadius, const RealVect &a_center, const bool &a_inside)
virtual BaseIF * newImplicitFunction() const
virtual Real value(const RealVect &a_point) const
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real m_majorRadius
Definition: TorusIF.H:73
virtual void GetParams(Real &a_majorRadius, Real &a_minorRadius, RealVect &a_center, bool &a_inside) const
void operator=(const TorusIF &a_inputIF)
Definition: TorusIF.H:88
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).