| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef FUNCTION_DATA_INCLUDED |
| #define FUNCTION_DATA_INCLUDED |
|
|
| #define BOUNDARY_CONDITIONS 1 |
|
|
|
|
| #include "PPolynomial.h" |
|
|
| template<int Degree,class Real> |
| class FunctionData{ |
| bool useDotRatios; |
| int normalize; |
| #if BOUNDARY_CONDITIONS |
| bool reflectBoundary; |
| #endif |
| public: |
| const static int DOT_FLAG = 1; |
| const static int D_DOT_FLAG = 2; |
| const static int D2_DOT_FLAG = 4; |
| const static int VALUE_FLAG = 1; |
| const static int D_VALUE_FLAG = 2; |
|
|
| int depth , res , res2; |
| Real *dotTable , *dDotTable , *d2DotTable; |
| Real *valueTables , *dValueTables; |
| #if BOUNDARY_CONDITIONS |
| PPolynomial<Degree> baseFunction , leftBaseFunction , rightBaseFunction; |
| PPolynomial<Degree-1> dBaseFunction , dLeftBaseFunction , dRightBaseFunction; |
| #else |
| PPolynomial<Degree> baseFunction; |
| PPolynomial<Degree-1> dBaseFunction; |
| #endif |
| PPolynomial<Degree+1>* baseFunctions; |
|
|
| FunctionData(void); |
| ~FunctionData(void); |
|
|
| virtual void setDotTables(const int& flags); |
| virtual void clearDotTables(const int& flags); |
|
|
| virtual void setValueTables(const int& flags,const double& smooth=0); |
| virtual void setValueTables(const int& flags,const double& valueSmooth,const double& normalSmooth); |
| virtual void clearValueTables(void); |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #if BOUNDARY_CONDITIONS |
| void set( const int& maxDepth , const PPolynomial<Degree>& F , const int& normalize , bool useDotRatios=true , bool reflectBoundary=false ); |
| #else |
| void set(const int& maxDepth,const PPolynomial<Degree>& F,const int& normalize , bool useDotRatios=true ); |
| #endif |
|
|
| #if BOUNDARY_CONDITIONS |
| Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const; |
| Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const; |
| Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 , int boundary1 , int boundary2 ) const; |
| #else |
| Real dotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const; |
| Real dDotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const; |
| Real d2DotProduct( const double& center1 , const double& width1 , const double& center2 , const double& width2 ) const; |
| #endif |
|
|
| static inline int SymmetricIndex( const int& i1 , const int& i2 ); |
| static inline int SymmetricIndex( const int& i1 , const int& i2 , int& index ); |
| }; |
|
|
|
|
| #include "FunctionData.inl" |
| #endif |