Chombo + EB  3.2
LatheIF.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 _LATHEIF_H_
12 #define _LATHEIF_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 or two implicit functions and uses them
25  to produce a generalized surface of revolution.
26 
27  In 3D, if one function is given, then it is restricted to x >= 0 in the
28  x-y plane (z = 0), revolved around the y axis, and the y axis is rotated
29  to the z axis. In 2D, the function is restricted to x >= 0 and the x axis
30  (y = 0) and revolved around the origin.
31 
32  In 3D, if two functions are given then the first is restricted to x >= 0
33  in the x-y plane (z = 0), revolved around the y axis, and the y axis is
34  rotated to the z axis. At each angle between 0 and 2*Pi, the second
35  function restricted to the x axis (y = z = 0) is used to get an angle to
36  rotate the first function in the x-y plane with respect to a given point
37  before it is rotated about the y axis. In 2D, the first function is used
38  as above and the second function is ignored.
39 
40  Note: the second function (if given) should have the same value at x = 0
41  and x = 2*Pi (y = z = 0) or a values that differs by some integer multiple
42  of 2*Pi.
43  */
44 class LatheIF: public BaseIF
45 {
46 public:
47  ///
48  /**
49  Constructor specifying one implicit function to be rotated and whether
50  the domain is on the inside (a_inside), i.e. where the function is
51  negative.
52  */
53  LatheIF(const BaseIF& a_impFunc1,
54  const bool& a_inside);
55 
56  ///
57  /**
58  Constructor specifying two implicit functions, one to be rotated
59  and the other to cause an additional rotation about a_point, and
60  whether the domain is on the inside (a_inside), i.e. where the
61  function is negative.
62  */
63  LatheIF(const BaseIF& a_impFunc1,
64  const BaseIF& a_impFunc2,
65  const RealVect& a_point,
66  const bool& a_inside);
67 
68  /// Copy constructor
69  LatheIF(const LatheIF& a_inputIF);
70 
71  /// Destructor
72  virtual ~LatheIF();
73 
74  ///
75  /**
76  Return the value of the function at a_point.
77  */
78  virtual Real value(const RealVect& a_point) const;
79 
80  virtual BaseIF* newImplicitFunction() const;
81 
82  virtual bool fastIntersection(const RealVect& a_low,
83  const RealVect& a_high)const
84  {
85  return false;
86 // #if CH_SPACEDIM == 3
87 // if (m_impFunc2 == NULL)
88 // {
89 // return true;
90 // }
91 // else
92 // {
93 // return false;
94 // }
95 // #elif CH_SPACEDIM == 2
96 // return false;
97 // #else
98 // MayDay::Abort("need higher dim in LatheIF\n");
99 // #endif
100  }
101 
102  virtual GeometryService::InOut InsideOutside(const RealVect& a_low,
103  const RealVect& a_high) const ;
104 
105  ///
106  /**
107  Pass this call onto the IFs contained in this IF class.
108  */
109  virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout,
110  const RealVect & a_dx)
111  {
112  m_impFunc1->boxLayoutChanged(a_newBoxLayout,a_dx);
113 
114  if (m_impFunc2 != NULL)
115  {
116  m_impFunc2->boxLayoutChanged(a_newBoxLayout,a_dx);
117  }
118  }
119 
120 protected:
121  BaseIF* m_impFunc1; // implicit function to rotate
122  BaseIF* m_impFunc2; // implicit function to use for rotation
123 
124  RealVect m_point; // point for center of second rotation
125 
126  bool m_inside; // inside flag
127 
128 private:
130  {
131  MayDay::Abort("LatheIF uses strong construction");
132  }
133 
134  void operator=(const LatheIF& a_inputIF)
135  {
136  MayDay::Abort("LatheIF doesn't allow assignment");
137  }
138 };
139 
140 #include "NamespaceFooter.H"
141 #endif
bool m_inside
Definition: LatheIF.H:126
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: BaseIF.H:259
Definition: LatheIF.H:44
InOut
Definition: GeometryService.H:41
void operator=(const LatheIF &a_inputIF)
Definition: LatheIF.H:134
virtual void boxLayoutChanged(const DisjointBoxLayout &a_newBoxLayout, const RealVect &a_dx)
Definition: LatheIF.H:109
Definition: BaseIF.H:32
LatheIF()
Definition: LatheIF.H:129
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
BaseIF * m_impFunc1
Definition: LatheIF.H:121
virtual GeometryService::InOut InsideOutside(const RealVect &a_low, const RealVect &a_high) const
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual bool fastIntersection(const RealVect &a_low, const RealVect &a_high) const
Definition: LatheIF.H:82
RealVect m_point
Definition: LatheIF.H:124
virtual BaseIF * newImplicitFunction() const
virtual Real value(const RealVect &a_point) const
BaseIF * m_impFunc2
Definition: LatheIF.H:122
virtual ~LatheIF()
Destructor.
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).