37 #include "Vector3D.hpp"
38 #include "QualityMetric.hpp"
39 #include "MsqVertex.hpp"
40 #include "PatchData.hpp"
41 #include "MsqMeshEntity.hpp"
43 #ifdef MSQ_USE_OLD_STD_HEADERS
51 using namespace Mesquite;
78 size_t num_elems, *v_to_e_array;
88 double* met_vals =
new double[num_elems];
90 vector<size_t> other_vertices;
91 other_vertices.reserve(4);
95 for(i=0;i<num_elems;++
i){
103 switch(other_vertices.size()){
121 MSQ_SETERR(err)(
"Incorrect number of vertices returned from "
125 total_val+=met_vals[
i];
128 other_vertices.clear();
133 total_val /= (double) num_elems;
138 for(i=0;i<num_elems;++
i){
139 met_vals[
i]/=total_val;
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
Used to hold the error state and return it to the application.
double compute_corner_area(PatchData &pd, size_t vert_1, size_t vert_2, size_t vert_3, MsqError &err)
Calculate the area of the triangle formed by the three vertices.
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
size_t get_vertex_index(MsqVertex *vertex)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
bool evaluate_vertex(PatchData &pd, MsqVertex *vert, double &fval, MsqError &err)
For the given vertex, vert, calculate the local size metric value.
void get_connected_vertices(msq_stdc::size_t vertex_index, msq_std::vector< msq_stdc::size_t > &vert_indices, MsqError &err)
Fills a vector<size_t> with vertices connected to the given vertex through the edges of this MsqMeshE...
double compute_corner_volume(PatchData &pd, size_t vert_1, size_t vert_2, size_t vert_3, size_t vert_4, MsqError &err)
Calculate the volume of the tetrahedron formed by the four vertices.
double average_metrics(const double metric_values[], const int &num_values, MsqError &err)
average_metrics takes an array of length num_values and averages the contents using averaging method ...
const MsqMeshEntity * get_element_array(MsqError &err) const
Returns a pointer to the start of the element array.
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
size_t * get_vertex_element_adjacencies(size_t vertex_index, size_t &array_len_out, MsqError &err)