A QualityAssessor instance can be inserted into an InstructionQueue to calculate and summarize registered QualityMetrics for the mesh. More...
#include <QualityAssessor.hpp>
Classes | |
class | Assessor |
Per-metric QualityAssessor data. More... | |
Public Types | |
enum | QAFunction { NO_FUNCTION = 0, AVERAGE =1, HISTOGRAM =2, MAXIMUM =4, MINIMUM =8, RMS =16, STDDEV =32, ALL_MEASURES =255, NO_FUNCTION = 0, AVERAGE =1, HISTOGRAM =2, MAXIMUM =4, MINIMUM =8, RMS =16, STDDEV =32, ALL_MEASURES =255 } |
enum | QAFunction { NO_FUNCTION = 0, AVERAGE =1, HISTOGRAM =2, MAXIMUM =4, MINIMUM =8, RMS =16, STDDEV =32, ALL_MEASURES =255, NO_FUNCTION = 0, AVERAGE =1, HISTOGRAM =2, MAXIMUM =4, MINIMUM =8, RMS =16, STDDEV =32, ALL_MEASURES =255 } |
Public Types inherited from PatchDataUser | |
enum | AlgorithmType { QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR, QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR } |
enum | AlgorithmType { QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR, QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR } |
Public Member Functions | |
QualityAssessor (msq_std::string name="QualityAssessor") | |
Constructor - output to std::cout. More... | |
QualityAssessor (msq_stdio::ostream &output_stream, msq_std::string name="QualityAssessor") | |
Constructor - specified output stream. More... | |
QualityAssessor (QualityMetric *metric, QAFunction function, msq_stdio::ostream &output_stream, MsqError &err, msq_std::string name="QualityAssessor") | |
Constructor - initial stopping assessement and specified output stream. More... | |
QualityAssessor (QualityMetric *metric, QAFunction function, MsqError &err, msq_std::string name="QualityAssessor") | |
Constructor - initial stopping assessement. More... | |
~QualityAssessor () | |
Destructor. More... | |
void | set_name (msq_std::string name) |
Provides a name to the QualityAssessor (use it for default name in constructor). More... | |
virtual msq_std::string | get_name () |
Retrieves the QualityAssessor name. A default name should be set in the constructor. More... | |
virtual AlgorithmType | get_algorithm_type () |
Return the algorithm type (to avoid RTTI use). More... | |
void | add_quality_assessment (QualityMetric *qm, int function_flags, MsqError &err) |
Adds a quality metric and a wrapper function (min, max, ...). More... | |
void | set_stopping_assessment (QualityMetric *qm, QAFunction func, MsqError &err) |
void | add_histogram_assessment (QualityMetric *qm, double min, double max, int intervals, MsqError &err) |
Add a quality metric for which the histogram is to be calculated, and set histogram parameters. More... | |
virtual double | loop_over_mesh (MeshSet &ms, MsqError &err) |
Does one sweep over the mesh and assess the quality with the metrics previously added. More... | |
void | disable_printing_results () |
Do not print results of assessment. More... | |
void | print_summary (msq_stdio::ostream &stream) const |
Print accumulated summary data to specified stream. More... | |
bool | invalid_elements () const |
True if any metric evaluated to an invalid value for any element. More... | |
void | reset_data () |
Reset calculated data. More... | |
const Assessor * | get_results (QualityMetric *metric) const |
Request summary data for a specific QualityMetric This method allows the application to request the summary data for a metric it has registered with the QualityAssessor. More... | |
const msq_std::list< Assessor > & | get_all_results () const |
Get list of all summary data. More... | |
QualityAssessor (msq_std::string name="QualityAssessor") | |
Constructor - output to std::cout. More... | |
QualityAssessor (msq_stdio::ostream &output_stream, msq_std::string name="QualityAssessor") | |
Constructor - specified output stream. More... | |
QualityAssessor (QualityMetric *metric, QAFunction function, msq_stdio::ostream &output_stream, MsqError &err, msq_std::string name="QualityAssessor") | |
Constructor - initial stopping assessement and specified output stream. More... | |
QualityAssessor (QualityMetric *metric, QAFunction function, MsqError &err, msq_std::string name="QualityAssessor") | |
Constructor - initial stopping assessement. More... | |
~QualityAssessor () | |
Destructor. More... | |
void | set_name (msq_std::string name) |
Provides a name to the QualityAssessor (use it for default name in constructor). More... | |
virtual msq_std::string | get_name () |
Retrieves the QualityAssessor name. A default name should be set in the constructor. More... | |
virtual AlgorithmType | get_algorithm_type () |
Return the algorithm type (to avoid RTTI use). More... | |
void | add_quality_assessment (QualityMetric *qm, int function_flags, MsqError &err) |
Adds a quality metric and a wrapper function (min, max, ...). More... | |
void | set_stopping_assessment (QualityMetric *qm, QAFunction func, MsqError &err) |
void | add_histogram_assessment (QualityMetric *qm, double min, double max, int intervals, MsqError &err) |
Add a quality metric for which the histogram is to be calculated, and set histogram parameters. More... | |
virtual double | loop_over_mesh (MeshSet &ms, MsqError &err) |
Does one sweep over the mesh and assess the quality with the metrics previously added. More... | |
void | disable_printing_results () |
Do not print results of assessment. More... | |
void | print_summary (msq_stdio::ostream &stream) const |
Print accumulated summary data to specified stream. More... | |
bool | invalid_elements () const |
True if any metric evaluated to an invalid value for any element. More... | |
void | reset_data () |
Reset calculated data. More... | |
const Assessor * | get_results (QualityMetric *metric) const |
Request summary data for a specific QualityMetric This method allows the application to request the summary data for a metric it has registered with the QualityAssessor. More... | |
const msq_std::list< Assessor > & | get_all_results () const |
Get list of all summary data. More... | |
Public Member Functions inherited from PatchDataUser | |
virtual | ~PatchDataUser () |
virtual void | set_patch_type (PatchData::PatchType patch_type, MsqError &err, int param1=0, int param2=0) |
Sets the Patch Type. More... | |
PatchData::PatchType | get_patch_type () |
Returns the Patch Type. More... | |
int | get_nb_layers (MsqError &err) |
Returns number of layers (if relevant for partition algorythm). More... | |
void | add_culling_method (enum PatchData::culling_method cm) |
Sets on the culling method passed as argument. More... | |
void | no_culling_method () |
Sets off all culling methods. More... | |
void | remove_culling_method (enum PatchData::culling_method cm) |
Sets off the culling method passed as argument. More... | |
long unsigned int | get_culling_method_bits () |
Returns the bitset containing culling methods flags. More... | |
void | set_all_parameters (PatchDataParameters ¶ms) |
PatchDataParameters & | get_all_parameters () |
Returns the PatchDataParameters object. More... | |
void | set_global_patch (PatchData *pd, MsqError &err) |
Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More... | |
PatchData * | get_global_patch () |
Returns the Global Patch. More... | |
void | no_global_patch () |
Sets the Global Patch pointer to NULL. More... | |
virtual | ~PatchDataUser () |
virtual void | set_patch_type (PatchData::PatchType patch_type, MsqError &err, int param1=0, int param2=0) |
Sets the Patch Type. More... | |
PatchData::PatchType | get_patch_type () |
Returns the Patch Type. More... | |
int | get_nb_layers (MsqError &err) |
Returns number of layers (if relevant for partition algorythm). More... | |
void | add_culling_method (enum PatchData::culling_method cm) |
Sets on the culling method passed as argument. More... | |
void | no_culling_method () |
Sets off all culling methods. More... | |
void | remove_culling_method (enum PatchData::culling_method cm) |
Sets off the culling method passed as argument. More... | |
long unsigned int | get_culling_method_bits () |
Returns the bitset containing culling methods flags. More... | |
void | set_all_parameters (PatchDataParameters ¶ms) |
PatchDataParameters & | get_all_parameters () |
Returns the PatchDataParameters object. More... | |
void | set_global_patch (PatchData *pd, MsqError &err) |
Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More... | |
PatchData * | get_global_patch () |
Returns the Global Patch. More... | |
void | no_global_patch () |
Sets the Global Patch pointer to NULL. More... | |
Static Public Member Functions | |
static msq_std::string | get_QAFunction_name (enum QualityAssessor::QAFunction) |
static msq_std::string | get_QAFunction_name (enum QualityAssessor::QAFunction) |
Private Member Functions | |
msq_std::list< Assessor >::iterator | find_or_add (QualityMetric *qm) |
Find an Assessor corresponding to the passed QualityMetric, or create it if is not found in the list. More... | |
msq_std::list< Assessor >::iterator | find_or_add (QualityMetric *qm) |
Find an Assessor corresponding to the passed QualityMetric, or create it if is not found in the list. More... | |
Private Attributes | |
msq_std::string | qualityAssessorName |
Name. More... | |
msq_std::list< Assessor > | assessList |
List of quality metrics and corresponding data. More... | |
msq_stdio::ostream & | outputStream |
Stream to which to write summary of metric data. More... | |
bool | printSummary |
Disable printing. More... | |
msq_std::list< Assessor >::iterator | stoppingMetric |
Metric in assessList to use as return value for loop_over_mesh. More... | |
QAFunction | stoppingFunction |
Value to use as return value for loop_over_mesh. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from PatchDataUser | |
PatchDataUser () | |
PatchDataUser () | |
A QualityAssessor instance can be inserted into an InstructionQueue to calculate and summarize registered QualityMetrics for the mesh.
The relevant quality assessments are set by the user or automatically (default) by Mesquite when an InstructionQueue object is used. If the mesh has been changed (improved), it is often useful to reuse the same QualityAssessor object to reassess the mesh quality.
The QAFunction flags passed for each metric control the output for that metric. If no QAFuction flags are passed, no results are printed for the metric except the count of invalid vertices/elements reported by that metric, if any.
The "stopping assessor" and "stopping function", if set, determinte the value reported to Mesquite for the overall run of of the QualityAssessor.
All summary data except the histogram is accumulated for all registered metrics, and can be accessed by the calling application. Histogram data is accumulated only if the HISTOGRAM QUFunction output is requested for the metric (which is impled by calling add_histogram_assessment.
Definition at line 97 of file includeLinks/QualityAssessor.hpp.
enum QAFunction |
type of function used in conjunction with QualityMetric to compute mesh quality
Enumerator | |
---|---|
NO_FUNCTION | |
AVERAGE | |
HISTOGRAM | |
MAXIMUM | |
MINIMUM | |
RMS | |
STDDEV | |
ALL_MEASURES | |
NO_FUNCTION | |
AVERAGE | |
HISTOGRAM | |
MAXIMUM | |
MINIMUM | |
RMS | |
STDDEV | |
ALL_MEASURES |
Definition at line 104 of file includeLinks/QualityAssessor.hpp.
enum QAFunction |
Enumerator | |
---|---|
NO_FUNCTION | |
AVERAGE | |
HISTOGRAM | |
MAXIMUM | |
MINIMUM | |
RMS | |
STDDEV | |
ALL_MEASURES | |
NO_FUNCTION | |
AVERAGE | |
HISTOGRAM | |
MAXIMUM | |
MINIMUM | |
RMS | |
STDDEV | |
ALL_MEASURES |
Definition at line 104 of file src/QualityAssessor/QualityAssessor.hpp.
QualityAssessor | ( | msq_std::string | name = "QualityAssessor" | ) |
Constructor - output to std::cout.
QualityAssessor | ( | msq_stdio::ostream & | output_stream, |
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - specified output stream.
QualityAssessor | ( | QualityMetric * | metric, |
QAFunction | function, | ||
msq_stdio::ostream & | output_stream, | ||
MsqError & | err, | ||
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - initial stopping assessement and specified output stream.
QualityAssessor | ( | QualityMetric * | metric, |
QAFunction | function, | ||
MsqError & | err, | ||
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - initial stopping assessement.
~QualityAssessor | ( | ) |
QualityAssessor | ( | msq_std::string | name = "QualityAssessor" | ) |
Constructor - output to std::cout.
QualityAssessor | ( | msq_stdio::ostream & | output_stream, |
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - specified output stream.
QualityAssessor | ( | QualityMetric * | metric, |
QAFunction | function, | ||
msq_stdio::ostream & | output_stream, | ||
MsqError & | err, | ||
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - initial stopping assessement and specified output stream.
QualityAssessor | ( | QualityMetric * | metric, |
QAFunction | function, | ||
MsqError & | err, | ||
msq_std::string | name = "QualityAssessor" |
||
) |
Constructor - initial stopping assessement.
~QualityAssessor | ( | ) |
Destructor.
void add_histogram_assessment | ( | QualityMetric * | qm, |
double | min_val, | ||
double | max_val, | ||
int | intervals, | ||
MsqError & | err | ||
) |
Add a quality metric for which the histogram is to be calculated, and set histogram parameters.
Checks first to see if the QualityMetric, qm, has been added to this QualityAssessor, and if it has not, adds it. It then adds HISTOGRAM as a QAFunciton for that metric. It then sets the minimum and maximum values for the histogram.
qm | Pointer to the QualityMetric to be used in histogram. |
min_val | (double) Minimum range of histogram. |
max_val | (double) Maximum range of histogram. |
intervals | Number of histogram intervals |
Definition at line 244 of file QualityAssessor/QualityAssessor.cpp.
References MSQ_SETERR.
void add_histogram_assessment | ( | QualityMetric * | qm, |
double | min, | ||
double | max, | ||
int | intervals, | ||
MsqError & | err | ||
) |
Add a quality metric for which the histogram is to be calculated, and set histogram parameters.
void add_quality_assessment | ( | QualityMetric * | qm, |
int | function_flags, | ||
MsqError & | err | ||
) |
Adds a quality metric and a wrapper function (min, max, ...).
void add_quality_assessment | ( | QualityMetric * | qm, |
int | func, | ||
MsqError & | err | ||
) |
Adds a quality metric and a wrapper function (min, max, ...).
Several QualityMetric objects can be added to a single QualityAssessor object. This allows to perform several quality assessments over a single mesh sweep.
qm | is the QualityMetric that will be used to evaluate the mesh quality |
func | is the wrapper function used over the QualityMetric (min, max, etc..) |
Definition at line 167 of file QualityAssessor/QualityAssessor.cpp.
References Mesquite::DEFAULT_HISTOGRAM_INTERVALS.
|
inline |
Do not print results of assessment.
Definition at line 170 of file includeLinks/QualityAssessor.hpp.
References QualityAssessor::printSummary.
Referenced by ShapeImprovementWrapper::ShapeImprovementWrapper().
|
inline |
Do not print results of assessment.
Definition at line 170 of file src/QualityAssessor/QualityAssessor.hpp.
References QualityAssessor::printSummary.
|
private |
Find an Assessor corresponding to the passed QualityMetric, or create it if is not found in the list.
Definition at line 179 of file QualityAssessor/QualityAssessor.cpp.
References QualityMetric::get_metric_type().
|
private |
Find an Assessor corresponding to the passed QualityMetric, or create it if is not found in the list.
|
inlinevirtual |
Return the algorithm type (to avoid RTTI use).
Implements PatchDataUser.
Definition at line 144 of file includeLinks/QualityAssessor.hpp.
References PatchDataUser::QUALITY_ASSESSOR.
|
inlinevirtual |
Return the algorithm type (to avoid RTTI use).
Implements PatchDataUser.
Definition at line 144 of file src/QualityAssessor/QualityAssessor.hpp.
References PatchDataUser::QUALITY_ASSESSOR.
|
inline |
Get list of all summary data.
Return a const reference to the internal list of calculated data.
Definition at line 288 of file includeLinks/QualityAssessor.hpp.
References QualityAssessor::assessList.
|
inline |
Get list of all summary data.
Return a const reference to the internal list of calculated data.
Definition at line 288 of file src/QualityAssessor/QualityAssessor.hpp.
References QualityAssessor::assessList.
|
inlinevirtual |
Retrieves the QualityAssessor name. A default name should be set in the constructor.
Implements PatchDataUser.
Definition at line 142 of file src/QualityAssessor/QualityAssessor.hpp.
References QualityAssessor::qualityAssessorName.
|
inlinevirtual |
Retrieves the QualityAssessor name. A default name should be set in the constructor.
Implements PatchDataUser.
Definition at line 142 of file includeLinks/QualityAssessor.hpp.
References QualityAssessor::qualityAssessorName.
|
static |
|
static |
const Assessor* get_results | ( | QualityMetric * | metric | ) | const |
Request summary data for a specific QualityMetric This method allows the application to request the summary data for a metric it has registered with the QualityAssessor.
If the passed QualityMetric has not been registered with the QualityAssessor instance, NULL is returned.
const QualityAssessor::Assessor * get_results | ( | QualityMetric * | metric | ) | const |
Request summary data for a specific QualityMetric This method allows the application to request the summary data for a metric it has registered with the QualityAssessor.
If the passed QualityMetric has not been registered with the QualityAssessor instance, NULL is returned.
Definition at line 518 of file QualityAssessor/QualityAssessor.cpp.
References QualityAssessor::assessList.
bool invalid_elements | ( | ) | const |
True if any metric evaluated to an invalid value for any element.
Definition at line 491 of file QualityAssessor/QualityAssessor.cpp.
bool invalid_elements | ( | ) | const |
True if any metric evaluated to an invalid value for any element.
Does one sweep over the mesh and assess the quality with the metrics previously added.
Computes the quality data for a given MeshSet, ms. What quality information is calculated, depends on what has been requested through the use of the QualityAssessor constructor, add_quality_assessment(), and set_stopping_assessment(). The resulting data is printed in a table unless disable_printing_results() has been called. The double returned depends on the QualityMetric and QAFunction "return" combination, which can be set using set_stopping_assessemnt().
Implements PatchDataUser.
Definition at line 275 of file QualityAssessor/QualityAssessor.cpp.
References PatchData::element_by_index(), MeshSet::get_next_patch(), i, MAXIMUM, MSQ_ERRZERO, MSQ_SETERR, PatchData::num_elements(), PatchData::num_vertices(), and PatchData::vertex_by_index().
Referenced by ShapeImprovementWrapper::run_instructions().
Does one sweep over the mesh and assess the quality with the metrics previously added.
Implements PatchDataUser.
void print_summary | ( | msq_stdio::ostream & | stream | ) | const |
Print accumulated summary data to specified stream.
Definition at line 626 of file QualityAssessor/QualityAssessor.cpp.
References QualityAssessor::assessList, QualityAssessor::AVERAGE, QualityAssessor::HISTOGRAM, QualityAssessor::MAXIMUM, QualityAssessor::MINIMUM, QualityAssessor::qualityAssessorName, QualityAssessor::RMS, and QualityAssessor::STDDEV.
void print_summary | ( | msq_stdio::ostream & | stream | ) | const |
Print accumulated summary data to specified stream.
void reset_data | ( | ) |
Reset calculated data.
Definition at line 501 of file QualityAssessor/QualityAssessor.cpp.
void reset_data | ( | ) |
Reset calculated data.
|
inline |
Provides a name to the QualityAssessor (use it for default name in constructor).
Definition at line 140 of file src/QualityAssessor/QualityAssessor.hpp.
References QualityAssessor::qualityAssessorName.
|
inline |
Provides a name to the QualityAssessor (use it for default name in constructor).
Definition at line 140 of file includeLinks/QualityAssessor.hpp.
References QualityAssessor::qualityAssessorName.
void set_stopping_assessment | ( | QualityMetric * | qm, |
QAFunction | func, | ||
MsqError & | err | ||
) |
Sets the QualityMetric and QAFunction combination that will be returned when loop_over_mesh is called.
Sets which QualityMetric and QAFunction combination is used to determine the value return from assess_mesh_quality(). It first ensures that the inputed QAFunction was not HISTOGRAM. It then calls add_quality_assessment with the given QualityMetric and QAFunction, to ensure that this combination will be computed. Finally, it sets the stoppingMetric pointer and the stoppingFunction data members.
qm | Pointer to QualityMetric. |
func | (QAFUNCTION) Wrapper function for qm (e.g. MINIMUM, MAXIMUM,...). |
Definition at line 216 of file QualityAssessor/QualityAssessor.cpp.
References MSQ_SETERR.
void set_stopping_assessment | ( | QualityMetric * | qm, |
QAFunction | func, | ||
MsqError & | err | ||
) |
Sets the QualityMetric and QAFunction combination that will be returned when loop_over_mesh is called.
|
private |
List of quality metrics and corresponding data.
Definition at line 303 of file includeLinks/QualityAssessor.hpp.
Referenced by QualityAssessor::get_all_results(), QualityAssessor::get_results(), and QualityAssessor::print_summary().
|
private |
Stream to which to write summary of metric data.
Definition at line 306 of file includeLinks/QualityAssessor.hpp.
|
private |
Disable printing.
Definition at line 308 of file includeLinks/QualityAssessor.hpp.
Referenced by QualityAssessor::disable_printing_results().
|
private |
Name.
Definition at line 300 of file includeLinks/QualityAssessor.hpp.
Referenced by QualityAssessor::get_name(), QualityAssessor::print_summary(), and QualityAssessor::set_name().
|
private |
Value to use as return value for loop_over_mesh.
Definition at line 313 of file includeLinks/QualityAssessor.hpp.
|
private |
Metric in assessList to use as return value for loop_over_mesh.
Definition at line 311 of file includeLinks/QualityAssessor.hpp.