![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
00001 #ifndef LINEAR_TRI_HPP
00002 #define LINEAR_TRI_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 LinearTri
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 normal at a specified facet*/
00038 static ErrorCode normalFcn( const int ientDim,
00039 const int facet,
00040 const int nverts,
00041 const double* verts,
00042 double normal[] );
00043
00044 /** \brief Evaluate the jacobian at a specified parametric position */
00045 static ErrorCode jacobianFcn( const double* params,
00046 const double* verts,
00047 const int nverts,
00048 const int ndim,
00049 double* work,
00050 double* result );
00051
00052 /** \brief Forward-evaluation of field at parametric coordinates */
00053 static ErrorCode integrateFcn( const double* field,
00054 const double* verts,
00055 const int nverts,
00056 const int ndim,
00057 const int num_tuples,
00058 double* work,
00059 double* result );
00060
00061 /** \brief Initialize this EvalSet */
00062 static ErrorCode initFcn( const double* verts, const int nverts, double*& work );
00063
00064 /** \brief Function that returns whether or not the parameters are inside the natural space of
00065 * the element */
00066 static int insideFcn( const double* params, const int ndim, const double tol );
00067
00068 static ErrorCode evaluate_reverse( EvalFcn eval,
00069 JacobianFcn jacob,
00070 InsideFcn inside_f,
00071 const double* posn,
00072 const double* verts,
00073 const int nverts,
00074 const int ndim,
00075 const double iter_tol,
00076 const double inside_tol,
00077 double* work,
00078 double* params,
00079 int* inside );
00080
00081 static EvalSet eval_set()
00082 {
00083 return EvalSet( evalFcn, reverseEvalFcn, normalFcn, jacobianFcn, integrateFcn, initFcn, insideFcn );
00084 }
00085
00086 static bool compatible( EntityType tp, int numv, EvalSet& eset )
00087 {
00088 if( tp == MBTRI && numv >= 3 )
00089 {
00090 eset = eval_set();
00091 return true;
00092 }
00093 else
00094 return false;
00095 }
00096
00097 protected:
00098 static const double corner[3][2];
00099 }; // class LinearTri
00100
00101 } // namespace moab
00102
00103 #endif