Chombo + EB  3.2
HelixIF.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 _HELIXIF_H_
12 #define _HELIXIF_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 takes one implicit function and move it along a
25  helix in 3D. In 2D the implicit function is simply returned.
26 
27  In 3D, if a_vertical is false, the given function is restricted to the
28  x-y plane (z = 0), and this restricted function is rotated around the
29  z-axis at the specified rate as z changes.
30 
31  In 3D, if a_vertical is true, the given function is restricted to the
32  x-y plane (z = 0), but this x-y cross section is oriented vertically and
33  swept in a helix at the specified rate.
34 
35  In 2D, the given function is simply returned.
36  */
37 class HelixIF: public BaseIF
38 {
39 public:
40  ///
41  /**
42  Constructor specifying one implicit function to be rotated, the
43  rotation rate, and whether the domain is on the inside (a_inside),
44  i.e. where the function is negative.
45  */
46  HelixIF(const BaseIF& a_impFunc,
47  const Real& a_rate,
48  const bool& a_inside,
49  const bool& a_vertical = true);
50 
51  /// Copy constructor
52  HelixIF(const HelixIF& a_inputIF);
53 
54  /// Destructor
55  virtual ~HelixIF();
56 
57  ///
58  /**
59  Return the value of the function at a_point.
60  */
61  virtual Real value(const RealVect& a_point) const;
62 
63  virtual BaseIF* newImplicitFunction() const;
64 
65  ///
66  /**
67  Pass this call onto the IFs contained in this IF class.
68  */
69  virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout,
70  const RealVect & a_dx)
71  {
72  m_impFunc->boxLayoutChanged(a_newBoxLayout,a_dx);
73  }
74 
75 protected:
76  BaseIF* m_impFunc; // implicit function to rotate
77 
78  Real m_rate; // the rate of rotate as z changes
79 
80  bool m_inside; // inside flag
81 
82  bool m_vertical; // vertical cross section
83 
84  Real m_minz; // for vertical, the bounds on the cross section
86 
87 private:
89  {
90  MayDay::Abort("HelixIF uses strong construction");
91  }
92 
93  void operator=(const HelixIF& a_inputIF)
94  {
95  MayDay::Abort("HelixIF doesn't allow assignment");
96  }
97 };
98 
99 #include "NamespaceFooter.H"
100 #endif
bool m_vertical
Definition: HelixIF.H:82
void operator=(const HelixIF &a_inputIF)
Definition: HelixIF.H:93
virtual ~HelixIF()
Destructor.
Definition: HelixIF.H:37
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: BaseIF.H:259
Real m_maxz
Definition: HelixIF.H:85
bool m_inside
Definition: HelixIF.H:80
virtual Real value(const RealVect &a_point) const
Definition: BaseIF.H:32
double Real
Definition: REAL.H:33
virtual BaseIF * newImplicitFunction() const
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
HelixIF()
Definition: HelixIF.H:88
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Real m_rate
Definition: HelixIF.H:78
BaseIF * m_impFunc
Definition: HelixIF.H:76
Real m_minz
Definition: HelixIF.H:84
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: HelixIF.H:69
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).