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

Shape function for trilinear hexahedron. More...

+ Inheritance diagram for moab::ElemUtil::LinearHexMap:
+ Collaboration diagram for moab::ElemUtil::LinearHexMap:

Public Member Functions

 LinearHexMap (const CartVect *corner_coords)
 
virtual CartVect center_xi () const
 Return \(\vec \xi\) corresponding to logical center of element. More...
 
virtual CartVect evaluate (const CartVect &xi) const
 Evaluate mapping function (calculate \(\vec x = F($\vec \xi)\) ) More...
 
virtual double evaluate_scalar_field (const CartVect &xi, const double *f_vals) const
 
virtual Matrix3 jacobian (const CartVect &xi) const
 Evaluate Jacobian of mapping function. More...
 
- Public Member Functions inherited from moab::ElemUtil::VolMap
bool solve_inverse (const CartVect &x, CartVect &xi, double tol) const
 Evaluate inverse of mapping function (calculate \(\vec \xi = F^-1($\vec x)\) ) More...
 

Private Attributes

const CartVectcorners
 

Static Private Attributes

static const double corner_xi [8][3]
 

Detailed Description

Shape function for trilinear hexahedron.

Definition at line 48 of file ElemUtil.cpp.

Constructor & Destructor Documentation

◆ LinearHexMap()

moab::ElemUtil::LinearHexMap::LinearHexMap ( const CartVect corner_coords)
inline

Definition at line 51 of file ElemUtil.cpp.

51 : corners( corner_coords ) {}

Member Function Documentation

◆ center_xi()

CartVect moab::ElemUtil::LinearHexMap::center_xi ( ) const
virtual

Return \(\vec \xi\) corresponding to logical center of element.

Implements moab::ElemUtil::VolMap.

Definition at line 64 of file ElemUtil.cpp.

65  {
66  return CartVect( 0.0 );
67  }

◆ evaluate()

CartVect moab::ElemUtil::LinearHexMap::evaluate ( const CartVect xi) const
virtual

Evaluate mapping function (calculate \(\vec x = F($\vec \xi)\) )

Implements moab::ElemUtil::VolMap.

Definition at line 69 of file ElemUtil.cpp.

70  {
71  CartVect x( 0.0 );
72  for( unsigned i = 0; i < 8; ++i )
73  {
74  const double N_i =
75  ( 1 + xi[0] * corner_xi[i][0] ) * ( 1 + xi[1] * corner_xi[i][1] ) * ( 1 + xi[2] * corner_xi[i][2] );
76  x += N_i * corners[i];
77  }
78  x *= 0.125;
79  return x;
80  }

References corner_xi, and corners.

◆ evaluate_scalar_field()

double moab::ElemUtil::LinearHexMap::evaluate_scalar_field ( const CartVect xi,
const double *  f_vals 
) const
virtual

Definition at line 82 of file ElemUtil.cpp.

83  {
84  double f( 0.0 );
85  for( unsigned i = 0; i < 8; ++i )
86  {
87  const double N_i =
88  ( 1 + xi[0] * corner_xi[i][0] ) * ( 1 + xi[1] * corner_xi[i][1] ) * ( 1 + xi[2] * corner_xi[i][2] );
89  f += N_i * f_vals[i];
90  }
91  f *= 0.125;
92  return f;
93  }

References corner_xi.

Referenced by moab::ElemUtil::integrate_trilinear_hex().

◆ jacobian()

Matrix3 moab::ElemUtil::LinearHexMap::jacobian ( const CartVect xi) const
virtual

Evaluate Jacobian of mapping function.

Implements moab::ElemUtil::VolMap.

Definition at line 95 of file ElemUtil.cpp.

96  {
97  Matrix3 J( 0.0 );
98  for( unsigned i = 0; i < 8; ++i )
99  {
100  const double xi_p = 1 + xi[0] * corner_xi[i][0];
101  const double eta_p = 1 + xi[1] * corner_xi[i][1];
102  const double zeta_p = 1 + xi[2] * corner_xi[i][2];
103  const double dNi_dxi = corner_xi[i][0] * eta_p * zeta_p;
104  const double dNi_deta = corner_xi[i][1] * xi_p * zeta_p;
105  const double dNi_dzeta = corner_xi[i][2] * xi_p * eta_p;
106  J( 0, 0 ) += dNi_dxi * corners[i][0];
107  J( 1, 0 ) += dNi_dxi * corners[i][1];
108  J( 2, 0 ) += dNi_dxi * corners[i][2];
109  J( 0, 1 ) += dNi_deta * corners[i][0];
110  J( 1, 1 ) += dNi_deta * corners[i][1];
111  J( 2, 1 ) += dNi_deta * corners[i][2];
112  J( 0, 2 ) += dNi_dzeta * corners[i][0];
113  J( 1, 2 ) += dNi_dzeta * corners[i][1];
114  J( 2, 2 ) += dNi_dzeta * corners[i][2];
115  }
116  return J *= 0.125;
117  }

References corner_xi, and corners.

Referenced by moab::ElemUtil::integrate_trilinear_hex().

Member Data Documentation

◆ corner_xi

const double moab::ElemUtil::LinearHexMap::corner_xi
staticprivate
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 } }

Definition at line 59 of file ElemUtil.cpp.

Referenced by evaluate(), evaluate_scalar_field(), and jacobian().

◆ corners

const CartVect* moab::ElemUtil::LinearHexMap::corners
private

Definition at line 58 of file ElemUtil.cpp.

Referenced by evaluate(), and jacobian().


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