38 #ifndef LocalSizeQualityMetric_hpp
39 #define LocalSizeQualityMetric_hpp
44 #include "Vector3D.hpp"
45 #include "PatchData.hpp"
46 #include "MsqMeshEntity.hpp"
61 class LocalSizeQualityMetric :
public VolumeQualityMetric
70 set_name(
"Local Size Quality Metric");
86 size_t vert_2,
size_t vert_3,
91 size_t vert_2,
size_t vert_3,
103 MsqVertex* verts = pd.get_vertex_array(err);
104 Vector3D vec_1=verts[vert_2]-verts[vert_1];
105 Vector3D vec_2=verts[vert_3]-verts[vert_1];
107 return (cross_vec.length()/2.0);
118 MsqVertex* verts = pd.get_vertex_array(err);
119 Vector3D vec_1=verts[vert_2]-verts[vert_1];
120 Vector3D vec_2=verts[vert_3]-verts[vert_1];
121 Vector3D vec_3=verts[vert_4]-verts[vert_1];
122 return fabs((vec_3%(vec_1*vec_2))/6.0);
130 #endif // LocalSizeQualityMetric_hpp
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.
virtual ~LocalSizeQualityMetric()
NVec< 3, double > Vector3D
bool evaluate_vertex(PatchData &pd, MsqVertex *vert, double &fval, MsqError &err)
For the given vertex, vert, calculate the local size metric value.
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.
void set_metric_type(MetricType t)
This function should be used in the constructor of every concrete quality metric. ...
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.