MOAB: Mesh Oriented datABase  (version 5.2.1)
LinearHex.hpp
Go to the documentation of this file.
00001 #ifndef LINEAR_HEX_HPP
00002 #define LINEAR_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 #include "moab/CN.hpp"
00008 
00009 namespace moab
00010 {
00011 
00012 class LinearHex
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 normal at a specified facet*/
00025     static ErrorCode normalFcn( const int ientDim, const int facet, const int nverts, const double* verts,
00026                                 double normal[] );
00027 
00028     /** \brief Evaluate the jacobian at a specified parametric position */
00029     static ErrorCode jacobianFcn( const double* params, const double* verts, const int nverts, const int ndim,
00030                                   double* work, double* result );
00031 
00032     /** \brief Forward-evaluation of field at parametric coordinates */
00033     static ErrorCode integrateFcn( const double* field, const double* verts, const int nverts, const int ndim,
00034                                    const int num_tuples, double* work, double* result );
00035 
00036     /** \brief Function that returns whether or not the parameters are inside the natural space of
00037      * the element */
00038     static int insideFcn( const double* params, const int ndim, const double tol );
00039 
00040     static EvalSet eval_set()
00041     {
00042         return EvalSet( evalFcn, reverseEvalFcn, normalFcn, jacobianFcn, integrateFcn, (InitFcn)NULL, insideFcn );
00043     }
00044 
00045     static bool compatible( EntityType tp, int numv, EvalSet& eset )
00046     {
00047         if( tp == MBHEX && numv == 8 )
00048         {
00049             eset = eval_set();
00050             return true;
00051         }
00052         else
00053             return false;
00054     }
00055 
00056   protected:
00057     /* Preimages of the vertices -- "canonical vertices" -- are known as "corners". */
00058     static const double corner[8][3];
00059     static const double gauss[1][2];
00060     static const unsigned int corner_count = 8;
00061     static const unsigned int gauss_count  = 1;
00062 
00063 };  // class LinearHex
00064 
00065 }  // namespace moab
00066 
00067 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines