38 #ifndef ShapeQualityMetric_hpp
39 #define ShapeQualityMetric_hpp
116 double term1=temp_vec[0]%temp_vec[0]+temp_vec[1]%temp_vec[1];
127 double temp_var=unit_surf_norm%(temp_vec[0]*temp_vec[1]);
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]);
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.
Base class for concrete quality metrics.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
virtual ~ShapeQualityMetric()
virtual destructor ensures use of polymorphism during destruction
double get_barrier_delta(MsqError &err)
Returns delta based on the minimum and maximum corner determinant over all elements in the patch This...
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.
void get_domain_normal_at_vertex(size_t vertex_index, bool normalize, Vector3D &surf_norm, MsqError &err)