Chombo + EB  3.2
SimpleEllipsoidIF.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 _SIMPLEELLIPSOIDIF_H_
12 #define _SIMPLEELLIPSOIDIF_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 SimpleEllipsoid.
24  pout() << "SimpleEllipsoid geometry" << endl;
25  pout() << "(x-xo/a)^2 + (y-y0/b)^2 + (z-z/c)^ - r^2 = f(x,y,z)" << endl;
26 
27 */
29 {
30 public:
31  ///
32  /**
33  "(x-xo/A)^2 + (y-y0/B)^2 + (z-z0/C)^ - r^2 = f(x,y,z)" << endl;
34  */
36  const RealVect& a_X0,
37  const Real & a_R,
38  const bool & a_inside)
39  {
40  m_ABE= a_ABE;
41  m_X0= a_X0;
42  m_R= a_R;
43  m_inside= a_inside;
44 
45  for(int idir = 0; idir < SpaceDim; idir++)
46  {
47  CH_assert(a_ABE[idir] > 1.e-10);
48  m_A2[idir] = a_ABE[idir]*a_ABE[idir];
49  }
50  }
51 
52  /// Destructor
54  {
55  }
56 
57  virtual Real value(const IndexTM<int,SpaceDim> & a_partialDerivative,
58  const IndexTM<Real,SpaceDim>& a_point) const;
59 
60  virtual Real value(const RealVect& a_point) const;
61 
62  virtual Real value(const IndexTM<Real,SpaceDim>& a_point) const;
63 
64  virtual BaseIF* newImplicitFunction() const
65  {
66  SimpleEllipsoidIF* SimpleEllipsoidPtr = new SimpleEllipsoidIF(m_ABE,m_X0, m_R, m_inside);
67  return static_cast<BaseIF*>(SimpleEllipsoidPtr);
68  }
69 
70 protected:
74  bool m_inside;
76 
77 private:
79 
80 };
81 
82 #include "NamespaceFooter.H"
83 #endif
RealVect m_A2
Definition: SimpleEllipsoidIF.H:75
#define CH_assert(cond)
Definition: CHArray.H:37
virtual Real value(const IndexTM< int, SpaceDim > &a_partialDerivative, const IndexTM< Real, SpaceDim > &a_point) const
virtual BaseIF * newImplicitFunction() const
Definition: SimpleEllipsoidIF.H:64
Real m_R
Definition: SimpleEllipsoidIF.H:73
const int SpaceDim
Definition: SPACE.H:38
Definition: BaseIF.H:32
double Real
Definition: REAL.H:33
RealVect m_X0
Definition: SimpleEllipsoidIF.H:72
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
RealVect m_ABE
Definition: SimpleEllipsoidIF.H:71
Definition: SimpleEllipsoidIF.H:28
SimpleEllipsoidIF(const RealVect &a_ABE, const RealVect &a_X0, const Real &a_R, const bool &a_inside)
Definition: SimpleEllipsoidIF.H:35
bool m_inside
Definition: SimpleEllipsoidIF.H:74
virtual ~SimpleEllipsoidIF()
Destructor.
Definition: SimpleEllipsoidIF.H:53