MOAB: Mesh Oriented datABase  (version 5.2.1)
LinearTet.hpp
Go to the documentation of this file.
00001 #ifndef LINEAR_TET_HPP
00002 #define LINEAR_TET_HPP
00003 /**\brief Shape function space for trilinear tetrahedron, 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 LinearTet
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 Initialize this EvalSet */
00037     static ErrorCode initFcn( const double* verts, const int nverts, double*& work );
00038 
00039     /** \brief Function that returns whether or not the parameters are inside the natural space of
00040      * the element */
00041     static int insideFcn( const double* params, const int ndim, const double tol );
00042 
00043     static ErrorCode evaluate_reverse( EvalFcn eval, JacobianFcn jacob, InsideFcn inside_f, const double* posn,
00044                                        const double* verts, const int nverts, const int ndim, const double iter_tol,
00045                                        const double inside_tol, double* work, double* params, int* inside );
00046 
00047     static EvalSet eval_set()
00048     {
00049         return EvalSet( evalFcn, reverseEvalFcn, normalFcn, jacobianFcn, integrateFcn, initFcn, insideFcn );
00050     }
00051 
00052     static bool compatible( EntityType tp, int numv, EvalSet& eset )
00053     {
00054         if( tp == MBTET && numv >= 4 )
00055         {
00056             eset = eval_set();
00057             return true;
00058         }
00059         else
00060             return false;
00061     }
00062 
00063   protected:
00064     static const double corner[4][3];
00065 };  // class LinearTet
00066 
00067 }  // namespace moab
00068 
00069 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines