Computes the local size metric for a given vertex. More...
#include <LocalSizeQualityMetric.hpp>
Public Member Functions | |
LocalSizeQualityMetric () | |
virtual | ~LocalSizeQualityMetric () |
LocalSizeQualityMetric () | |
virtual | ~LocalSizeQualityMetric () |
Public Member Functions inherited from VolumeQualityMetric | |
virtual | ~VolumeQualityMetric () |
virtual | ~VolumeQualityMetric () |
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_element (PatchData &, MsqMeshEntity *, double &, MsqError &err) |
Evaluate the metric for an element. 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_element (PatchData &, MsqMeshEntity *, double &, MsqError &err) |
Evaluate the metric for an element. 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 | |
bool | evaluate_vertex (PatchData &pd, MsqVertex *vert, double &fval, MsqError &err) |
For the given vertex, vert, calculate the local size metric value. More... | |
bool | evaluate_vertex (PatchData &pd, MsqVertex *vert, double &fval, MsqError &err) |
For the given vertex, vert, calculate the local size metric value. More... | |
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 Member Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Computes the local size metric for a given vertex.
LocalSizeQualityMetric is a vertex based metric which computes the corner volume (or area) for the element corners attached to a given element. Then these volumes (or areas) are averaged together. The default averaging method is QualityMetric::RMS.
Definition at line 61 of file includeLinks/LocalSizeQualityMetric.hpp.
|
inline |
Definition at line 65 of file includeLinks/LocalSizeQualityMetric.hpp.
References QualityMetric::avgMethod, QualityMetric::feasible, QualityMetric::RMS, QualityMetric::set_metric_type(), QualityMetric::set_name(), and QualityMetric::VERTEX_BASED.
|
inlinevirtual |
Definition at line 74 of file includeLinks/LocalSizeQualityMetric.hpp.
|
inline |
Definition at line 65 of file src/QualityMetric/Volume/LocalSizeQualityMetric.hpp.
References QualityMetric::avgMethod, QualityMetric::feasible, QualityMetric::RMS, QualityMetric::set_metric_type(), QualityMetric::set_name(), and QualityMetric::VERTEX_BASED.
|
inlinevirtual |
Definition at line 74 of file src/QualityMetric/Volume/LocalSizeQualityMetric.hpp.
|
inlineprivate |
Calculate the area of the triangle formed by the three vertices.
Definition at line 97 of file includeLinks/LocalSizeQualityMetric.hpp.
References PatchData::get_vertex_array(), and Vector3D::length().
Referenced by LocalSizeQualityMetric::evaluate_vertex().
|
inlineprivate |
Calculate the area of the triangle formed by the three vertices.
|
inlineprivate |
Calculate the volume of the tetrahedron formed by the four vertices.
|
inlineprivate |
Calculate the volume of the tetrahedron formed by the four vertices.
Definition at line 111 of file includeLinks/LocalSizeQualityMetric.hpp.
References PatchData::get_vertex_array().
Referenced by LocalSizeQualityMetric::evaluate_vertex().
|
protectedvirtual |
For the given vertex, vert, calculate the local size metric value.
Reimplemented from QualityMetric.
|
protectedvirtual |
For the given vertex, vert, calculate the local size metric value.
For the given vertex, vert, with connected elements, e_i for i=1...K, the LocalSizeQualityMetric computes the corner volumes (or areas) of each e_i at the corner defined by vert. The corner volume is defined as the volume of the tet defined by the edges of an element which contain the common vertex, vert. That volume is then diveded by the average corner volume of all the element corners connected to this vertex. For vertices attached to pyramid elements, this metric is undefined.
Reimplemented from QualityMetric.
Definition at line 61 of file QualityMetric/Volume/LocalSizeQualityMetric.cpp.
References QualityMetric::average_metrics(), LocalSizeQualityMetric::compute_corner_area(), LocalSizeQualityMetric::compute_corner_volume(), MsqMeshEntity::get_connected_vertices(), PatchData::get_element_array(), PatchData::get_vertex_element_adjacencies(), PatchData::get_vertex_index(), i, MsqError::INTERNAL_ERROR, MSQ_ERRZERO, and MSQ_SETERR.