MOAB: Mesh Oriented datABase  (version 5.4.1)
moab::element_utility::Linear_tet_map< Entity_handle, Matrix > Class Template Reference

#include <linear_tet_map.hpp>

+ Inheritance diagram for moab::element_utility::Linear_tet_map< Entity_handle, Matrix >:
+ Collaboration diagram for moab::element_utility::Linear_tet_map< Entity_handle, Matrix >:

Public Member Functions

 Linear_tet_map ()
 Linear_tet_map (const Self &f)
template<typename Moab , typename Points , typename Point >
std::pair< bool, Point > operator() (const Moab &moab, const Entity_handle _eh, const Points &v, const Point &p, const double tol=1e-6)

Private Types

typedef Linear_tet_map
< Entity_handle, Matrix > 
Self

Private Member Functions

template<typename Point >
bool is_contained (const Point &result, const double tol=1e-6)
template<typename Point , typename Field >
double evaluate_scalar_field (const Point &p, const Field &field_values) const
template<typename Points , typename Field >
double integrate_scalar_field (const Points &v, const Field &field_values) const
template<typename Points >
void set_tet (const Entity_handle _eh, const Points &v)

Private Attributes

Matrix Tinv
Entity_handle eh

Detailed Description

template<typename Entity_handle, typename Matrix>
class moab::element_utility::Linear_tet_map< Entity_handle, Matrix >

Definition at line 12 of file linear_tet_map.hpp.


Member Typedef Documentation

template<typename Entity_handle, typename Matrix>
typedef Linear_tet_map< Entity_handle, Matrix > moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Self [private]

Definition at line 15 of file linear_tet_map.hpp.


Constructor & Destructor Documentation

template<typename Entity_handle, typename Matrix>
moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Linear_tet_map ( ) [inline]

Definition at line 19 of file linear_tet_map.hpp.

: Tinv(), eh() {}
template<typename Entity_handle, typename Matrix>
moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Linear_tet_map ( const Self f) [inline]

Definition at line 21 of file linear_tet_map.hpp.

: Tinv( f.Tinv ), eh( f.eh ) {}

Member Function Documentation

template<typename Entity_handle, typename Matrix>
template<typename Point , typename Field >
double moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::evaluate_scalar_field ( const Point &  p,
const Field &  field_values 
) const [inline, private]

Definition at line 57 of file linear_tet_map.hpp.

        {
            double f0 = field_values[0];
            double f  = f0;
            for( std::size_t i = 1; i < 5; ++i )
            {
                f += ( field_values[i] - f0 ) * p[i - 1];
            }
            return f;
        }
template<typename Entity_handle, typename Matrix>
template<typename Points , typename Field >
double moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::integrate_scalar_field ( const Points v,
const Field &  field_values 
) const [inline, private]

Definition at line 68 of file linear_tet_map.hpp.

        {
            double I( 0.0 );
            for( unsigned int i = 0; i < 4; ++i )
            {
                I += field_values[i];
            }
            double det =
                Matrix( 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] )
                    .determinant();
            I *= det / 24.0;
            return I;
        }
template<typename Entity_handle, typename Matrix>
template<typename Point >
bool moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::is_contained ( const Point &  result,
const double  tol = 1e-6 
) [inline, private]

Definition at line 43 of file linear_tet_map.hpp.

Referenced by moab::element_utility::Linear_tet_map< Entity_handle, moab::Matrix3 >::operator()().

        {
            double sum = 0.0;
            for( std::size_t i = 0; i < 3; ++i )
            {
                sum += result[i];
                if( result[i] < -tol )
                {
                    return false;
                }
            }
            return sum < 1.0 + tol;
        }
template<typename Entity_handle, typename Matrix>
template<typename Moab , typename Points , typename Point >
std::pair< bool, Point > moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::operator() ( const Moab &  moab,
const Entity_handle  _eh,
const Points v,
const Point &  p,
const double  tol = 1e-6 
) [inline]

Definition at line 24 of file linear_tet_map.hpp.

        {
            // Remove the warning about unused parameter
            if( NULL != &moab )
            {
            }

            set_tet( _eh, v );
            // TODO: Make sure this is correct
            Point result = Tinv * p;
            return std::make_pair( is_contained( result, tol ), result );
        }
template<typename Entity_handle, typename Matrix>
template<typename Points >
void moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::set_tet ( const Entity_handle  _eh,
const Points v 
) [inline, private]

Definition at line 84 of file linear_tet_map.hpp.

Referenced by moab::element_utility::Linear_tet_map< Entity_handle, moab::Matrix3 >::operator()().

        {
            if( eh != _eh )
            {
                eh   = _eh;
                Tinv = moab::Matrix::inverse( Matrix( 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] ) );
            }
        }

Member Data Documentation

template<typename Entity_handle, typename Matrix>
Entity_handle moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::eh [private]

List of all members.


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