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