moab
moab::ElemUtil::LinearHexMap Class Reference

Shape function for trilinear hexahedron. More...

Inheritance diagram for moab::ElemUtil::LinearHexMap:
moab::ElemUtil::VolMap

List of all members.

Public Member Functions

 LinearHexMap (const CartVect *corner_coords)
virtual CartVect center_xi () const
 Return $ $ corresponding to logical center of element.
virtual CartVect evaluate (const CartVect &xi) const
 Evaluate mapping function (calculate $ x = F($ )$ )
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.

Private Attributes

const CartVectcorners

Static Private Attributes

static const double corner_xi [8][3]

Detailed Description

Shape function for trilinear hexahedron.

Definition at line 45 of file ElemUtil.cpp.


Constructor & Destructor Documentation

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

Definition at line 47 of file ElemUtil.cpp.

: corners(corner_coords) {}

Member Function Documentation

Return $ $ corresponding to logical center of element.

Implements moab::ElemUtil::VolMap.

Definition at line 65 of file ElemUtil.cpp.

  { return CartVect(0.0); }
CartVect moab::ElemUtil::LinearHexMap::evaluate ( const CartVect xi) const [virtual]

Evaluate mapping function (calculate $ x = F($ )$ )

Implements moab::ElemUtil::VolMap.

Definition at line 68 of file ElemUtil.cpp.

{
  CartVect x(0.0);
  for (unsigned i = 0; i < 8; ++i) {
    const double N_i = (1 + xi[0]*corner_xi[i][0])
                     * (1 + xi[1]*corner_xi[i][1])
                     * (1 + xi[2]*corner_xi[i][2]);
    x += N_i * corners[i];
  }
  x *= 0.125;
  return x;
}
double moab::ElemUtil::LinearHexMap::evaluate_scalar_field ( const CartVect xi,
const double *  f_vals 
) const [virtual]

Definition at line 81 of file ElemUtil.cpp.

{
  double f(0.0);
  for (unsigned i = 0; i < 8; ++i) {
    const double N_i = (1 + xi[0]*corner_xi[i][0])
                     * (1 + xi[1]*corner_xi[i][1])
                     * (1 + xi[2]*corner_xi[i][2]);
    f += N_i * f_vals[i];
  }
  f *= 0.125;
  return f;
}
Matrix3 moab::ElemUtil::LinearHexMap::jacobian ( const CartVect xi) const [virtual]

Evaluate Jacobian of mapping function.

Implements moab::ElemUtil::VolMap.

Definition at line 94 of file ElemUtil.cpp.

{
  Matrix3 J(0.0);
  for (unsigned i = 0; i < 8; ++i) {
    const double   xi_p = 1 + xi[0]*corner_xi[i][0];
    const double  eta_p = 1 + xi[1]*corner_xi[i][1];
    const double zeta_p = 1 + xi[2]*corner_xi[i][2];
    const double dNi_dxi   = corner_xi[i][0] * eta_p * zeta_p;
    const double dNi_deta  = corner_xi[i][1] *  xi_p * zeta_p;
    const double dNi_dzeta = corner_xi[i][2] *  xi_p *  eta_p;
    J(0,0) += dNi_dxi   * corners[i][0];
    J(1,0) += dNi_dxi   * corners[i][1];
    J(2,0) += dNi_dxi   * corners[i][2];
    J(0,1) += dNi_deta  * corners[i][0];
    J(1,1) += dNi_deta  * corners[i][1];
    J(2,1) += dNi_deta  * corners[i][2];
    J(0,2) += dNi_dzeta * corners[i][0];
    J(1,2) += dNi_dzeta * corners[i][1];
    J(2,2) += dNi_dzeta * corners[i][2];
  }
  return J *= 0.125;
}

Member Data Documentation

const double moab::ElemUtil::LinearHexMap::corner_xi [static, private]
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 54 of file ElemUtil.cpp.

Definition at line 53 of file ElemUtil.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines