35 #include "Vector3D.hpp"
37 #include "QualityMetric.hpp"
40 #ifdef MSQ_USE_OLD_STD_HEADERS
47 using namespace Mesquite;
79 size_t num_elems, *v_to_e_array;
89 double* met_vals =
new double[num_elems];
91 vector<size_t> other_vertices;
92 other_vertices.reserve(4);
99 for(i=0;i<num_elems;++
i){
105 switch(elems[v_to_e_array[i]].get_element_type()){
108 temp_vec[0]=vertices[other_vertices[0]]-vertices[this_vert];
109 temp_vec[2]=vertices[other_vertices[1]]-vertices[this_vert];
117 temp_vec[0]=vertices[other_vertices[0]]-vertices[this_vert];
118 temp_vec[1]=vertices[other_vertices[1]]-vertices[this_vert];
124 temp_vec[0]=vertices[other_vertices[0]]-vertices[this_vert];
125 temp_vec[3]=vertices[other_vertices[1]]-vertices[this_vert];
126 temp_vec[4]=vertices[other_vertices[2]]-vertices[this_vert];
129 temp_vec[2]=((3*temp_vec[4])-temp_vec[0]-temp_vec[3])/
136 temp_vec[0]=vertices[other_vertices[0]]-vertices[this_vert];
137 temp_vec[1]=vertices[other_vertices[1]]-vertices[this_vert];
138 temp_vec[2]=vertices[other_vertices[2]]-vertices[this_vert];
148 other_vertices.clear();
bool condition_number_3d(Vector3D temp_vec[], PatchData &pd, double &fval, MsqError &err)
Given the 3-d jacobian matrix, compute the condition number, fval.
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
Used to hold the error state and return it to the application.
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
static const double MSQ_SQRT_TWO
bool condition_number_2d(Vector3D temp_vec[], size_t v_ind, PatchData &pd, double &fval, MsqError &err)
Given the 2-d jacobian matrix, compute the condition number, fval.
size_t get_vertex_index(MsqVertex *vertex)
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...
bool evaluate_vertex(PatchData &pd, MsqVertex *vert, double &fval, MsqError &err)
evaluate using mesquite objects
const MsqVertex * get_vertex_array(MsqError &err) const
Returns a pointer to the start of the vertex array.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
static const double MSQ_SQRT_THREE_INV
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.
AveragingMethod avgMethod
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
VertexConditionNumberQualityMetric()
size_t * get_vertex_element_adjacencies(size_t vertex_index, size_t &array_len_out, MsqError &err)
void set_name(msq_std::string st)
Sets the name of this metric.
static const double MSQ_SQRT_THREE