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 _POLYNOMIALIF_H_ 00012 #define _POLYNOMIALIF_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 00023 00026 class PolyTerm 00027 { 00028 public: 00030 00033 Real coef; 00034 00036 00039 IntVect powers; 00040 }; 00041 00043 00046 class PolynomialIF: public BaseIF 00047 { 00048 public: 00050 00055 PolynomialIF(const Vector<PolyTerm>& a_polynomial, 00056 const bool& a_inside); 00057 00059 PolynomialIF(const PolynomialIF& a_inputIF); 00060 00062 virtual ~PolynomialIF(); 00063 00065 00068 virtual void GetParams(Vector<PolyTerm>& a_polynomial, 00069 bool& a_inside) const; 00070 00072 00075 virtual void SetParams(const Vector<PolyTerm>& a_polynomial, 00076 const bool& a_inside); 00077 00079 00082 virtual Real value(const RealVect& a_point) const; 00083 00084 virtual BaseIF* newImplicitFunction() const; 00085 00086 protected: 00087 Vector<PolyTerm> m_polynomial; // polynomial (term by term) 00088 bool m_inside; // inside flag 00089 00090 private: 00091 PolynomialIF() 00092 { 00093 MayDay::Error("PolynomialIF uses strong construction"); 00094 } 00095 00096 void operator=(const PolynomialIF& a_inputIF) 00097 { 00098 MayDay::Error("PolynomialIF doesn't allow assignment"); 00099 } 00100 }; 00101 00102 #include "NamespaceFooter.H" 00103 #endif