MOAB: Mesh Oriented datABase  (version 5.4.1)
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.
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.
static ErrorCode normalFcn (const int ientDim, const int facet, const int nverts, const double *verts, double normal[])
 Evaluate the normal at a specified facet.
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.
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.
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.
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

static bool moab::QuadraticHex::compatible ( EntityType  tp,
int  numv,
EvalSet eset 
) [inline, static]

Definition at line 69 of file QuadraticHex.hpp.

References eval_set(), and MBHEX.

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

    {
        if( tp == MBHEX && numv == 27 )
        {
            eset = eval_set();
            return true;
        }
        else
            return false;
    }
double moab::QuadraticHex::DSH ( const int  i,
const double  params 
) [static, protected]

Definition at line 45 of file QuadraticHex.cpp.

Referenced by jacobianFcn().

{
    switch( i )
    {
        case -1:
            return params - 0.5;
        case 0:
            return -2 * params;
        case 1:
            return params + 0.5;
        default:
            return 0.;
    }
}
static EvalSet moab::QuadraticHex::eval_set ( ) [inline, static]

Definition at line 64 of file QuadraticHex.hpp.

Referenced by compatible(), and test_quadratic_hex().

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.

References corner, MB_SUCCESS, and SH().

{
    assert( params && field && num_tuples > 0 );
    std::fill( result, result + num_tuples, 0.0 );
    for( int i = 0; i < 27; i++ )
    {
        const double sh = SH( corner[i][0], params[0] ) * SH( corner[i][1], params[1] ) * SH( corner[i][2], params[2] );
        for( int j = 0; j < num_tuples; j++ )
            result[j] += sh * field[num_tuples * i + j];
    }

    return MB_SUCCESS;
}
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.

References moab::EvalSet::inside_function().

{
    return EvalSet::inside_function( params, ndim, tol );
}
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.

References MB_NOT_IMPLEMENTED.

{
    return MB_NOT_IMPLEMENTED;
}
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.

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

{
    assert( 27 == nverts && params && verts );
    if( 27 != nverts ) return MB_FAILURE;
    Matrix3* J = reinterpret_cast< Matrix3* >( result );
    for( int i = 0; i < 27; i++ )
    {
        const double sh[3]  = { SH( corner[i][0], params[0] ), SH( corner[i][1], params[1] ),
                               SH( corner[i][2], params[2] ) };
        const double dsh[3] = { DSH( corner[i][0], params[0] ), DSH( corner[i][1], params[1] ),
                                DSH( corner[i][2], params[2] ) };

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

    return MB_SUCCESS;
}
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.

References MB_NOT_IMPLEMENTED.

{
    return MB_NOT_IMPLEMENTED;
}
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.

References moab::EvalSet::evaluate_reverse().

{
    assert( posn && verts );
    return EvalSet::evaluate_reverse( eval, jacob, ins, posn, verts, nverts, ndim, iter_tol, inside_tol, work, params,
                                      is_inside );
}
double moab::QuadraticHex::SH ( const int  i,
const double  params 
) [static, protected]

Definition at line 31 of file QuadraticHex.cpp.

Referenced by evalFcn(), and jacobianFcn().

{
    switch( i )
    {
        case -1:
            return ( params * params - params ) / 2;
        case 0:
            return 1 - params * params;
        case 1:
            return ( params * params + params ) / 2;
        default:
            return 0.;
    }
}

Member Data Documentation

const int moab::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 85 of file QuadraticHex.hpp.

Referenced by evalFcn(), and jacobianFcn().

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

Definition at line 87 of file QuadraticHex.hpp.

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

Definition at line 86 of file QuadraticHex.hpp.

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

Definition at line 88 of file QuadraticHex.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