1 #ifndef MOAB_LINEAR_HEX_HPP
2 #define MOAB_LINEAR_HEX_HPP
13 namespace element_utility
26 template <
typename Moab,
typename Entity_handle,
typename Po
ints,
typename Po
int >
28 const double* eval_point,
29 const double tol = 1.e-6 )
const
34 return std::make_pair( point_found, params );
52 return ( params[0] >= -1. - tol ) && ( params[0] <= 1. + tol ) && ( params[1] >= -1. - tol ) &&
53 ( params[1] <= 1. + tol ) && ( params[2] >= -1. - tol ) && ( params[2] <= 1. + tol );
59 const double tol = 1.e-6 )
const
61 const double error_tol_sqr = tol * tol;
66 std::size_t num_iterations = 0;
67 #ifdef LINEAR_HEX_DEBUG
70 ss << point[0] <<
", " << point[1] <<
", " << point[2] << std::endl;
72 for(
int i = 0; i < 8; ++i )
73 ss << points[i][0] <<
", " << points[i][1] <<
", " << points[i][2] << std::endl;
78 #ifdef LINEAR_HEX_DEBUG
79 ss <<
"Iter #: " << num_iterations <<
" Err: " << delta.
length() <<
" Iterate: ";
80 ss << params[0] <<
", " << params[1] <<
", " << params[2] << std::endl;
82 if( ++num_iterations >= 5 )
88 double det = moab::Matrix3::determinant3( J );
89 if( fabs( det ) < 1.e-10 )
91 #ifdef LINEAR_HEX_DEBUG
92 std::cerr << ss.str();
94 #ifndef LINEAR_HEX_DEBUG
95 std::cerr << x[0] <<
", " << x[1] <<
", " << x[2] << std::endl;
97 std::cerr <<
"inverse solve failure: det: " << det << std::endl;
109 typedef typename Points::value_type Vector;
110 f.set( 0.0, 0.0, 0.0 );
111 for(
unsigned i = 0; i < 8; ++i )
123 template <
typename Po
int,
typename Po
ints >