Chombo + EB  3.2
UnionIF.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 _UNIONIF_H_
12 #define _UNIONIF_H_
13 
14 #include "MayDay.H"
15 #include "RealVect.H"
16 #include "Vector.H"
17 
18 #include "BaseIF.H"
19 
20 #include "NamespaceHeader.H"
21 
22 ///
23 /**
24  This implicit function is the minimum of two (of more) implicit
25  functions with which it is constructed. This results in an implicit
26  function whose interior is the union of the interiors of the given
27  implicit functions.
28  */
29 class UnionIF: public BaseIF
30 {
31 public:
32  ///
33  /**
34  Constructor specifying two implicit functions as inputs.
35  */
36  UnionIF(const BaseIF& a_impFunc1,
37  const BaseIF& a_impFunc2);
38 
39  ///
40  /**
41  Constructor specifying any number of implicit functions as inputs.
42  */
43  UnionIF(const Vector<BaseIF*>& a_impFuncs);
44 
45  /// Copy constructor
46  UnionIF(const UnionIF& a_inputIF);
47 
48  /// Destructor
49  virtual ~UnionIF();
50 
51  ///
52  /**
53  Return the value of the function at a_point.
54  */
55  virtual Real value(const RealVect& a_point) const;
56 
57  virtual Real value(const IndexTM<Real,GLOBALDIM>& a_point) const;
58 
59  virtual Real value(const IndexTM<int,GLOBALDIM> & a_partialDerivative,
60  const IndexTM<Real,GLOBALDIM>& a_point) const;
61 
62  virtual BaseIF* newImplicitFunction() const;
63 
64  void findClosest(const IndexTM<Real,GLOBALDIM>& a_point,int& closestIF) const;
65 
66  virtual bool fastIntersection(const RealVect& a_low,
67  const RealVect& a_high) const;
68 
69  virtual GeometryService::InOut InsideOutside(const RealVect& a_low,
70  const RealVect& a_high) const ;
71 
72  ///
73  /**
74  Pass this call onto the IFs contained in this IF class.
75  */
76  virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout,
77  const RealVect & a_dx)
78  {
79  for (int i = 0; i < m_numFuncs; i++)
80  {
81  m_impFuncs[i]->boxLayoutChanged(a_newBoxLayout,a_dx);
82  }
83  }
84 
85 protected:
86  int m_numFuncs; // number of implicit functions
87  Vector<BaseIF*> m_impFuncs; // implicit functions
88 
89 private:
91  {
92  MayDay::Abort("UnionIF uses strong construction");
93  }
94 
95  void operator=(const UnionIF& a_inputIF)
96  {
97  MayDay::Abort("UnionIF doesn't allow assignment");
98  }
99 };
100 
101 #include "NamespaceFooter.H"
102 #endif
UnionIF()
Definition: UnionIF.H:90
Definition: UnionIF.H:29
virtual BaseIF * newImplicitFunction() const
virtual GeometryService::InOut InsideOutside(const RealVect &a_low, const RealVect &a_high) const
one dimensional dynamic array
Definition: Vector.H:53
void operator=(const UnionIF &a_inputIF)
Definition: UnionIF.H:95
InOut
Definition: GeometryService.H:41
Definition: BaseIF.H:32
double Real
Definition: REAL.H:33
virtual ~UnionIF()
Destructor.
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Vector< BaseIF * > m_impFuncs
Definition: UnionIF.H:87
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
void findClosest(const IndexTM< Real, GLOBALDIM > &a_point, int &closestIF) const
virtual Real value(const RealVect &a_point) const
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: UnionIF.H:76
int m_numFuncs
Definition: UnionIF.H:86
virtual bool fastIntersection(const RealVect &a_low, const RealVect &a_high) 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).