00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _HELICOILIF_H_ 00012 #define _HELICOILIF_H_ 00013 00014 #include "MayDay.H" 00015 #include "RealVect.H" 00016 #include "Vector.H" 00017 00018 #include "BaseIF.H" 00019 #include "HelixIF.H" 00020 00021 #include "NamespaceHeader.H" 00022 00023 /// 00024 /** 00025 In 3D this is an approximation of a circle swept around a helix which is 00026 always in the plane normal to the tangent of the helix. If the slope 00027 of the helix is less than 1.0, this is achieved by sweeping an ellipse 00028 oriented vertically along a helix. If the slope is greater than or equal 00029 to 1.0, this is achieved by sweeping an ellipse oriented horizontally 00030 along a helix. The eccentricity of the ellipse is adjusted based on the 00031 slope. 00032 00033 In 2D this is an ellipse offset from the origin. 00034 */ 00035 class HelicoilIF: public BaseIF 00036 { 00037 public: 00038 /// 00039 /** 00040 Constructor specifying the helix radius, pitch, radius of the swept 00041 circle, and whether the domain is on the inside (a_inside), 00042 i.e. where the function is negative. 00043 */ 00044 HelicoilIF(const Real& a_helixR, 00045 const Real& a_helixPitch, 00046 const Real& a_circleR, 00047 const bool& a_inside); 00048 00049 /// Copy constructor 00050 HelicoilIF(const HelicoilIF& a_inputIF); 00051 00052 /// Destructor 00053 virtual ~HelicoilIF(); 00054 00055 /// 00056 /** 00057 Return the value of the function at a_point. 00058 */ 00059 virtual Real value(const RealVect& a_point) const; 00060 00061 virtual BaseIF* newImplicitFunction() const; 00062 00063 /// 00064 /** 00065 Pass this call onto the IFs contained in this IF class. 00066 */ 00067 virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout, 00068 const RealVect & a_dx) 00069 { 00070 m_helixIF->boxLayoutChanged(a_newBoxLayout,a_dx); 00071 } 00072 00073 protected: 00074 Real m_helixR; // the radius of the helix 00075 Real m_helixPitch; // the pitch of the helix 00076 Real m_circleR; // the radius of the swept circle 00077 00078 bool m_inside; // inside flag 00079 00080 Real m_ellipseR; 00081 bool m_vertical; 00082 00083 BaseIF* m_helixIF; 00084 00085 private: 00086 HelicoilIF() 00087 { 00088 MayDay::Abort("HelicoilIF uses strong construction"); 00089 } 00090 00091 void operator=(const HelicoilIF& a_inputIF) 00092 { 00093 MayDay::Abort("HelicoilIF doesn't allow assignment"); 00094 } 00095 }; 00096 00097 #include "NamespaceFooter.H" 00098 #endif