moab
|
00001 #ifndef SPECTRAL_HEX_HPP 00002 #define SPECTRAL_HEX_HPP 00003 00006 #include "ElemEvaluator.hpp" 00007 #include "SpectralFuncs.hpp" 00008 00009 namespace moab 00010 { 00011 00012 class SpectralHex 00013 { 00014 public: 00016 static ErrorCode evalFcn(const double *params, const double *field, const int ndim, const int num_tuples, 00017 double *work, double *result); 00018 00020 static ErrorCode reverseEvalFcn(EvalFcn eval, JacobianFcn jacob, InsideFcn ins, 00021 const double *posn, const double *verts, const int nverts, const int ndim, 00022 const double iter_tol, const double inside_tol, double *work, 00023 double *params, int *is_inside); 00024 00026 static ErrorCode jacobianFcn(const double *params, const double *verts, const int nverts, const int ndim, 00027 double *work, double *result); 00028 00030 static ErrorCode integrateFcn(const double *field, const double *verts, const int nverts, const int ndim, 00031 const int num_tuples, double *work, double *result); 00032 00034 static ErrorCode initFcn(const double *verts, const int nverts, double *&work); 00035 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 if (i*i*i != numv) return false; 00050 eset = eval_set(); 00051 return true; 00052 } 00053 00054 protected: 00055 static int _n; 00056 static double *_z[3]; 00057 static lagrange_data _ld[3]; 00058 static opt_data_3 _data; 00059 static double * _odwork;// work area 00060 static bool init_; 00061 };// class SpectralHex 00062 00063 } // namespace moab 00064 00065 #endif