Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
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 >:

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

◆ Self

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

◆ Linear_tet_map() [1/2]

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.

19 : Tinv(), eh() {}

◆ Linear_tet_map() [2/2]

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.

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

Member Function Documentation

◆ evaluate_scalar_field()

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
inlineprivate

Definition at line 57 of file linear_tet_map.hpp.

58  {
59  double f0 = field_values[0];
60  double f = f0;
61  for( std::size_t i = 1; i < 5; ++i )
62  {
63  f += ( field_values[i] - f0 ) * p[i - 1];
64  }
65  return f;
66  }

◆ integrate_scalar_field()

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
inlineprivate

Definition at line 68 of file linear_tet_map.hpp.

69  {
70  double I( 0.0 );
71  for( unsigned int i = 0; i < 4; ++i )
72  {
73  I += field_values[i];
74  }
75  double det =
76  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],
77  v[3][1] - v[0][1], v[1][2] - v[0][2], v[2][2] - v[0][2], v[3][2] - v[0][2] )
78  .determinant();
79  I *= det / 24.0;
80  return I;
81  }

◆ is_contained()

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 
)
inlineprivate

Definition at line 43 of file linear_tet_map.hpp.

44  {
45  double sum = 0.0;
46  for( std::size_t i = 0; i < 3; ++i )
47  {
48  sum += result[i];
49  if( result[i] < -tol )
50  {
51  return false;
52  }
53  }
54  return sum < 1.0 + tol;
55  }

References moab::sum().

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

◆ operator()()

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.

29  {
30  // Remove the warning about unused parameter
31  if( NULL != &moab )
32  {
33  }
34 
35  set_tet( _eh, v );
36  // TODO: Make sure this is correct
37  Point result = Tinv * p;
38  return std::make_pair( is_contained( result, tol ), result );
39  }

References moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::is_contained(), moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::set_tet(), and moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Tinv.

◆ set_tet()

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 
)
inlineprivate

Definition at line 84 of file linear_tet_map.hpp.

85  {
86  if( eh != _eh )
87  {
88  eh = _eh;
89  Tinv = moab::Matrix::inverse( Matrix( v[1][0] - v[0][0], v[2][0] - v[0][0], v[3][0] - v[0][0],
90  v[1][1] - v[0][1], v[2][1] - v[0][1], v[3][1] - v[0][1],
91  v[1][2] - v[0][2], v[2][2] - v[0][2], v[3][2] - v[0][2] ) );
92  }
93  }

References moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::eh, moab::Matrix::inverse(), and moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Tinv.

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

Member Data Documentation

◆ eh

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

◆ Tinv

template<typename Entity_handle , typename Matrix >
Matrix moab::element_utility::Linear_tet_map< Entity_handle, Matrix >::Tinv
private

The documentation for this class was generated from the following file: