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 _TORUSIF_H_ 00012 #define _TORUSIF_H_ 00013 00014 #include "MayDay.H" 00015 #include "RealVect.H" 00016 00017 #include "BaseIF.H" 00018 00019 #include "NamespaceHeader.H" 00020 00021 /// 00022 /** 00023 This implicit function specifies a torus whose axis is parallel to the 00024 z-axis 00025 */ 00026 class TorusIF: public BaseIF 00027 { 00028 public: 00029 /// 00030 /** 00031 Constructor specifying torus major radius (a_majorRadius), minor radius 00032 (a_minorRadius), center (a_center), and whether the domain is on the 00033 inside (a_inside). 00034 */ 00035 TorusIF(const Real& a_majorRadius, 00036 const Real& a_minorRadius, 00037 const RealVect& a_center, 00038 const bool& a_inside); 00039 00040 /// Copy constructor 00041 TorusIF(const TorusIF& a_inputIF); 00042 00043 /// Destructor 00044 virtual ~TorusIF(); 00045 00046 /// 00047 /** 00048 Return the parameter information 00049 */ 00050 virtual void GetParams(Real& a_majorRadius, 00051 Real& a_minorRadius, 00052 RealVect& a_center, 00053 bool& a_inside) const; 00054 00055 /// 00056 /** 00057 Set the parameter information 00058 */ 00059 virtual void SetParams(const Real& a_majorRadius, 00060 const Real& a_minorRadius, 00061 const RealVect& a_center, 00062 const bool& a_inside); 00063 00064 /// 00065 /** 00066 Return the value of the function at a_point. 00067 */ 00068 virtual Real value(const RealVect& a_point) const; 00069 00070 virtual BaseIF* newImplicitFunction() const; 00071 00072 protected: 00073 Real m_majorRadius; // major radius 00074 Real m_minorRadius; // minor radius 00075 00076 RealVect m_center; // center 00077 00078 bool m_inside; // inside flag 00079 00080 Real m_minorRadius2; // precomputed minor radius squared 00081 00082 private: 00083 TorusIF() 00084 { 00085 MayDay::Abort("TorusIF uses strong construction"); 00086 } 00087 00088 void operator=(const TorusIF& a_inputIF) 00089 { 00090 MayDay::Abort("TorusIF doesn't allow assignment"); 00091 } 00092 }; 00093 00094 #include "NamespaceFooter.H" 00095 #endif