38 #ifndef ShapeQualityMetric_hpp
39 #define ShapeQualityMetric_hpp
42 #include "MsqError.hpp"
43 #include "QualityMetric.hpp"
44 #include "PatchData.hpp"
116 double term1=temp_vec[0]%temp_vec[0]+temp_vec[1]%temp_vec[1];
119 if ( pd.domain_set() ) {
120 pd.get_domain_normal_at_vertex(v_ind,
true,unit_surf_norm,err);
MSQ_ERRZERO(err);
127 double temp_var=unit_surf_norm%(temp_vec[0]*temp_vec[1]);
130 double delta=pd.get_barrier_delta(err);
MSQ_ERRZERO(err);
159 h = delta*delta/fabs(temp_var); }
168 MSQ_SETERR(err)(
"Barrier function is zero due to excessively large "
169 "negative area compared to delta. /n Try to untangle "
192 double term1=temp_vec[0]%temp_vec[0]+
193 temp_vec[1]%temp_vec[1]+
194 temp_vec[2]%temp_vec[2];
196 double term2=(temp_vec[0]*temp_vec[1])%
197 (temp_vec[0]*temp_vec[1])+
198 (temp_vec[1]*temp_vec[2])%
199 (temp_vec[1]*temp_vec[2])+
200 (temp_vec[2]*temp_vec[0])%
201 (temp_vec[2]*temp_vec[0]);
203 double temp_var=temp_vec[0]%(temp_vec[1]*temp_vec[2]);
206 double delta=pd.get_barrier_delta(err);
MSQ_ERRZERO(err);
236 h = delta*delta/fabs(temp_var); }
245 MSQ_SETERR(err)(
"Barrier function is zero due to excessively large "
246 "negative area compared to delta. /n Try to untangle "
251 fval=
sqrt(term1*term2)/(3*h);
264 #endif // ShapeQualityMetric_hpp
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.
double vertex_barrier_function(double det, double delta)
Escobar Barrier Function for Shape and Other Metrics.
Used to hold the error state and return it to the application.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
virtual ~ShapeQualityMetric()
virtual destructor ensures use of polymorphism during destruction
NVec< 3, double > Vector3D
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.
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
Parent class for the Shape Quality Metrics.