Chombo + EB  3.0
SphereIF.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 _SPHEREIF_H_
12 #define _SPHEREIF_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 sphere.
24  */
25 class SphereIF: public BaseIF
26 {
27 public:
28  ///
29  /**
30  Constructor specifying sphere radius (a_radius), center (a_center), and
31  whether the domain is on the inside (a_inside).
32  */
33  SphereIF(const Real& a_radius,
34  const RealVect& a_center,
35  const bool& a_inside);
36 
37  /// Copy constructor
38  SphereIF(const SphereIF& a_inputIF);
39 
40  /// Destructor
41  virtual ~SphereIF();
42 
43  ///
44  /**
45  Return the parameter information
46  */
47  virtual void GetParams(Real& a_radius,
48  RealVect& a_center,
49  bool& a_inside) const;
50 
51  ///
52  /**
53  Set the parameter information
54  */
55  virtual void SetParams(const Real& a_radius,
56  const RealVect& a_center,
57  const bool& a_inside);
58 
59  ///
60  /**
61  Return the value of the function at a_point.
62  */
63  virtual Real value(const RealVect& a_point) const;
64 
65  virtual BaseIF* newImplicitFunction() const;
66 
67  virtual bool fastIntersection(const RealVect& a_low,
68  const RealVect& a_high) const
69  {return true;}
70 
71 
72  virtual GeometryService::InOut InsideOutside(const RealVect& a_low,
73  const RealVect& a_high) const ;
74 
75 protected:
76  Real m_radius; // radius
77  RealVect m_center; // center
78  bool m_inside; // inside flag
79 
80  Real m_radius2; // precomputed radius squared
81 
82 private:
84  {
85  MayDay::Abort("SphereIF uses strong construction");
86  }
87 
88  void operator=(const SphereIF& a_inputIF)
89  {
90  MayDay::Abort("SphereIF doesn't allow assignment");
91  }
92 };
93 
94 #include "NamespaceFooter.H"
95 #endif
virtual void GetParams(Real &a_radius, RealVect &a_center, bool &a_inside) const
Real m_radius2
Definition: SphereIF.H:80
Real m_radius
Definition: SphereIF.H:76
virtual GeometryService::InOut InsideOutside(const RealVect &a_low, const RealVect &a_high) const
virtual bool fastIntersection(const RealVect &a_low, const RealVect &a_high) const
Definition: SphereIF.H:67
virtual ~SphereIF()
Destructor.
InOut
Definition: GeometryService.H:41
RealVect m_center
Definition: SphereIF.H:77
Definition: BaseIF.H:30
SphereIF()
Definition: SphereIF.H:83
Definition: SphereIF.H:25
virtual BaseIF * newImplicitFunction() const
void operator=(const SphereIF &a_inputIF)
Definition: SphereIF.H:88
double Real
Definition: REAL.H:33
virtual Real value(const RealVect &a_point) const
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool m_inside
Definition: SphereIF.H:78
virtual void SetParams(const Real &a_radius, const RealVect &a_center, const bool &a_inside)
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).