moab
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:
moab::Element::Map

List of all members.

Public Member Functions

 LinearTet (const std::vector< CartVect > &vertices)
 LinearTet ()
virtual ~LinearTet ()
virtual CartVect evaluate (const CartVect &xi) const
 Evaluate the map on (calculate $ x = F($ )$ )
virtual CartVect ievaluate (const CartVect &x) const
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]

Detailed Description

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

Definition at line 169 of file ElemUtil.hpp.


Constructor & Destructor Documentation

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

Definition at line 171 of file ElemUtil.hpp.

Definition at line 752 of file ElemUtil.cpp.

                       : Map(0) {

  }// LinearTet::LinearTet()

Definition at line 757 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 180 of file ElemUtil.hpp.

{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 179 of file ElemUtil.hpp.

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

Evaluate the map on (calculate $ x = F($ )$ )

Implements moab::Element::Map.

Definition at line 175 of file ElemUtil.hpp.

{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 771 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()
virtual CartVect moab::Element::LinearTet::ievaluate ( const CartVect x) const [inline, virtual]

Definition at line 176 of file ElemUtil.hpp.

{return this->T_inverse*(x-this->vertex[0]);};
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 178 of file ElemUtil.hpp.

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

  {
    // 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 780 of file ElemUtil.cpp.

                                                                                  {
    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 177 of file ElemUtil.hpp.

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

                                                           {
    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 = (0.0 == this->det_T ? HUGE : 1.0/this->det_T);
  }// LinearTet::set_vertices()

Member Data Documentation

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

Definition at line 189 of file ElemUtil.hpp.

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

Definition at line 191 of file ElemUtil.hpp.

Definition at line 191 of file ElemUtil.hpp.

Definition at line 190 of file ElemUtil.hpp.

Definition at line 190 of file ElemUtil.hpp.


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