moab
|
00001 #ifndef SPECTRAL_QUAD_HPP 00002 #define SPECTRAL_QUAD_HPP 00003 /*\brief Shape function space for spectral quad 00004 */ 00005 00006 #include "ElemEvaluator.hpp" 00007 #include "SpectralFuncs.hpp" 00008 00009 namespace moab 00010 { 00011 00012 class SpectralQuad 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, const int num_tuples, double *work, double *result); 00031 00033 static ErrorCode initFcn(const double *verts, const int nverts, double *&work); 00034 00036 static int insideFcn(const double *params, const int ndim, const double tol); 00037 00038 static EvalSet eval_set() 00039 { 00040 return EvalSet(evalFcn, reverseEvalFcn, jacobianFcn, integrateFcn, initFcn); 00041 } 00042 00043 static bool compatible(EntityType tp, int numv, EvalSet &eset) 00044 { 00045 if (tp != MBQUAD) return false; 00046 int i; 00047 for (i = 3; i*i == numv || i*i > numv; i++); 00048 if (i*i != numv) return false; 00049 eset = eval_set(); 00050 return true; 00051 } 00052 00053 protected: 00054 static int _n; 00055 static double *_z[2]; 00056 static lagrange_data _ld[2]; 00057 static opt_data_2 _data; // we should use only 2nd component 00058 static double * _odwork;// work area 00059 00060 // flag for initialization of data 00061 static bool _init; 00062 static double * _glpoints; // it is a space we can use to store gl positions for elements 00063 // on the fly; we do not have a tag yet for them, as in Nek5000 application 00064 // also, these positions might need to be moved on the sphere, for HOMME grids 00065 // do we project them or how do we move them on the sphere? 00066 };// class SpectralQuad 00067 00068 } // namespace moab 00069 00070 #endif