Chombo + EB  3.2
TiltedCylinderIF.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 _TILTEDCYLINDERIF_H_
12 #define _TILTEDCYLINDERIF_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 tilted (infinite) cylinder
24  */
25 class TiltedCylinderIF: public BaseIF
26 {
27 public:
28  ///
29  /**
30  Constructor specifying cylinder radius (a_radius), direction of the
31  axis (a_direction), a point on the axis (a_point), and whether the
32  domain is on the inside (a_inside).
33  */
34  TiltedCylinderIF(const Real& a_radius,
35  const RealVect& a_direction,
36  const RealVect& a_point,
37  const bool& a_inside);
38 
39  /// Copy constructor
40  TiltedCylinderIF(const TiltedCylinderIF& a_inputIF);
41 
42  /// Destructor
43  virtual ~TiltedCylinderIF();
44 
45  ///
46  /**
47  Return the parameter information
48  */
49  virtual void GetParams(Real& a_radius,
50  RealVect& a_direction,
51  RealVect& a_point,
52  bool& a_inside) const;
53 
54  ///
55  /**
56  Set the parameter information
57  */
58  virtual void SetParams(const Real& a_radius,
59  const RealVect& a_direction,
60  const RealVect& a_point,
61  const bool& a_inside);
62 
63  ///
64  /**
65  Return the value of the function at a_point.
66  */
67  virtual Real value(const RealVect& a_point) const;
68 
69  virtual BaseIF* newImplicitFunction() const;
70 
71  virtual bool fastIntersection(const RealVect& a_low, const RealVect& a_high) const
72  {return !m_tiltedAxis;}
73 
74 
75  virtual GeometryService::InOut InsideOutside(const RealVect& a_low, const RealVect& a_high) const ;
76 
77 protected:
78  Real m_radius; // radius
79  RealVect m_direction; // axis direction
80  bool m_tiltedAxis; // false if straight cylinder
81  int m_coordDir; // coordinate direction of axis for a straight cylinder
82  RealVect m_point; // point on the axis
83  bool m_inside; // inside flag
84 
85  Real m_radius2; // precomputed radius squared
86  Real m_length2; // precomputed length squared of direction vector
87 
88 private:
90  {
91  MayDay::Abort("TiltedCylinderIF uses strong construction");
92  }
93 
94  void operator=(const TiltedCylinderIF& a_inputIF)
95  {
96  MayDay::Abort("TiltedCylinderIF doesn't allow assignment");
97  }
98 };
99 
100 #include "NamespaceFooter.H"
101 #endif
virtual void SetParams(const Real &a_radius, const RealVect &a_direction, const RealVect &a_point, const bool &a_inside)
virtual void GetParams(Real &a_radius, RealVect &a_direction, RealVect &a_point, bool &a_inside) const
Real m_length2
Definition: TiltedCylinderIF.H:86
RealVect m_point
Definition: TiltedCylinderIF.H:82
InOut
Definition: GeometryService.H:41
bool m_tiltedAxis
Definition: TiltedCylinderIF.H:80
virtual Real value(const RealVect &a_point) const
virtual BaseIF * newImplicitFunction() const
virtual ~TiltedCylinderIF()
Destructor.
Definition: BaseIF.H:32
Definition: TiltedCylinderIF.H:25
void operator=(const TiltedCylinderIF &a_inputIF)
Definition: TiltedCylinderIF.H:94
double Real
Definition: REAL.H:33
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
RealVect m_direction
Definition: TiltedCylinderIF.H:79
virtual GeometryService::InOut InsideOutside(const RealVect &a_low, const RealVect &a_high) const
int m_coordDir
Definition: TiltedCylinderIF.H:81
virtual bool fastIntersection(const RealVect &a_low, const RealVect &a_high) const
Definition: TiltedCylinderIF.H:71
bool m_inside
Definition: TiltedCylinderIF.H:83
Real m_radius2
Definition: TiltedCylinderIF.H:85
TiltedCylinderIF()
Definition: TiltedCylinderIF.H:89
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).
Real m_radius
Definition: TiltedCylinderIF.H:78