Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
LinearQuad.hpp
Go to the documentation of this file.
00001 #ifndef LINEAR_QUAD_HPP
00002 #define LINEAR_QUAD_HPP
00003 /**\brief Shape function space for trilinear quadahedron, 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 LinearQuad
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 Function that returns whether or not the parameters are inside the natural space of
00062      * the element */
00063     static int insideFcn( const double* params, const int ndim, const double tol );
00064 
00065     static EvalSet eval_set()
00066     {
00067         return EvalSet( evalFcn, reverseEvalFcn, normalFcn, jacobianFcn, integrateFcn, NULL, insideFcn );
00068     }
00069 
00070     static bool compatible( EntityType tp, int numv, EvalSet& eset )
00071     {
00072         if( tp == MBQUAD && numv == 4 )
00073         {
00074             eset = eval_set();
00075             return true;
00076         }
00077         else
00078             return false;
00079     }
00080 
00081   protected:
00082     /* Preimages of the vertices -- "canonical vertices" -- are known as "corners". */
00083     static const double corner[4][2];
00084     static const double gauss[1][2];
00085     static const unsigned int corner_count = 4;
00086     static const unsigned int gauss_count  = 1;
00087 
00088 };  // class LinearQuad
00089 
00090 }  // namespace moab
00091 
00092 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines