MOAB: Mesh Oriented datABase  (version 5.2.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, 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 != MBQUAD ) return false;
00047         int i;
00048         for( i = 3; i * i == numv || i * i > numv; i++ )
00049             ;
00050         if( i * i != numv ) return false;
00051         eset = eval_set();
00052         return true;
00053     }
00054 
00055   protected:
00056     static int _n;
00057     static double* _z[2];
00058     static lagrange_data _ld[2];
00059     static opt_data_2 _data;  // we should use only 2nd component
00060     static double* _odwork;   // work area
00061 
00062     // flag for initialization of data
00063     static bool _init;
00064     static double* _glpoints;  // it is a space we can use to store gl positions for elements
00065                                // on the fly; we do not have a tag yet for them, as in Nek5000 application
00066                                // also, these positions might need to be moved on the sphere, for HOMME grids
00067                                // do we project them or how do we move them on the sphere?
00068 };                             // class SpectralQuad
00069 
00070 }  // namespace moab
00071 
00072 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines