Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
LinearQuad.hpp
Go to the documentation of this file.
1 #ifndef LINEAR_QUAD_HPP
2 #define LINEAR_QUAD_HPP
3 /**\brief Shape function space for trilinear quadahedron, obtained by a pushforward of the canonical
4  * linear (affine) functions. */
5 
6 #include "moab/ElemEvaluator.hpp"
7 #include "moab/CN.hpp"
8 
9 namespace moab
10 {
11 
13 {
14  public:
15  /** \brief Forward-evaluation of field at parametric coordinates */
16  static ErrorCode evalFcn( const double* params,
17  const double* field,
18  const int ndim,
19  const int num_tuples,
20  double* work,
21  double* result );
22 
23  /** \brief Reverse-evaluation of parametric coordinates at physical space position */
24  static ErrorCode reverseEvalFcn( EvalFcn eval,
25  JacobianFcn jacob,
26  InsideFcn ins,
27  const double* posn,
28  const double* verts,
29  const int nverts,
30  const int ndim,
31  const double iter_tol,
32  const double inside_tol,
33  double* work,
34  double* params,
35  int* is_inside );
36 
37  /** \brief Evaluate the normal at a specified facet*/
38  static ErrorCode normalFcn( const int ientDim,
39  const int facet,
40  const int nverts,
41  const double* verts,
42  double normal[3] );
43 
44  /** \brief Evaluate the jacobian at a specified parametric position */
45  static ErrorCode jacobianFcn( const double* params,
46  const double* verts,
47  const int nverts,
48  const int ndim,
49  double* work,
50  double* result );
51 
52  /** \brief Forward-evaluation of field at parametric coordinates */
53  static ErrorCode integrateFcn( const double* field,
54  const double* verts,
55  const int nverts,
56  const int ndim,
57  const int num_tuples,
58  double* work,
59  double* result );
60 
61  /** \brief Function that returns whether or not the parameters are inside the natural space of
62  * the element */
63  static int insideFcn( const double* params, const int ndim, const double tol );
64 
65  static EvalSet eval_set()
66  {
68  }
69 
70  static bool compatible( EntityType tp, int numv, EvalSet& eset )
71  {
72  if( tp == MBQUAD && numv == 4 )
73  {
74  eset = eval_set();
75  return true;
76  }
77  else
78  return false;
79  }
80 
81  protected:
82  /* Preimages of the vertices -- "canonical vertices" -- are known as "corners". */
83  static const double corner[4][2];
84  static const double gauss[1][2];
85  static const unsigned int corner_count = 4;
86  static const unsigned int gauss_count = 1;
87 
88 }; // class LinearQuad
89 
90 } // namespace moab
91 
92 #endif