38 #ifndef GeneralizedConditionNumberQualityMetric_hpp
39 #define GeneralizedConditionNumberQualityMetric_hpp
83 int num_jacobian_vectors,
92 int num_jacobian_vectors,
double &fval,
MsqError &err)
96 if(num_jacobian_vectors==2){
98 Vector3D cross_vec=jacobian_vectors[0]*jacobian_vectors[1];
102 if(cross_vec%norm_vec<0.0){
107 temp_var=fabs((cross_vec).
length());
108 fval=jacobian_vectors[0].length_squared();
109 fval+=jacobian_vectors[1].length_squared();
111 fval/=(2.0*temp_var);
120 else if(num_jacobian_vectors==3){
122 double term1=jacobian_vectors[0]%jacobian_vectors[0]+
123 jacobian_vectors[1]%jacobian_vectors[1]+
124 jacobian_vectors[2]%jacobian_vectors[2];
126 double term2=(jacobian_vectors[0]*jacobian_vectors[1])%
127 (jacobian_vectors[0]*jacobian_vectors[1])+
128 (jacobian_vectors[1]*jacobian_vectors[2])%
129 (jacobian_vectors[1]*jacobian_vectors[2])+
130 (jacobian_vectors[2]*jacobian_vectors[0])%
131 (jacobian_vectors[2]*jacobian_vectors[0]);
133 temp_var=jacobian_vectors[0]%(jacobian_vectors[1]*jacobian_vectors[2]);
138 fval=
sqrt(term1*term2);
158 #endif // GeneralizedConditionNumberQualityMetric_hpp
msq_stdc::size_t get_vertex_index(msq_stdc::size_t vertex_in_element) const
GeneralizedConditionNumberQualityMetric()
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
Computes the condition number of given element. The``condition number" is scaled between one and infi...
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...
double length(Vector3D *const v, int n)
bool evaluate_element(PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err)
evaluate using mesquite objects
void get_domain_normal_at_vertex(size_t vertex_index, bool normalize, Vector3D &surf_norm, MsqError &err)
bool evaluate_vertex(PatchData &pd, MsqVertex *vertex, double &fval, MsqError &err)
Evaluate the "condition number" for a vertex.
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
virtual ~GeneralizedConditionNumberQualityMetric()
virtual destructor ensures use of polymorphism during destruction
bool compute_condition_number(PatchData &pd, MsqMeshEntity *elem, Vector3D *jacobian_vectors, int num_jacobian_vectors, double &fval, MsqError &err)