Chombo + EB  3.2
HyperSphereIF.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 _HYPERSPHEREIF_H_
12 #define _HYPERSPHEREIF_H_
13 
14 #include "MayDay.H"
15 #include "IndexTM.H"
16 #include "Notation.H"
17 #include "BaseIF.H"
18 #include "NamespaceHeader.H"
19 
20 ///
21 /**
22  This implicit function specifies a sphere.
23  */
24 class HyperSphereIF: public BaseIF
25 {
26 public:
27  ///
28  /**
29  Constructor specifying sphere radius (a_radius), center (a_center), and
30  whether the domain is on the inside (a_inside).
31  */
32  HyperSphereIF(const Real & a_radius,
33  const IndexTM<Real,GLOBALDIM>& a_center,
34  const bool & a_inside);
35 
36  /// Copy constructor
37  HyperSphereIF(const HyperSphereIF& a_inputIF);
38 
39  /// Destructor
40  virtual ~HyperSphereIF();
41  ///
42  /**
43  Return the parameter information
44  */
45  virtual void GetParams(Real & a_radius,
46  IndexTM<Real,GLOBALDIM>& a_center,
47  bool & a_inside) const;
48 
49  ///
50  /**
51  Set the parameter information
52  */
53  virtual void SetParams(const Real & a_radius,
54  const IndexTM<Real,GLOBALDIM>& a_center,
55  const bool & a_inside);
56 
57  ///
58  /**
59  Return the value of the function at a_point.
60  */
61 
62  virtual Real value(const IndexTM<int,GLOBALDIM> & a_partialDerivative,
63  const IndexTM<Real,GLOBALDIM>& a_point) const;
64 
65  virtual Real value(const RealVect& a_point) const;
66 
67  virtual Real value(const IndexTM<Real,GLOBALDIM>& a_point) const;
68 
69  virtual IndexTM<Real,GLOBALDIM> normal(const IndexTM<Real,GLOBALDIM>& a_point) const ;
70 
72 
73  virtual BaseIF* newImplicitFunction() const;
74 
75 protected:
76  Real m_radius; // radius
78  bool m_inside; // inside flag
79  Real m_radius2; // precomputed radius squared
80 
81 private:
83  {
84  MayDay::Abort("HyperSphereIF uses strong construction");
85  }
86 
87  void operator=(const HyperSphereIF& a_inputIF)
88  {
89  MayDay::Abort("HyperSphereIF doesn't allow assignment");
90  }
91 };
92 
93 #include "NamespaceFooter.H"
94 #endif
virtual BaseIF * newImplicitFunction() const
bool m_inside
Definition: HyperSphereIF.H:78
Real m_radius2
Definition: HyperSphereIF.H:79
one dimensional dynamic array
Definition: Vector.H:53
IndexTM< Real, GLOBALDIM > m_center
Definition: HyperSphereIF.H:77
HyperSphereIF()
Definition: HyperSphereIF.H:82
void operator=(const HyperSphereIF &a_inputIF)
Definition: HyperSphereIF.H:87
Real m_radius
Definition: HyperSphereIF.H:76
virtual Real value(const IndexTM< int, GLOBALDIM > &a_partialDerivative, const IndexTM< Real, GLOBALDIM > &a_point) const
Definition: BaseIF.H:32
virtual ~HyperSphereIF()
Destructor.
virtual Vector< IndexTM< Real, GLOBALDIM > > gradNormal(const IndexTM< Real, GLOBALDIM > &a_point) const
double Real
Definition: REAL.H:33
virtual void SetParams(const Real &a_radius, const IndexTM< Real, GLOBALDIM > &a_center, const bool &a_inside)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void GetParams(Real &a_radius, IndexTM< Real, GLOBALDIM > &a_center, bool &a_inside) const
virtual IndexTM< Real, GLOBALDIM > normal(const IndexTM< Real, GLOBALDIM > &a_point) const
Definition: HyperSphereIF.H:24
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).