Page MenuHomec4science

mesh_helper.hh
No OneTemporary

File Metadata

Created
Thu, Apr 17, 01:36

mesh_helper.hh

// external routines for quality measures
#include "tet_mesh_quality.hh"
#include "triangulation_quality.hh"
template <Uint DIM>
inline Real computeRadiusRatio(const Real * points, const int * element, Uint nb_points) {
Uint nb_elements = 1;
Real q_min= std::numeric_limits<Real>::max(), q_max=0;
int tri_order = DIM + 1; // it's weird, but this seems to be what it wants
Real q_ave, q_area, q_var; //garbage, throwaway
Real ratio = 0;
int offset = 0;
if (DIM == twoD) {
triangle_quality::q_measure(nb_points, points, tri_order, nb_elements,
element, &q_min, &q_max, &q_ave, &q_area,
&ratio, offset);
} else if (DIM == threeD) {
tetrahedron_quality::tet_mesh_quality1(nb_points, points, tri_order, nb_elements,
element, &q_min, &q_ave, &q_max, &q_var,
&ratio, offset);
} else {
std::stringstream error_stream;
error_stream << "computeRadiusRatio not implemented for DIM = " << DIM;
throw (error_stream.str());
}
return 1./ratio;
}

Event Timeline