MOAB: Mesh Oriented datABase  (version 5.4.1)
moab::Element::LinearTet Class Reference

Shape function space for a linear tetrahedron, obtained by a pushforward of the canonical affine shape functions. More...

#include <ElemUtil.hpp>

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

Public Member Functions

 LinearTet (const std::vector< CartVect > &vertices)
 LinearTet ()
virtual ~LinearTet ()
virtual CartVect evaluate (const CartVect &xi) const
 Evaluate the map on \(x_i\) (calculate \(\vec x = F($\vec \xi)\) )
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)
virtual Matrix3 jacobian (const CartVect &) const
 Evaluate the map's Jacobi matrix.
virtual Matrix3 ijacobian (const CartVect &) const
 Evaluate the inverse of the Jacobi matrix.
virtual double det_jacobian (const CartVect &) const
 Evaluate the determinate of the Jacobi matrix.
virtual double det_ijacobian (const CartVect &) const
 Evaluate the determinate of the inverse 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.
virtual void set_vertices (const std::vector< CartVect > &v)
 Set vertices.
virtual bool inside_nat_space (const CartVect &xi, double &tol) const
 decide if within the natural param space, with a tolerance

Protected Attributes

Matrix3 T
Matrix3 T_inverse
double det_T
double det_T_inverse

Static Protected Attributes

static const double corner [4][3] = { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }

Detailed Description

Shape function space for a linear tetrahedron, obtained by a pushforward of the canonical affine shape functions.

Definition at line 197 of file ElemUtil.hpp.


Constructor & Destructor Documentation

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

Definition at line 200 of file ElemUtil.hpp.

References set_vertices().

                                                           : Map( vertices )
        {
            set_vertices( vertex );
        };

Definition at line 892 of file ElemUtil.cpp.

: Map( 0 ), det_T( 0.0 ), det_T_inverse( 0.0 ) {}  // LinearTet::LinearTet()

Definition at line 894 of file ElemUtil.cpp.

{}

Member Function Documentation

virtual double moab::Element::LinearTet::det_ijacobian ( const CartVect xi) const [inline, virtual]

Evaluate the determinate of the inverse Jacobi matrix.

Reimplemented from moab::Element::Map.

Definition at line 224 of file ElemUtil.hpp.

References det_T_inverse.

        {
            return this->det_T_inverse;
        };
virtual double moab::Element::LinearTet::det_jacobian ( const CartVect xi) const [inline, virtual]

Evaluate the determinate of the Jacobi matrix.

Reimplemented from moab::Element::Map.

Definition at line 220 of file ElemUtil.hpp.

References det_T.

        {
            return this->det_T;
        };
virtual CartVect moab::Element::LinearTet::evaluate ( const CartVect xi) const [inline, virtual]

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

Implements moab::Element::Map.

Definition at line 207 of file ElemUtil.hpp.

References T.

        {
            return this->vertex[0] + this->T * xi;
        };
double moab::Element::LinearTet::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 907 of file ElemUtil.cpp.

    {
        double f0 = field_vertex_value[0];
        double f  = f0;
        for( unsigned i = 1; i < 4; ++i )
        {
            f += ( field_vertex_value[i] - f0 ) * xi[i - 1];
        }
        return f;
    }  // LinearTet::evaluate_scalar_field()
CartVect moab::Element::LinearTet::ievaluate ( const CartVect x,
double  tol = 1e-6,
const CartVect x0 = CartVect( 0.0 ) 
) const [virtual]

Evaluate the inverse map (calculate \(\vec \xi = F^-1($\vec x)\) to given tolerance)

Reimplemented from moab::Element::Map.

Definition at line 918 of file ElemUtil.cpp.

References T_inverse.

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

    {
        return this->T_inverse * ( x - this->vertex[0] );
    }  // LinearTet::ievaluate
virtual Matrix3 moab::Element::LinearTet::ijacobian ( const CartVect xi) const [inline, virtual]

Evaluate the inverse of the Jacobi matrix.

Reimplemented from moab::Element::Map.

Definition at line 216 of file ElemUtil.hpp.

References T_inverse.

        {
            return this->T_inverse;
        };
bool moab::Element::LinearTet::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 933 of file ElemUtil.cpp.

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

    {
        // linear tet space is a tetra with vertices (0,0,0), (1,0,0), (0,1,0), (0, 0, 1)
        // first check if outside bigger box, then below the plane x+y+z=1
        return ( xi[0] >= -tol ) && ( xi[1] >= -tol ) && ( xi[2] >= -tol ) && ( xi[0] + xi[1] + xi[2] < 1.0 + tol );
    }
double moab::Element::LinearTet::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 923 of file ElemUtil.cpp.

References det_T.

    {
        double I( 0.0 );
        for( unsigned int i = 0; i < 4; ++i )
        {
            I += field_vertex_values[i];
        }
        I *= this->det_T / 24.0;
        return I;
    }  // LinearTet::integrate_scalar_field()
virtual Matrix3 moab::Element::LinearTet::jacobian ( const CartVect xi) const [inline, virtual]

Evaluate the map's Jacobi matrix.

Implements moab::Element::Map.

Definition at line 212 of file ElemUtil.hpp.

References T.

        {
            return this->T;
        };
void moab::Element::LinearTet::set_vertices ( const std::vector< CartVect > &  v) [virtual]

Set vertices.

Reimplemented from moab::Element::Map.

Definition at line 896 of file ElemUtil.cpp.

References det_T, det_T_inverse, moab::Matrix3::determinant(), moab::Matrix3::inverse(), T, and T_inverse.

Referenced by LinearTet().

    {
        this->Map::set_vertices( v );
        this->T =
            Matrix3( v[1][0] - v[0][0], v[2][0] - v[0][0], v[3][0] - v[0][0], v[1][1] - v[0][1], v[2][1] - v[0][1],
                     v[3][1] - v[0][1], v[1][2] - v[0][2], v[2][2] - v[0][2], v[3][2] - v[0][2] );
        this->T_inverse     = this->T.inverse();
        this->det_T         = this->T.determinant();
        this->det_T_inverse = ( this->det_T < 1e-12 ? std::numeric_limits< double >::max() : 1.0 / this->det_T );
    }  // LinearTet::set_vertices()

Member Data Documentation

const double moab::Element::LinearTet::corner = { { 0, 0, 0 }, { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } [static, protected]

Definition at line 238 of file ElemUtil.hpp.

double moab::Element::LinearTet::det_T [protected]

Definition at line 240 of file ElemUtil.hpp.

Referenced by det_jacobian(), integrate_scalar_field(), and set_vertices().

Definition at line 240 of file ElemUtil.hpp.

Referenced by det_ijacobian(), and set_vertices().

Definition at line 239 of file ElemUtil.hpp.

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

Definition at line 239 of file ElemUtil.hpp.

Referenced by ievaluate(), ijacobian(), and set_vertices().

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