Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::QuadraticHex Class Reference

#include <QuadraticHex.hpp>

Static Public Member Functions

static ErrorCode evalFcn (const double *params, const double *field, const int ndim, const int num_tuples, double *work, double *result)
 Forward-evaluation of field at parametric coordinates. More...
 
static ErrorCode reverseEvalFcn (EvalFcn eval, JacobianFcn jacob, InsideFcn ins, const double *posn, const double *verts, const int nverts, const int ndim, const double iter_tol, const double inside_tol, double *work, double *params, int *is_inside)
 Reverse-evaluation of parametric coordinates at physical space position. More...
 
static ErrorCode normalFcn (const int ientDim, const int facet, const int nverts, const double *verts, double normal[])
 Evaluate the normal at a specified facet. More...
 
static ErrorCode jacobianFcn (const double *params, const double *verts, const int nverts, const int ndim, double *work, double *result)
 Evaluate the jacobian at a specified parametric position. More...
 
static ErrorCode integrateFcn (const double *field, const double *verts, const int nverts, const int ndim, const int num_tuples, double *work, double *result)
 Forward-evaluation of field at parametric coordinates. More...
 
static int insideFcn (const double *params, const int ndim, const double tol)
 Function that returns whether or not the parameters are inside the natural space of the element. More...
 
static EvalSet eval_set ()
 
static bool compatible (EntityType tp, int numv, EvalSet &eset)
 

Static Protected Member Functions

static double SH (const int i, const double params)
 
static double DSH (const int i, const double params)
 

Static Protected Attributes

static const int corner [27][3]
 
static const double gauss [8][2]
 
static const unsigned int corner_count = 27
 
static const unsigned int gauss_count = 8
 

Detailed Description

Definition at line 11 of file QuadraticHex.hpp.

Member Function Documentation

◆ compatible()

static bool moab::QuadraticHex::compatible ( EntityType  tp,
int  numv,
EvalSet eset 
)
inlinestatic

Definition at line 69 of file QuadraticHex.hpp.

70  {
71  if( tp == MBHEX && numv == 27 )
72  {
73  eset = eval_set();
74  return true;
75  }
76  else
77  return false;
78  }

References eval_set(), and MBHEX.

Referenced by moab::EvalSet::get_eval_set().

◆ DSH()

double moab::QuadraticHex::DSH ( const int  i,
const double  params 
)
staticprotected

Definition at line 45 of file QuadraticHex.cpp.

46 {
47  switch( i )
48  {
49  case -1:
50  return params - 0.5;
51  case 0:
52  return -2 * params;
53  case 1:
54  return params + 0.5;
55  default:
56  return 0.;
57  }
58 }

Referenced by jacobianFcn().

◆ eval_set()

static EvalSet moab::QuadraticHex::eval_set ( )
inlinestatic

Definition at line 64 of file QuadraticHex.hpp.

65  {
67  }

References evalFcn(), insideFcn(), integrateFcn(), jacobianFcn(), normalFcn(), and reverseEvalFcn().

Referenced by compatible().

◆ evalFcn()

ErrorCode moab::QuadraticHex::evalFcn ( const double *  params,
const double *  field,
const int  ndim,
const int  num_tuples,
double *  work,
double *  result 
)
static

Forward-evaluation of field at parametric coordinates.

Definition at line 60 of file QuadraticHex.cpp.

66 {
67  assert( params && field && num_tuples > 0 );
68  std::fill( result, result + num_tuples, 0.0 );
69  for( int i = 0; i < 27; i++ )
70  {
71  const double sh = SH( corner[i][0], params[0] ) * SH( corner[i][1], params[1] ) * SH( corner[i][2], params[2] );
72  for( int j = 0; j < num_tuples; j++ )
73  result[j] += sh * field[num_tuples * i + j];
74  }
75 
76  return MB_SUCCESS;
77 }

References corner, MB_SUCCESS, and SH().

Referenced by eval_set().

◆ insideFcn()

int moab::QuadraticHex::insideFcn ( const double *  params,
const int  ndim,
const double  tol 
)
static

Function that returns whether or not the parameters are inside the natural space of the element.

Definition at line 136 of file QuadraticHex.cpp.

137 {
138  return EvalSet::inside_function( params, ndim, tol );
139 }

References moab::EvalSet::inside_function().

Referenced by eval_set().

◆ integrateFcn()

ErrorCode moab::QuadraticHex::integrateFcn ( const double *  field,
const double *  verts,
const int  nverts,
const int  ndim,
const int  num_tuples,
double *  work,
double *  result 
)
static

Forward-evaluation of field at parametric coordinates.

Definition at line 107 of file QuadraticHex.cpp.

114 {
115  return MB_NOT_IMPLEMENTED;
116 }

References MB_NOT_IMPLEMENTED.

Referenced by eval_set().

◆ jacobianFcn()

