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