MOAB: Mesh Oriented datABase
(version 5.4.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, 00017 const double* field, 00018 const int ndim, 00019 const int num_tuples, 00020 double* work, 00021 double* result ); 00022 00023 /** \brief Reverse-evaluation of parametric coordinates at physical space position */ 00024 static ErrorCode reverseEvalFcn( EvalFcn eval, 00025 JacobianFcn jacob, 00026 InsideFcn ins, 00027 const double* posn, 00028 const double* verts, 00029 const int nverts, 00030 const int ndim, 00031 const double iter_tol, 00032 const double inside_tol, 00033 double* work, 00034 double* params, 00035 int* is_inside ); 00036 00037 /** \brief Evaluate the jacobian at a specified parametric position */ 00038 static ErrorCode jacobianFcn( const double* params, 00039 const double* verts, 00040 const int nverts, 00041 const int ndim, 00042 double* work, 00043 double* result ); 00044 00045 /** \brief Forward-evaluation of field at parametric coordinates */ 00046 static ErrorCode integrateFcn( const double* field, 00047 const double* verts, 00048 const int nverts, 00049 const int ndim, 00050 const int num_tuples, 00051 double* work, 00052 double* result ); 00053 00054 /** \brief Initialize this EvalSet */ 00055 static ErrorCode initFcn( const double* verts, const int nverts, double*& work ); 00056 00057 /** \brief Function that returns whether or not the parameters are inside the natural space of 00058 * the element */ 00059 static int insideFcn( const double* params, const int ndim, const double tol ); 00060 00061 static EvalSet eval_set() 00062 { 00063 return EvalSet( evalFcn, reverseEvalFcn, jacobianFcn, integrateFcn, initFcn ); 00064 } 00065 00066 static bool compatible( EntityType tp, int numv, EvalSet& eset ) 00067 { 00068 if( tp != MBHEX ) return false; 00069 int i; 00070 for( i = 3; i * i * i == numv || i * i * i > numv; i++ ) 00071 ; 00072 if( i * i * i != numv ) return false; 00073 eset = eval_set(); 00074 return true; 00075 } 00076 00077 protected: 00078 static int _n; 00079 static double* _z[3]; 00080 static lagrange_data _ld[3]; 00081 static opt_data_3 _data; 00082 static double* _odwork; // work area 00083 static bool init_; 00084 }; // class SpectralHex 00085 00086 } // namespace moab 00087 00088 #endif