Chombo + EB  3.2
GaussianSphereIF.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
8  */
9 #endif
10
11 #ifndef _GAUSSIANSPHEREIF_H_
12 #define _GAUSSIANSPHEREIF_H_
13
14 #include "MayDay.H"
15 #include "RealVect.H"
16
17 #include "BaseIF.H"
18
20
21 ///
22 /**
23  This implicit function specifies a sphere with gaussian spacing - the
24  main use of this is for mollifying other implicit functions (see
25  "MollifyIF").
26  */
27 class GaussianSphereIF: public BaseIF
28 {
29 public:
30  ///
31  /**
32  Constructor specifying gaussian sigma (a_sigma), center (a_center),
33  and whether the domain is on the inside (a_inside).
34  */
35  GaussianSphereIF(const Real& a_sigma,
36  const RealVect& a_center,
37  const bool& a_inside);
38
39  /// Copy constructor
40  GaussianSphereIF(const GaussianSphereIF& a_inputIF);
41
42  /// Destructor
43  virtual ~GaussianSphereIF();
44
45  ///
46  /**
47  Return the parameter information
48  */
49  virtual void GetParams(Real& a_sigma,
50  RealVect& a_center,
51  bool& a_inside) const;
52
53  ///
54  /**
55  Set the parameter information
56  */
57  virtual void SetParams(const Real& a_sigma,
58  const RealVect& a_center,
59  const bool& a_inside);
60
61  ///
62  /**
63  Return the value of the function at a_point.
64  */
65  virtual Real value(const RealVect& a_point) const;
66
67  ///
68  virtual Real derivative(const IntVect& a_deriv,
69  const RealVect& a_point) const;
70
71  ///
72  virtual Real firstDeriv(const IntVect& a_deriv,
73  const RealVect& a_point) const;
74
75  ///
76  virtual Real secondDeriv(const IntVect& a_deriv,
77  const RealVect& a_point) const;
78
79  ///
80  virtual Real thirdDeriv(const IntVect& a_deriv,
81  const RealVect& a_point) const;
82
83  ///
84  virtual Real fourthDeriv(const IntVect& a_deriv,
85  const RealVect& a_point) const;
86
87  ///
88  virtual Real fifthDeriv(const IntVect& a_deriv,
89  const RealVect& a_point) const;
90  ///
91  virtual Real sixthDeriv(const IntVect& a_deriv,
92  const RealVect& a_point) const;
93
94  virtual BaseIF* newImplicitFunction() const;
95
96 protected:
97  Real m_sigma; // sigma
98  RealVect m_center; // center
99  bool m_inside; // inside flag
100
101  Real m_sigma2; // precomputed sigma squared
102  Real m_normal; // precomputed normalizing factor
103
104  //precomputed stuff for derivs
105  /// m_b = 1/(2*sigma*sigma)
106  /// m_C = m_normal
108 private:
110  {
111  MayDay::Abort("GaussianSphereIF uses strong construction");
112  }
113
114  void operator=(const GaussianSphereIF& a_inputIF)
115  {
116  MayDay::Abort("GaussianSphereIF doesn't allow assignment");
117  }
118 };
119
120 #include "NamespaceFooter.H"
121 #endif
bool m_inside
Definition: GaussianSphereIF.H:99
Real m_normal
Definition: GaussianSphereIF.H:102
Real m_sigma2
Definition: GaussianSphereIF.H:101
RealVect m_center
Definition: GaussianSphereIF.H:98
Real m_C
Definition: GaussianSphereIF.H:107
GaussianSphereIF()
Definition: GaussianSphereIF.H:109
virtual Real secondDeriv(const IntVect &a_deriv, const RealVect &a_point) const
virtual Real firstDeriv(const IntVect &a_deriv, const RealVect &a_point) const
virtual Real thirdDeriv(const IntVect &a_deriv, const RealVect &a_point) const
virtual void SetParams(const Real &a_sigma, const RealVect &a_center, const bool &a_inside)
Definition: BaseIF.H:32
virtual Real fourthDeriv(const IntVect &a_deriv, const RealVect &a_point) const
virtual Real derivative(const IntVect &a_deriv, const RealVect &a_point) const
return the partial derivative at the point
virtual BaseIF * newImplicitFunction() const
double Real
Definition: REAL.H:33
virtual void GetParams(Real &a_sigma, RealVect &a_center, bool &a_inside) const
virtual Real value(const RealVect &a_point) const
virtual ~GaussianSphereIF()
Destructor.
void operator=(const GaussianSphereIF &a_inputIF)
Definition: GaussianSphereIF.H:114
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real m_sigma
Definition: GaussianSphereIF.H:97
virtual Real fifthDeriv(const IntVect &a_deriv, const RealVect &a_point) const
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
virtual Real sixthDeriv(const IntVect &a_deriv, const RealVect &a_point) const
Definition: GaussianSphereIF.H:27
Real m_b
Definition: GaussianSphereIF.H:107
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).