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