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

Shape function space for trilinear hexahedron, obtained by a pushforward of the canonical linear (affine) functions. More...

#include <ElemUtil.hpp>

+ Inheritance diagram for moab::Element::QuadraticHex:
+ Collaboration diagram for moab::Element::QuadraticHex:

Public Member Functions

 QuadraticHex (const std::vector< CartVect > &vertices)
 
 QuadraticHex ()
 
virtual ~QuadraticHex ()
 
virtual CartVect evaluate (const CartVect &xi) const
 Evaluate the map on \(x_i\) (calculate \(\vec x = F($\vec \xi)\) ) More...
 
virtual bool inside_nat_space (const CartVect &xi, double &tol) const
 decide if within the natural param space, with a tolerance More...
 
virtual Matrix3 jacobian (const CartVect &xi) const
 Evaluate the map's Jacobi matrix. More...
 
virtual double evaluate_scalar_field (const CartVect &xi, const double *field_vertex_values) const
 Evaluate a scalar field at a point given field values at the vertices. More...
 
virtual double integrate_scalar_field (const double *field_vertex_values) const
 Integrate a scalar field over the element given field values at the vertices. More...
 
- Public Member Functions inherited from moab::Element::Map
 Map (const std::vector< CartVect > &v)
 Construct a Map defined by the given std::vector of vertices. More...
 
 Map (const unsigned int n)
 Construct a Map defined by n vertices. More...
 
virtual ~Map ()
 
virtual CartVect ievaluate (const CartVect &x, double tol=1e-6, const CartVect &x0=CartVect(0.0)) const
 Evaluate the inverse map (calculate \(\vec \xi = F^-1($\vec x)\) to given tolerance) More...
 
virtual Matrix3 ijacobian (const CartVect &xi) const
 Evaluate the inverse of the Jacobi matrix. More...
 
virtual double det_jacobian (const CartVect &xi) const
 Evaluate the determinate of the Jacobi matrix. More...
 
virtual double det_ijacobian (const CartVect &xi) const
 Evaluate the determinate of the inverse Jacobi matrix. More...
 
unsigned int size ()
 Size of the vertices vector. More...
 
const std::vector< CartVect > & get_vertices ()
 Retrieve vertices. More...
 
virtual void set_vertices (const std::vector< CartVect > &v)
 Set vertices.
More...
 
virtual bool inside_box (const CartVect &xi, double &tol) const
 

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 = 2
 

Additional Inherited Members

- Protected Attributes inherited from moab::Element::Map
std::vector< CartVectvertex
 

Detailed Description

Shape function space for trilinear hexahedron, obtained by a pushforward of the canonical linear (affine) functions.

Definition at line 172 of file ElemUtil.hpp.

Constructor & Destructor Documentation

◆ QuadraticHex() [1/2]

moab::Element::QuadraticHex::QuadraticHex ( const std::vector< CartVect > &  vertices)
inline

Definition at line 175 of file ElemUtil.hpp.

175 : Map( vertices ){};

◆ QuadraticHex() [2/2]

moab::Element::QuadraticHex::QuadraticHex ( )

Definition at line 804 of file ElemUtil.cpp.

804 : Map( 0 ) {}

◆ ~QuadraticHex()

moab::Element::QuadraticHex::~QuadraticHex ( )
virtual

Definition at line 806 of file ElemUtil.cpp.

806 {}

Member Function Documentation

◆ evaluate()

CartVect moab::Element::QuadraticHex::evaluate ( const CartVect xi) const
virtual

Evaluate the map on \(x_i\) (calculate \(\vec x = F($\vec \xi)\) )

Implements moab::Element::Map.

Definition at line 836 of file ElemUtil.cpp.

837  {
838 
839  CartVect x( 0.0 );
840  for( int i = 0; i < 27; i++ )
841  {
842  const double sh = SH( corner[i][0], xi[0] ) * SH( corner[i][1], xi[1] ) * SH( corner[i][2], xi[2] );
843  x += sh * vertex[i];
844  }
845 
846  return x;
847  }

References corner, and moab::Element::SH().

◆ evaluate_scalar_field()

double moab::Element::QuadraticHex::evaluate_scalar_field ( const CartVect xi,
const double *  field_vertex_values 
) const
virtual

Evaluate a scalar field at a point given field values at the vertices.

Implements moab::Element::Map.

Definition at line 874 of file ElemUtil.cpp.

875  {
876  double x = 0.0;
877  for( int i = 0; i < 27; i++ )
878  {
879  const double sh = SH( corner[i][0], xi[0] ) * SH( corner[i][1], xi[1] ) * SH( corner[i][2], xi[2] );
880  x += sh * field_vertex_values[i];
881  }
882 
883  return x;
884  }

References corner, and moab::Element::SH().

◆ inside_nat_space()

bool moab::Element::QuadraticHex::inside_nat_space ( const CartVect xi,
double &  tol 
) const
virtual

decide if within the natural param space, with a tolerance

Implements moab::Element::Map.

Definition at line 849 of file ElemUtil.cpp.

850  { // just look at the box+tol here
851  return ( xi[0] >= -1. - tol ) && ( xi[0] <= 1. + tol ) && ( xi[1] >= -1. - tol ) && ( xi[1] <= 1. + tol ) &&
852  ( xi[2] >= -1. - tol ) && ( xi[2] <= 1. + tol );
853  }

Referenced by moab::Coupler::nat_param().

◆ integrate_scalar_field()

double moab::Element::QuadraticHex::integrate_scalar_field ( const double *  field_vertex_values) const
virtual

Integrate a scalar field over the element given field values at the vertices.

Implements moab::Element::Map.

Definition at line 885 of file ElemUtil.cpp.

886  {
887  return 0.; // TODO: gaussian integration , probably 2x2x2
888  }

◆ jacobian()

Matrix3 moab::Element::QuadraticHex::jacobian ( const CartVect xi) const
virtual

Evaluate the map's Jacobi matrix.

Implements moab::Element::Map.

Definition at line 855 of file ElemUtil.cpp.

856  {
857  Matrix3 J( 0.0 );
858  for( int i = 0; i < 27; i++ )
859  {
860  const double sh[3] = { SH( corner[i][0], xi[0] ), SH( corner[i][1], xi[1] ), SH( corner[i][2], xi[2] ) };
861  const double dsh[3] = { DSH( corner[i][0], xi[0] ), DSH( corner[i][1], xi[1] ),
862  DSH( corner[i][2], xi[2] ) };
863 
864  for( int j = 0; j < 3; j++ )
865  {
866  J( j, 0 ) += dsh[0] * sh[1] * sh[2] * vertex[i][j]; // dxj/dr first column
867  J( j, 1 ) += sh[0] * dsh[1] * sh[2] * vertex[i][j]; // dxj/ds
868  J( j, 2 ) += sh[0] * sh[1] * dsh[2] * vertex[i][j]; // dxj/dt
869  }
870  }
871 
872  return J;
873  }

References corner, moab::Element::DSH(), and moab::Element::SH().

Member Data Documentation

◆ corner

const int moab::Element::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 189 of file ElemUtil.hpp.

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

◆ corner_count

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

Definition at line 191 of file ElemUtil.hpp.

◆ gauss

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

Definition at line 190 of file ElemUtil.hpp.

◆ gauss_count

const unsigned int moab::Element::QuadraticHex::gauss_count = 2
staticprotected

Definition at line 192 of file ElemUtil.hpp.


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