MOAB: Mesh Oriented datABase  (version 5.4.1)
QuadraticHex.hpp
Go to the documentation of this file.
00001 #ifndef QUADRATIC_HEX_HPP
00002 #define QUADRATIC_HEX_HPP
00003 /**\brief Shape function space for trilinear hexahedron, obtained by a pushforward of the canonical
00004  * linear (affine) functions. */
00005 
00006 #include "moab/ElemEvaluator.hpp"
00007 
00008 namespace moab
00009 {
00010 
00011 class QuadraticHex
00012 {
00013   public:
00014     /** \brief Forward-evaluation of field at parametric coordinates */
00015     static ErrorCode evalFcn( const double* params,
00016                               const double* field,
00017                               const int ndim,
00018                               const int num_tuples,
00019                               double* work,
00020                               double* result );
00021 
00022     /** \brief Reverse-evaluation of parametric coordinates at physical space position */
00023     static ErrorCode reverseEvalFcn( EvalFcn eval,
00024                                      JacobianFcn jacob,
00025                                      InsideFcn ins,
00026                                      const double* posn,
00027                                      const double* verts,
00028                                      const int nverts,
00029                                      const int ndim,
00030                                      const double iter_tol,
00031                                      const double inside_tol,
00032                                      double* work,
00033                                      double* params,
00034                                      int* is_inside );
00035 
00036     /** \brief Evaluate the normal at a specified facet*/
00037     static ErrorCode normalFcn( const int ientDim,
00038                                 const int facet,
00039                                 const int nverts,
00040                                 const double* verts,
00041                                 double normal[] );
00042 
00043     /** \brief Evaluate the jacobian at a specified parametric position */
00044     static ErrorCode jacobianFcn( const double* params,
00045                                   const double* verts,
00046                                   const int nverts,
00047                                   const int ndim,
00048                                   double* work,
00049                                   double* result );
00050 
00051     /** \brief Forward-evaluation of field at parametric coordinates */
00052     static ErrorCode integrateFcn( const double* field,
00053                                    const double* verts,
00054                                    const int nverts,
00055                                    const int ndim,
00056                                    const int num_tuples,
00057                                    double* work,
00058                                    double* result );
00059 
00060     /** \brief Function that returns whether or not the parameters are inside the natural space of
00061      * the element */
00062     static int insideFcn( const double* params, const int ndim, const double tol );
00063 
00064     static EvalSet eval_set()
00065     {
00066         return EvalSet( evalFcn, reverseEvalFcn, normalFcn, jacobianFcn, integrateFcn, NULL, insideFcn );
00067     }
00068 
00069     static bool compatible( EntityType tp, int numv, EvalSet& eset )
00070     {
00071         if( tp == MBHEX && numv == 27 )
00072         {
00073             eset = eval_set();
00074             return true;
00075         }
00076         else
00077             return false;
00078     }
00079 
00080   protected:
00081     static double SH( const int i, const double params );
00082     static double DSH( const int i, const double params );
00083 
00084     /* Preimages of the vertices -- "canonical vertices" -- are known as "corners". */
00085     static const int corner[27][3];
00086     static const double gauss[8][2];  // TODO fix me
00087     static const unsigned int corner_count = 27;
00088     static const unsigned int gauss_count  = 8;  // TODO fix me
00089 
00090 };  // class QuadraticHex
00091 
00092 }  // namespace moab
00093 
00094 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines