MOAB: Mesh Oriented datABase  (version 5.2.1)
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)\) )
virtual bool inside_nat_space (const CartVect &xi, double &tol) const
 decide if within the natural param space, with a tolerance
virtual Matrix3 jacobian (const CartVect &xi) const
 Evaluate the map's Jacobi matrix.
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.
virtual double integrate_scalar_field (const double *field_vertex_values) const
 Integrate a scalar field over the element given field values at the vertices.

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

Detailed Description

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

Definition at line 169 of file ElemUtil.hpp.


Constructor & Destructor Documentation

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

Definition at line 172 of file ElemUtil.hpp.

: Map( vertices ){};

Definition at line 799 of file ElemUtil.cpp.

: Map( 0 ) {}

Definition at line 801 of file ElemUtil.cpp.

{}

Member Function Documentation

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 831 of file ElemUtil.cpp.

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

    {

        CartVect x( 0.0 );
        for( int i = 0; i < 27; i++ )
        {
            const double sh = SH( corner[i][0], xi[0] ) * SH( corner[i][1], xi[1] ) * SH( corner[i][2], xi[2] );
            x += sh * vertex[i];
        }

        return x;
    }
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 869 of file ElemUtil.cpp.

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

    {
        double x = 0.0;
        for( int i = 0; i < 27; i++ )
        {
            const double sh = SH( corner[i][0], xi[0] ) * SH( corner[i][1], xi[1] ) * SH( corner[i][2], xi[2] );
            x += sh * field_vertex_values[i];
        }

        return x;
    }
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 844 of file ElemUtil.cpp.

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

    {  // just look at the box+tol here
        return ( xi[0] >= -1. - tol ) && ( xi[0] <= 1. + tol ) && ( xi[1] >= -1. - tol ) && ( xi[1] <= 1. + tol ) &&
               ( xi[2] >= -1. - tol ) && ( xi[2] <= 1. + tol );
    }
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 880 of file ElemUtil.cpp.

    {
        return 0.;  // TODO: gaussian integration , probably 2x2x2
    }
Matrix3 moab::Element::QuadraticHex::jacobian ( const CartVect xi) const [virtual]

Evaluate the map's Jacobi matrix.

Implements moab::Element::Map.

Definition at line 850 of file ElemUtil.cpp.

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

    {
        Matrix3 J( 0.0 );
        for( int i = 0; i < 27; i++ )
        {
            const double sh[3]  = { SH( corner[i][0], xi[0] ), SH( corner[i][1], xi[1] ), SH( corner[i][2], xi[2] ) };
            const double dsh[3] = { DSH( corner[i][0], xi[0] ), DSH( corner[i][1], xi[1] ),
                                    DSH( corner[i][2], xi[2] ) };

            for( int j = 0; j < 3; j++ )
            {
                J( j, 0 ) += dsh[0] * sh[1] * sh[2] * vertex[i][j];  // dxj/dr first column
                J( j, 1 ) += sh[0] * dsh[1] * sh[2] * vertex[i][j];  // dxj/ds
                J( j, 2 ) += sh[0] * sh[1] * dsh[2] * vertex[i][j];  // dxj/dt
            }
        }

        return J;
    }

Member Data Documentation

const int moab::Element::QuadraticHex::corner [static, protected]
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 186 of file ElemUtil.hpp.

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

const unsigned int moab::Element::QuadraticHex::corner_count = 27 [static, protected]

Definition at line 188 of file ElemUtil.hpp.

const double moab::Element::QuadraticHex::gauss[8][2] [static, protected]

Definition at line 187 of file ElemUtil.hpp.

const unsigned int moab::Element::QuadraticHex::gauss_count = 2 [static, protected]

Definition at line 189 of file ElemUtil.hpp.

List of all members.


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