The untangle beta quality metric. More...
#include <UntangleBetaQualityMetric.hpp>
Public Member Functions | |
UntangleBetaQualityMetric (double bet=0.05) | |
For untangle beta, the constructor defaults to the SUM averaging method, and to the ELEMENT_VERTICES evaluation mode. More... | |
virtual | ~UntangleBetaQualityMetric () |
bool | evaluate_element (PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err) |
void | set_beta (double beta_in) |
double | get_beta () |
UntangleBetaQualityMetric (double bet=0.05) | |
virtual | ~UntangleBetaQualityMetric () |
bool | evaluate_element (PatchData &pd, MsqMeshEntity *element, double &fval, MsqError &err) |
void | set_beta (double beta_in) |
double | get_beta () |
Public Member Functions inherited from UntangleQualityMetric | |
virtual | ~UntangleQualityMetric () |
virtual | ~UntangleQualityMetric () |
Public Member Functions inherited from QualityMetric | |
virtual | ~QualityMetric () |
MetricType | get_metric_type () |
void | set_element_evaluation_mode (ElementEvaluationMode mode, MsqError &err) |
Sets the evaluation mode for the ELEMENT_BASED metrics. More... | |
ElementEvaluationMode | get_element_evaluation_mode () |
Returns the evaluation mode for the metric. More... | |
void | set_averaging_method (AveragingMethod method, MsqError &err) |
void | set_feasible_constraint (int alpha) |
int | get_feasible_constraint () |
Returns the feasible flag for this metric. More... | |
void | set_name (msq_std::string st) |
Sets the name of this metric. More... | |
msq_std::string | get_name () |
Returns the name of this metric (as a string). More... | |
double | vertex_barrier_function (double det, double delta) |
Escobar Barrier Function for Shape and Other Metrics. More... | |
virtual bool | evaluate_vertex (PatchData &, MsqVertex *, double &, MsqError &err) |
Evaluate the metric for a vertex. More... | |
void | set_gradient_type (GRADIENT_TYPE grad) |
Sets gradType for this metric. More... | |
void | set_hessian_type (HESSIAN_TYPE ht) |
Sets hessianType for this metric. More... | |
bool | compute_vertex_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
Calls compute_vertex_numerical_gradient if gradType equals NUMERCIAL_GRADIENT. Calls compute_vertex_analytical_gradient if gradType equals ANALYTICAL_GRADIENT;. More... | |
bool | compute_element_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_gradient() or compute_element_analytical_gradient() for gradType equal NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT, respectively. More... | |
bool | compute_element_gradient_expanded (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
bool | compute_element_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_hessian() or compute_element_analytical_hessian() for hessianType equal NUMERICAL_HESSIAN or ANALYTICAL_HESSIAN, respectively. More... | |
void | set_negate_flag (int neg) |
int | get_negate_flag () |
Returns negateFlag. More... | |
virtual void | change_metric_type (MetricType t, MsqError &err) |
virtual | ~QualityMetric () |
MetricType | get_metric_type () |
void | set_element_evaluation_mode (ElementEvaluationMode mode, MsqError &err) |
Sets the evaluation mode for the ELEMENT_BASED metrics. More... | |
ElementEvaluationMode | get_element_evaluation_mode () |
Returns the evaluation mode for the metric. More... | |
void | set_averaging_method (AveragingMethod method, MsqError &err) |
void | set_feasible_constraint (int alpha) |
int | get_feasible_constraint () |
Returns the feasible flag for this metric. More... | |
void | set_name (msq_std::string st) |
Sets the name of this metric. More... | |
msq_std::string | get_name () |
Returns the name of this metric (as a string). More... | |
double | vertex_barrier_function (double det, double delta) |
Escobar Barrier Function for Shape and Other Metrics. More... | |
virtual bool | evaluate_vertex (PatchData &, MsqVertex *, double &, MsqError &err) |
Evaluate the metric for a vertex. More... | |
void | set_gradient_type (GRADIENT_TYPE grad) |
Sets gradType for this metric. More... | |
void | set_hessian_type (HESSIAN_TYPE ht) |
Sets hessianType for this metric. More... | |
bool | compute_vertex_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
bool | compute_element_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_gradient() or compute_element_analytical_gradient() for gradType equal NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT, respectively. More... | |
bool | compute_element_gradient_expanded (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
bool | compute_element_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
For MetricType == ELEMENT_BASED. Calls either compute_element_numerical_hessian() or compute_element_analytical_hessian() for hessianType equal NUMERICAL_HESSIAN or ANALYTICAL_HESSIAN, respectively. More... | |
void | set_negate_flag (int neg) |
int | get_negate_flag () |
Returns negateFlag. More... | |
virtual void | change_metric_type (MetricType t, MsqError &err) |
Protected Member Functions | |
void | untangle_function_2d (Vector3D temp_vec[], size_t e_ind, PatchData &pd, double &fval, MsqError &err) |
void | untangle_function_3d (Vector3D temp_vec[], double &fval, MsqError &err) |
void | untangle_function_2d (Vector3D temp_vec[], size_t e_ind, PatchData &pd, double &fval, MsqError &err) |
void | untangle_function_3d (Vector3D temp_vec[], double &fval, MsqError &err) |
Protected Member Functions inherited from QualityMetric | |
QualityMetric () | |
void | set_metric_type (MetricType t) |
This function should be used in the constructor of every concrete quality metric. More... | |
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 data member avgMethod . More... | |
double | average_metric_and_weights (double metric_values[], int num_metric_values, MsqError &err) |
Given a list of metric values, calculate the average metric valude according to the current avgMethod and write into the passed metric_values array the the value weight/count to use when averaging gradient vectors for the metric. More... | |
double | weighted_average_metrics (const double coef[], const double metric_values[], const int &num_values, MsqError &err) |
takes an array of coefficients and an array of metrics (both of length num_value) and averages the contents using averaging method 'method'. More... | |
bool | compute_vertex_numerical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
bool | compute_element_numerical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
Non-virtual function which numerically computes the gradient of a QualityMetric of a given element for a given set of free vertices on that element. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More... | |
virtual bool | compute_vertex_analytical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is VERTEX_BASED. More... | |
virtual bool | compute_element_analytical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More... | |
bool | compute_element_numerical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
virtual bool | compute_element_analytical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
QualityMetric () | |
void | set_metric_type (MetricType t) |
This function should be used in the constructor of every concrete quality metric. More... | |
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 data member avgMethod . More... | |
double | average_metric_and_weights (double metric_values[], int num_metric_values, MsqError &err) |
Given a list of metric values, calculate the average metric valude according to the current avgMethod and write into the passed metric_values array the the value weight/count to use when averaging gradient vectors for the metric. More... | |
double | weighted_average_metrics (const double coef[], const double metric_values[], const int &num_values, MsqError &err) |
takes an array of coefficients and an array of metrics (both of length num_value) and averages the contents using averaging method 'method'. More... | |
bool | compute_vertex_numerical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
bool | compute_element_numerical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
Non-virtual function which numerically computes the gradient of a QualityMetric of a given element for a given set of free vertices on that element. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More... | |
virtual bool | compute_vertex_analytical_gradient (PatchData &pd, MsqVertex &vertex, MsqVertex *vertices[], Vector3D grad_vec[], int num_vtx, double &metric_value, MsqError &err) |
Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is VERTEX_BASED. More... | |
virtual bool | compute_element_analytical_gradient (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], int num_free_vtx, double &metric_value, MsqError &err) |
Virtual function that computes the gradient of the QualityMetric analytically. The base class implementation of this function simply prints a warning and calls compute_numerical_gradient to calculate the gradient. This is used by metric which mType is ELEMENT_BASED. For parameters, see compute_element_gradient() . More... | |
bool | compute_element_numerical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
virtual bool | compute_element_analytical_hessian (PatchData &pd, MsqMeshEntity *element, MsqVertex *free_vtces[], Vector3D grad_vec[], Matrix3D hessian[], int num_free_vtx, double &metric_value, MsqError &err) |
Private Attributes | |
double | mBeta |
The untangle beta quality metric.
Given a scalar value beta and local signed element volume alpha_i, define delta_i to be alpha_i minus beta. The Untangle beta value is then defined as square root of the sum over sample points of the absolute value of delta_i minus delta_i, difference squared. That is, the root mean square of the difference, abs(delta_i) minus delta_i.
The constructor defaults to RMS AveragingMethod and ELEMENT_VERTICES evaluationMode. The default beta value is .05.
Definition at line 60 of file includeLinks/UntangleBetaQualityMetric.hpp.
UntangleBetaQualityMetric | ( | double | bet = 0.05 | ) |
For untangle beta, the constructor defaults to the SUM averaging method, and to the ELEMENT_VERTICES evaluation mode.
Definition at line 53 of file QualityMetric/Untangle/UntangleBetaQualityMetric.cpp.
References QualityMetric::avgMethod, QualityMetric::ELEMENT_BASED, QualityMetric::ELEMENT_VERTICES, QualityMetric::feasible, UntangleBetaQualityMetric::mBeta, MSQ_CHKERR, QualityMetric::NUMERICAL_GRADIENT, QualityMetric::RMS, QualityMetric::set_element_evaluation_mode(), QualityMetric::set_gradient_type(), QualityMetric::set_metric_type(), and QualityMetric::set_name().
|
inlinevirtual |
Definition at line 67 of file includeLinks/UntangleBetaQualityMetric.hpp.
UntangleBetaQualityMetric | ( | double | bet = 0.05 | ) |
|
inlinevirtual |
Definition at line 67 of file src/QualityMetric/Untangle/UntangleBetaQualityMetric.hpp.
|
virtual |
Evaluate the Untangle Beta metric value for an element.
Evaluate the Untangle Beta value of the MsqMeshEntity pointed to by 'element'.
Reimplemented from QualityMetric.
Definition at line 67 of file QualityMetric/Untangle/UntangleBetaQualityMetric.cpp.
References QualityMetric::average_metrics(), PatchData::get_element_index(), MsqMeshEntity::get_element_type(), PatchData::get_vertex_array(), MsqMeshEntity::get_vertex_index_array(), Mesquite::HEXAHEDRON, MSQ_ERRZERO, Mesquite::MSQ_MAX_CAP, Mesquite::MSQ_MAX_NUM_VERT_PER_ENT, MSQ_SETERR, Mesquite::MSQ_SQRT_THREE, Mesquite::MSQ_SQRT_THREE_INV, Mesquite::MSQ_SQRT_TWO, MsqError::NOT_IMPLEMENTED, Mesquite::QUADRILATERAL, Mesquite::TETRAHEDRON, Mesquite::TRIANGLE, UntangleBetaQualityMetric::untangle_function_2d(), and UntangleBetaQualityMetric::untangle_function_3d().
|
virtual |
Evaluate the Untangle Beta metric value for an element.
Reimplemented from QualityMetric.
|
inline |
Function to allow the user to check the value of beta.
Definition at line 82 of file src/QualityMetric/Untangle/UntangleBetaQualityMetric.hpp.
References UntangleBetaQualityMetric::mBeta.
|
inline |
Function to allow the user to check the value of beta.
Definition at line 82 of file includeLinks/UntangleBetaQualityMetric.hpp.
References UntangleBetaQualityMetric::mBeta.
|
inline |
Function to allow users to set the beta value after the metric has already been created.
Definition at line 79 of file includeLinks/UntangleBetaQualityMetric.hpp.
References UntangleBetaQualityMetric::mBeta.
|
inline |
Function to allow users to set the beta value after the metric has already been created.
Definition at line 79 of file src/QualityMetric/Untangle/UntangleBetaQualityMetric.hpp.
References UntangleBetaQualityMetric::mBeta.
|
inlineprotected |
Definition at line 98 of file includeLinks/UntangleBetaQualityMetric.hpp.
References PatchData::get_domain_normal_at_element(), Vector3D::length(), UntangleBetaQualityMetric::mBeta, and MSQ_ERRRTN.
Referenced by UntangleBetaQualityMetric::evaluate_element().
|
inlineprotected |
Definition at line 118 of file includeLinks/UntangleBetaQualityMetric.hpp.
References UntangleBetaQualityMetric::mBeta.
Referenced by UntangleBetaQualityMetric::evaluate_element().
|
private |
Definition at line 94 of file includeLinks/UntangleBetaQualityMetric.hpp.
Referenced by UntangleBetaQualityMetric::get_beta(), UntangleBetaQualityMetric::set_beta(), UntangleBetaQualityMetric::untangle_function_2d(), UntangleBetaQualityMetric::untangle_function_3d(), and UntangleBetaQualityMetric::UntangleBetaQualityMetric().