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 _HELIXIF_H_ 00012 #define _HELIXIF_H_ 00013 00014 #include "MayDay.H" 00015 #include "RealVect.H" 00016 #include "Vector.H" 00017 00018 #include "BaseIF.H" 00019 00020 #include "NamespaceHeader.H" 00021 00022 /// 00023 /** 00024 This implicit function takes one implicit function and move it along a 00025 helix in 3D. In 2D the implicit function is simply returned. 00026 00027 In 3D, if a_vertical is false, the given function is restricted to the 00028 x-y plane (z = 0), and this restricted function is rotated around the 00029 z-axis at the specified rate as z changes. 00030 00031 In 3D, if a_vertical is true, the given function is restricted to the 00032 x-y plane (z = 0), but this x-y cross section is oriented vertically and 00033 swept in a helix at the specified rate. 00034 00035 In 2D, the given function is simply returned. 00036 */ 00037 class HelixIF: public BaseIF 00038 { 00039 public: 00040 /// 00041 /** 00042 Constructor specifying one implicit function to be rotated, the 00043 rotation rate, and whether the domain is on the inside (a_inside), 00044 i.e. where the function is negative. 00045 */ 00046 HelixIF(const BaseIF& a_impFunc, 00047 const Real& a_rate, 00048 const bool& a_inside, 00049 const bool& a_vertical = true); 00050 00051 /// Copy constructor 00052 HelixIF(const HelixIF& a_inputIF); 00053 00054 /// Destructor 00055 virtual ~HelixIF(); 00056 00057 /// 00058 /** 00059 Return the value of the function at a_point. 00060 */ 00061 virtual Real value(const RealVect& a_point) const; 00062 00063 virtual BaseIF* newImplicitFunction() const; 00064 00065 /// 00066 /** 00067 Pass this call onto the IFs contained in this IF class. 00068 */ 00069 virtual void boxLayoutChanged(const DisjointBoxLayout & a_newBoxLayout, 00070 const RealVect & a_dx) 00071 { 00072 m_impFunc->boxLayoutChanged(a_newBoxLayout,a_dx); 00073 } 00074 00075 protected: 00076 BaseIF* m_impFunc; // implicit function to rotate 00077 00078 Real m_rate; // the rate of rotate as z changes 00079 00080 bool m_inside; // inside flag 00081 00082 bool m_vertical; // vertical cross section 00083 00084 Real m_minz; // for vertical, the bounds on the cross section 00085 Real m_maxz; 00086 00087 private: 00088 HelixIF() 00089 { 00090 MayDay::Abort("HelixIF uses strong construction"); 00091 } 00092 00093 void operator=(const HelixIF& a_inputIF) 00094 { 00095 MayDay::Abort("HelixIF doesn't allow assignment"); 00096 } 00097 }; 00098 00099 #include "NamespaceFooter.H" 00100 #endif