00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
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 #include "IndexTM.H"
00018
00019 #include "BaseIF.H"
00020
00021 #include "NamespaceHeader.H"
00022
00023
00024
00025
00026
00027 class PolyTerm
00028 {
00029 public:
00030
00031
00032
00033
00034 void partialDerivative(PolyTerm & a_partial,
00035 const IntVect & a_whichPartial,
00036 const PolyTerm & a_poly) const;
00037
00038
00039
00040
00041
00042 void firstOrderPartial(PolyTerm & a_partial,
00043 const int & a_whichPartial) const;
00044
00045
00046
00047
00048
00049
00050 Real coef;
00051
00052
00053
00054
00055
00056 IntVect powers;
00057 };
00058
00059
00060
00061
00062
00063 class PolynomialIF: public BaseIF
00064 {
00065 public:
00066
00067
00068
00069
00070
00071
00072 PolynomialIF(const Vector<PolyTerm>& a_polynomial,
00073 const bool& a_inside);
00074
00075
00076 PolynomialIF(const PolynomialIF& a_inputIF);
00077
00078
00079 virtual ~PolynomialIF();
00080
00081
00082
00083
00084
00085 virtual void GetParams(Vector<PolyTerm>& a_polynomial,
00086 bool& a_inside) const;
00087
00088
00089
00090
00091
00092 virtual void SetParams(const Vector<PolyTerm>& a_polynomial,
00093 const bool& a_inside);
00094
00095
00096
00097
00098
00099 virtual Real value(const RealVect & a_point,
00100 const Vector<PolyTerm> & a_polynomial) const;
00101
00102
00103
00104
00105
00106 virtual Real value(const RealVect& a_point) const;
00107
00108
00109
00110
00111
00112 virtual Real value(const IndexTM<int,GLOBALDIM> & a_partialDerivative,
00113 const IndexTM<Real,GLOBALDIM>& a_point) const;
00114
00115
00116
00117
00118 virtual void partialDerivative(Vector<PolyTerm> & a_partial,
00119 const IntVect & a_whichPartialOp,
00120 const Vector<PolyTerm> & a_polynomial)const;
00121
00122 virtual BaseIF* newImplicitFunction() const;
00123
00124 protected:
00125 Vector<PolyTerm> m_polynomial;
00126 bool m_inside;
00127
00128 private:
00129 PolynomialIF()
00130 {
00131 MayDay::Abort("PolynomialIF uses strong construction");
00132 }
00133
00134 void operator=(const PolynomialIF& a_inputIF)
00135 {
00136 MayDay::Abort("PolynomialIF doesn't allow assignment");
00137 }
00138 };
00139
00140 #include "NamespaceFooter.H"
00141 #endif