ErrorCode moab::QuadraticHex::jacobianFcn ( const double *  params,
const double *  verts,
const int  nverts,
const int  ndim,
double *  work,
double *  result 
)
static

Evaluate the jacobian at a specified parametric position.

Definition at line 79 of file QuadraticHex.cpp.

85 {
86  assert( 27 == nverts && params && verts );
87  if( 27 != nverts ) return MB_FAILURE;
88  Matrix3* J = reinterpret_cast< Matrix3* >( result );
89  for( int i = 0; i < 27; i++ )
90  {
91  const double sh[3] = { SH( corner[i][0], params[0] ), SH( corner[i][1], params[1] ),
92  SH( corner[i][2], params[2] ) };
93  const double dsh[3] = { DSH( corner[i][0], params[0] ), DSH( corner[i][1], params[1] ),
94  DSH( corner[i][2], params[2] ) };
95 
96  for( int j = 0; j < 3; j++ )
97  {
98  ( *J )( j, 0 ) += dsh[0] * sh[1] * sh[2] * verts[ndim * i + j]; // dxj/dr first column
99  ( *J )( j, 1 ) += sh[0] * dsh[1] * sh[2] * verts[ndim * i + j]; // dxj/ds
100  ( *J )( j, 2 ) += sh[0] * sh[1] * dsh[2] * verts[ndim * i + j]; // dxj/dt
101  }
102  }
103 
104  return MB_SUCCESS;
105 }

References corner, DSH(), MB_SUCCESS, and SH().

Referenced by eval_set().

◆ normalFcn()

ErrorCode moab::QuadraticHex::normalFcn ( const int  ientDim,
const int  facet,
const int  nverts,
const double *  verts,
double  normal[] 
)
static

Evaluate the normal at a specified facet.

Definition at line 141 of file QuadraticHex.cpp.

146 {
147  return MB_NOT_IMPLEMENTED;
148 }

References MB_NOT_IMPLEMENTED.

Referenced by eval_set().

◆ reverseEvalFcn()

ErrorCode moab::QuadraticHex::reverseEvalFcn ( EvalFcn  eval,
JacobianFcn  jacob,
InsideFcn  ins,
const double *  posn,
const double *  verts,
const int  nverts,
const int  ndim,
const double  iter_tol,
const double  inside_tol,
double *  work,
double *  params,
int *  is_inside 
)
static

Reverse-evaluation of parametric coordinates at physical space position.

Definition at line 118 of file QuadraticHex.cpp.

130 {
131  assert( posn && verts );
132  return EvalSet::evaluate_reverse( eval, jacob, ins, posn, verts, nverts, ndim, iter_tol, inside_tol, work, params,
133  is_inside );
134 }

References moab::EvalSet::evaluate_reverse().

Referenced by eval_set().

◆ SH()

double moab::QuadraticHex::SH ( const int  i,
const double  params 
)
staticprotected

Definition at line 31 of file QuadraticHex.cpp.

32 {
33  switch( i )
34  {
35  case -1:
36  return ( params * params - params ) / 2;
37  case 0:
38  return 1 - params * params;
39  case 1:
40  return ( params * params + params ) / 2;
41  default:
42  return 0.;
43  }
44 }

Referenced by evalFcn(), and jacobianFcn().

Member Data Documentation

◆ corner

const int moab::QuadraticHex::corner
staticprotected
Initial value:
= { { -1, -1, -1 }, { 1, -1, -1 }, { 1, 1, -1 },
{ -1, 1, -1 },
{ -1, -1, 1 },
{ 1, -1, 1 },
{ 1, 1, 1 }, { -1, 1, 1 },
{ 0, -1, -1 },
{ 1, 0, -1 },
{ 0, 1, -1 },
{ -1, 0, -1 },
{ -1, -1, 0 },
{ 1, -1, 0 },
{ 1, 1, 0 },
{ -1, 1, 0 },
{ 0, -1, 1 },
{ 1, 0, 1 },
{ 0, 1, 1 },
{ -1, 0, 1 },
{ 0, -1, 0 },
{ 1, 0, 0 },
{ 0, 1, 0 },
{ -1, 0, 0 }, { 0, 0, -1 }, { 0, 0, 1 }, { 0, 0, 0 } }

Definition at line 85 of file QuadraticHex.hpp.

Referenced by evalFcn(), and jacobianFcn().

◆ corner_count

const unsigned int moab::QuadraticHex::corner_count = 27
staticprotected

Definition at line 87 of file QuadraticHex.hpp.

◆ gauss

const double moab::QuadraticHex::gauss[8][2]
staticprotected

Definition at line 86 of file QuadraticHex.hpp.

◆ gauss_count

const unsigned int moab::QuadraticHex::gauss_count = 8
staticprotected

Definition at line 88 of file QuadraticHex.hpp.


The documentation for this class was generated from the following files: