MOAB: Mesh Oriented datABase  (version 5.4.1)
SpectralQuad.hpp
Go to the documentation of this file.
00001 #ifndef SPECTRAL_QUAD_HPP
00002 #define SPECTRAL_QUAD_HPP
00003 /*\brief Shape function space for spectral quad
00004  */
00005 
00006 #include "moab/ElemEvaluator.hpp"
00007 #include "SpectralFuncs.hpp"
00008 
00009 namespace moab
00010 {
00011 
00012 class SpectralQuad
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 != MBQUAD ) return false;
00069         int i;
00070         for( i = 3; i * i == numv || i * i > numv; i++ )
00071             ;
00072         if( i * i != numv ) return false;
00073         eset = eval_set();
00074         return true;
00075     }
00076 
00077   protected:
00078     static int _n;
00079     static double* _z[2];
00080     static lagrange_data _ld[2];
00081     static opt_data_2 _data;  // we should use only 2nd component
00082     static double* _odwork;   // work area
00083 
00084     // flag for initialization of data
00085     static bool _init;
00086     static double* _glpoints;  // it is a space we can use to store gl positions for elements
00087                                // on the fly; we do not have a tag yet for them, as in Nek5000 application
00088                                // also, these positions might need to be moved on the sphere, for HOMME grids
00089                                // do we project them or how do we move them on the sphere?
00090 };                             // class SpectralQuad
00091 
00092 }  // namespace moab
00093 
00094 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines