Chombo + EB  3.0
GaussianSphereIF.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 _GAUSSIANSPHEREIF_H_
12 #define _GAUSSIANSPHEREIF_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 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  /**
69  Return the value of the function at a_point (of type INdexTM).
70  */
71  virtual Real value(const IndexTM<Real,GLOBALDIM>& a_point) const;
72 
73  virtual BaseIF* newImplicitFunction() const;
74 
75 protected:
76  Real m_sigma; // sigma
77  RealVect m_center; // center
78  bool m_inside; // inside flag
79 
80  Real m_sigma2; // precomputed sigma squared
81  Real m_normal; // precomputed normalizing factor
82 
83 private:
85  {
86  MayDay::Abort("GaussianSphereIF uses strong construction");
87  }
88 
89  void operator=(const GaussianSphereIF& a_inputIF)
90  {
91  MayDay::Abort("GaussianSphereIF doesn't allow assignment");
92  }
93 };
94 
95 #include "NamespaceFooter.H"
96 #endif
bool m_inside
Definition: GaussianSphereIF.H:78
Real m_normal
Definition: GaussianSphereIF.H:81
Real m_sigma2
Definition: GaussianSphereIF.H:80
RealVect m_center
Definition: GaussianSphereIF.H:77
GaussianSphereIF()
Definition: GaussianSphereIF.H:84
virtual void SetParams(const Real &a_sigma, const RealVect &a_center, const bool &a_inside)
Definition: BaseIF.H:30
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:89
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real m_sigma
Definition: GaussianSphereIF.H:76
Definition: GaussianSphereIF.H:27
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).