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 _ELLIPSOIDIF_H_ 00012 #define _ELLIPSOIDIF_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 an ellipsoid. 00024 */ 00025 class EllipsoidIF: public BaseIF 00026 { 00027 public: 00028 /// 00029 /** 00030 Constructor specifying ellipsoid "radii" (a_radii), center (a_center), 00031 and whether the domain is on the inside (a_inside). 00032 */ 00033 EllipsoidIF(const RealVect& a_radii, 00034 const RealVect& a_center, 00035 const bool& a_inside); 00036 00037 /// Copy constructor 00038 EllipsoidIF(const EllipsoidIF& a_inputIF); 00039 00040 /// Destructor 00041 virtual ~EllipsoidIF(); 00042 00043 /// 00044 /** 00045 Return the parameter information 00046 */ 00047 virtual void GetParams(RealVect& a_radii, 00048 RealVect& a_center, 00049 bool& a_inside) const; 00050 00051 /// 00052 /** 00053 Set the parameter information 00054 */ 00055 virtual void SetParams(const RealVect& a_radii, 00056 const RealVect& a_center, 00057 const bool& a_inside); 00058 00059 /// 00060 /** 00061 Return the value of the function at a_point. 00062 */ 00063 virtual Real value(const RealVect& a_point) const; 00064 00065 virtual BaseIF* newImplicitFunction() const; 00066 00067 protected: 00068 RealVect m_radii; // radii 00069 RealVect m_center; // center 00070 bool m_inside; // inside flag 00071 00072 RealVect m_radii2; // precomputed radii squared 00073 00074 private: 00075 EllipsoidIF() 00076 { 00077 MayDay::Abort("EllipsoidIF uses strong construction"); 00078 } 00079 00080 void operator=(const EllipsoidIF& a_inputIF) 00081 { 00082 MayDay::Abort("EllipsoidIF doesn't allow assignment"); 00083 } 00084 }; 00085 00086 #include "NamespaceFooter.H" 00087 #endif