Chombo + EB  3.2
ComplementIF.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 _COMPLEMENTIF_H_
12 #define _COMPLEMENTIF_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 negative of the implicit function with which
25  it is constructed. This results in an implicit function whose interior is
26  the complement of the interior of the given implicit function (minus the
27  the surface).
28  */
29 class ComplementIF: public BaseIF
30 {
31 public:
32  ///
33  /**
34  Constructor specifying the implicit function and whether to complement
35  (default = true)
36  */
37  ComplementIF(const BaseIF& a_impFunc,
38  const bool& a_complement = true);
39 
40  /// Copy constructor with complement boolean (default = true)
41  ComplementIF(const ComplementIF& a_inputIF,
42  const bool& a_complement = true);
43 
44  /// Destructor
45  virtual ~ComplementIF();
46 
47  ///
48  /**
49  Return the parameter information
50  */
51  virtual void GetParams(bool& a_complement) const;
52 
53  ///
54  /**
55  Set the parameter information
56  */
57  virtual void SetParams(const bool& a_complement);
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  ///
66  /**
67  Return the value of the function at a_point (of type IndexTM).
68  */
69  virtual Real value(const IndexTM<Real,GLOBALDIM>& a_point) const;
70 
71  ///
72  /**
73  Return the derivative of the function at a_point (of type IndexTM).
74 
75  */
76  virtual Real value(const IndexTM<int,GLOBALDIM> & a_partialDerivative,
77  const IndexTM<Real,GLOBALDIM>& a_point) const;
78 
79  virtual BaseIF* newImplicitFunction() const;
80 
81  virtual bool fastIntersection(const RealVect& a_low, const RealVect& a_high) const
82  {
83  return m_impFunc->fastIntersection(a_low, a_high);
84  }
85 
86  virtual GeometryService::InOut InsideOutside(const RealVect& a_low, const RealVect& a_high) const;
87 
88  ///
89  /**
90  Pass this call onto the IFs contained in this IF class.
91  */
92  virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout,
93  const RealVect & a_dx)
94  {
95  m_impFunc->boxLayoutChanged(a_newBoxLayout,a_dx);
96  }
97 
98 protected:
99  bool m_complement; // complement the function (default = true)
100 
101  BaseIF* m_impFunc; // implicit function to complement
102 
103 private:
105  {
106  MayDay::Abort("ComplementIF uses strong construction");
107  }
108 
109  void operator=(const ComplementIF& a_inputIF)
110  {
111  MayDay::Abort("ComplementIF doesn't allow assignment");
112  }
113 };
114 
115 #include "NamespaceFooter.H"
116 #endif
virtual bool fastIntersection(const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx) const
Definition: BaseIF.H:148
virtual ~ComplementIF()
Destructor.
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: BaseIF.H:259
InOut
Definition: GeometryService.H:41
virtual void SetParams(const bool &a_complement)
BaseIF * m_impFunc
Definition: ComplementIF.H:101
Definition: BaseIF.H:32
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: ComplementIF.H:92
double Real
Definition: REAL.H:33
virtual BaseIF * newImplicitFunction() const
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
virtual GeometryService::InOut InsideOutside(const RealVect &a_low, const RealVect &a_high) const
Definition: ComplementIF.H:29
virtual bool fastIntersection(const RealVect &a_low, const RealVect &a_high) const
Definition: ComplementIF.H:81
virtual void GetParams(bool &a_complement) const
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool m_complement
Definition: ComplementIF.H:99
virtual Real value(const RealVect &a_point) const
void operator=(const ComplementIF &a_inputIF)
Definition: ComplementIF.H:109
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).
ComplementIF()
Definition: ComplementIF.H:104