36 #include "Vector3D.hpp"
37 #include "QualityMetric.hpp"
38 #include "MsqMeshEntity.hpp"
40 #ifdef MSQ_USE_OLD_STD_HEADERS
47 using namespace Mesquite;
82 temp_vec[0]=vertices[v_i[1]]-vertices[v_i[0]];
83 temp_vec[2]=vertices[v_i[2]]-vertices[v_i[0]];
89 temp_vec[0]=vertices[v_i[1]]-vertices[v_i[0]];
90 temp_vec[1]=vertices[v_i[3]]-vertices[v_i[0]];
93 temp_vec[0]=vertices[v_i[2]]-vertices[v_i[1]];
94 temp_vec[1]=vertices[v_i[0]]-vertices[v_i[1]];
97 temp_vec[0]=vertices[v_i[3]]-vertices[v_i[2]];
98 temp_vec[1]=vertices[v_i[1]]-vertices[v_i[2]];
101 temp_vec[0]=vertices[v_i[0]]-vertices[v_i[3]];
102 temp_vec[1]=vertices[v_i[2]]-vertices[v_i[3]];
107 temp_vec[0]=vertices[v_i[1]]-vertices[v_i[0]];
108 temp_vec[3]=vertices[v_i[2]]-vertices[v_i[0]];
109 temp_vec[4]=vertices[v_i[3]]-vertices[v_i[0]];
112 temp_vec[2]=((3*temp_vec[4])-temp_vec[0]-temp_vec[3])/
118 temp_vec[0]=vertices[v_i[1]]-vertices[v_i[0]];
119 temp_vec[1]=vertices[v_i[3]]-vertices[v_i[0]];
120 temp_vec[2]=vertices[v_i[4]]-vertices[v_i[0]];
123 temp_vec[0]=vertices[v_i[2]]-vertices[v_i[1]];
124 temp_vec[1]=vertices[v_i[0]]-vertices[v_i[1]];
125 temp_vec[2]=vertices[v_i[5]]-vertices[v_i[1]];
128 temp_vec[0]=vertices[v_i[3]]-vertices[v_i[2]];
129 temp_vec[1]=vertices[v_i[1]]-vertices[v_i[2]];
130 temp_vec[2]=vertices[v_i[6]]-vertices[v_i[2]];
133 temp_vec[0]=vertices[v_i[0]]-vertices[v_i[3]];
134 temp_vec[1]=vertices[v_i[2]]-vertices[v_i[3]];
135 temp_vec[2]=vertices[v_i[7]]-vertices[v_i[3]];
138 temp_vec[0]=vertices[v_i[7]]-vertices[v_i[4]];
139 temp_vec[1]=vertices[v_i[5]]-vertices[v_i[4]];
140 temp_vec[2]=vertices[v_i[0]]-vertices[v_i[4]];
143 temp_vec[0]=vertices[v_i[4]]-vertices[v_i[5]];
144 temp_vec[1]=vertices[v_i[6]]-vertices[v_i[5]];
145 temp_vec[2]=vertices[v_i[1]]-vertices[v_i[5]];
148 temp_vec[0]=vertices[v_i[5]]-vertices[v_i[6]];
149 temp_vec[1]=vertices[v_i[7]]-vertices[v_i[6]];
150 temp_vec[2]=vertices[v_i[2]]-vertices[v_i[6]];
153 temp_vec[0]=vertices[v_i[6]]-vertices[v_i[7]];
154 temp_vec[1]=vertices[v_i[4]]-vertices[v_i[7]];
155 temp_vec[2]=vertices[v_i[3]]-vertices[v_i[7]];
160 MSQ_SETERR(err)(
"Element of incorrect type sent to "
161 "UntangleBetaQualityMetric",
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
Used to hold the error state and return it to the application.
void untangle_function_3d(Vector3D temp_vec[], double &fval, MsqError &err)
requested functionality is not (yet) implemented
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...
const int MSQ_MAX_NUM_VERT_PER_ENT
UntangleBetaQualityMetric(double bet=0.05)
For untangle beta, the constructor defaults to the SUM averaging method, and to the ELEMENT_VERTICES ...
static const double MSQ_SQRT_TWO
void set_element_evaluation_mode(ElementEvaluationMode mode, MsqError &err)
Sets the evaluation mode for the ELEMENT_BASED metrics.
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
size_t get_element_index(MsqMeshEntity *element)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
void untangle_function_2d(Vector3D temp_vec[], size_t e_ind, PatchData &pd, double &fval, MsqError &err)
const MsqVertex * get_vertex_array(MsqError &err) const
Returns a pointer to the start of the vertex array.
EntityTopology get_element_type() const
Returns element type.
void set_gradient_type(GRADIENT_TYPE grad)
Sets gradType for this metric.
const msq_stdc::size_t * get_vertex_index_array() const
Very efficient retrieval of vertices indexes (corresponding to the PatchData vertex array)...
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
bool evaluate_element(PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
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 ...
AveragingMethod avgMethod
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
void set_name(msq_std::string st)
Sets the name of this metric.
static const double MSQ_SQRT_THREE