MOAB: Mesh Oriented datABase
(version 5.2.1)
|
00001 #ifndef SPECTRAL_HEX_HPP 00002 #define SPECTRAL_HEX_HPP 00003 /**\brief Shape function space for spectral hexahedron 00004 */ 00005 00006 #include "moab/ElemEvaluator.hpp" 00007 #include "SpectralFuncs.hpp" 00008 00009 namespace moab 00010 { 00011 00012 class SpectralHex 00013 { 00014 public: 00015 /** \brief Forward-evaluation of field at parametric coordinates */ 00016 static ErrorCode evalFcn( const double* params, const double* field, const int ndim, const int num_tuples, 00017 double* work, double* result ); 00018 00019 /** \brief Reverse-evaluation of parametric coordinates at physical space position */ 00020 static ErrorCode reverseEvalFcn( EvalFcn eval, JacobianFcn jacob, InsideFcn ins, const double* posn, 00021 const double* verts, const int nverts, const int ndim, const double iter_tol, 00022 const double inside_tol, double* work, double* params, int* is_inside ); 00023 00024 /** \brief Evaluate the jacobian at a specified parametric position */ 00025 static ErrorCode jacobianFcn( const double* params, const double* verts, const int nverts, const int ndim, 00026 double* work, double* result ); 00027 00028 /** \brief Forward-evaluation of field at parametric coordinates */ 00029 static ErrorCode integrateFcn( const double* field, const double* verts, const int nverts, const int ndim, 00030 const int num_tuples, double* work, double* result ); 00031 00032 /** \brief Initialize this EvalSet */ 00033 static ErrorCode initFcn( const double* verts, const int nverts, double*& work ); 00034 00035 /** \brief Function that returns whether or not the parameters are inside the natural space of 00036 * the element */ 00037 static int insideFcn( const double* params, const int ndim, const double tol ); 00038 00039 static EvalSet eval_set() 00040 { 00041 return EvalSet( evalFcn, reverseEvalFcn, jacobianFcn, integrateFcn, initFcn ); 00042 } 00043 00044 static bool compatible( EntityType tp, int numv, EvalSet& eset ) 00045 { 00046 if( tp != MBHEX ) return false; 00047 int i; 00048 for( i = 3; i * i * i == numv || i * i * i > numv; i++ ) 00049 ; 00050 if( i * i * i != numv ) return false; 00051 eset = eval_set(); 00052 return true; 00053 } 00054 00055 protected: 00056 static int _n; 00057 static double* _z[3]; 00058 static lagrange_data _ld[3]; 00059 static opt_data_3 _data; 00060 static double* _odwork; // work area 00061 static bool init_; 00062 }; // class SpectralHex 00063 00064 } // namespace moab 00065 00066 #endif