MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Public Member Functions | |
MetricLogger (QualityMetric *metric) | |
double | min () const |
double | max () const |
double | avg () const |
double | sqrsum () const |
double | rms () const |
double | dev () const |
double | pmean (double p) const |
bool | no_duplicate_evals () const |
MetricType | get_metric_type () const |
std::string | get_name () const |
int | get_negate_flag () const |
1 if metric should be minimized, -1 if metric should be maximized. | |
void | get_evaluations (PatchData &pd, vector< size_t > &handles, bool free, MsqError &err) |
bool | evaluate (PatchData &pd, size_t handle, double &value, MsqError &err) |
Get metric value at a logical location in the patch. | |
bool | evaluate_with_indices (PatchData &, size_t, double &, vector< size_t > &, MsqError &err) |
bool | evaluate_with_gradient (PatchData &, size_t, double &, vector< size_t > &, vector< Vector3D > &, MsqError &err) |
bool | evaluate_with_Hessian (PatchData &, size_t, double &, vector< size_t > &, vector< Vector3D > &, vector< Matrix3D > &, MsqError &err) |
Public Attributes | |
vector< double > | mValues |
vector< Mesh::EntityHandle > | mHandles |
int | invalidCount |
Private Attributes | |
QualityMetric * | mMetric |
Definition at line 211 of file QualityAssessorTest.cpp.
MetricLogger::MetricLogger | ( | QualityMetric * | metric | ) | [inline] |
Definition at line 214 of file QualityAssessorTest.cpp.
: invalidCount( 0 ), mMetric( metric ) {}
double MetricLogger::avg | ( | ) | const [inline] |
Definition at line 228 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), and QualityAssessorTest::test_basic_stats_vertex().
double MetricLogger::dev | ( | ) | const [inline] |
Definition at line 244 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), and QualityAssessorTest::test_basic_stats_vertex().
bool MetricLogger::evaluate | ( | PatchData & | pd, |
size_t | handle, | ||
double & | value, | ||
MsqError & | err | ||
) | [inline, virtual] |
Get metric value at a logical location in the patch.
Evaluate the metric at one location in the PatchData.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The output metric value. |
Implements MBMesquite::QualityMetric.
Definition at line 283 of file QualityAssessorTest.cpp.
References MBMesquite::PatchData::get_element_handles_array(), MBMesquite::PatchData::get_vertex_handles_array(), mMetric, MBMesquite::PatchData::num_elements(), and MBMesquite::QualityMetric::VERTEX_BASED.
{ bool rval = mMetric->evaluate( pd, handle, value, err ); mValues.push_back( value ); if( get_metric_type() == QualityMetric::VERTEX_BASED ) mHandles.push_back( pd.get_vertex_handles_array()[handle] ); else if( handle < pd.num_elements() ) mHandles.push_back( pd.get_element_handles_array()[handle] ); if( !rval ) ++invalidCount; return rval; }
bool MetricLogger::evaluate_with_gradient | ( | PatchData & | , |
size_t | , | ||
double & | , | ||
vector< size_t > & | , | ||
vector< Vector3D > & | , | ||
MsqError & | err | ||
) | [inline] |
Definition at line 301 of file QualityAssessorTest.cpp.
References CPPUNIT_ASSERT, MSQ_SETERR, and NOT_IMPLEMENTED.
{ // shouldn't be called by QualityAssessor CPPUNIT_ASSERT( false ); MSQ_SETERR( err )( MsqError::NOT_IMPLEMENTED ); return false; }
bool MetricLogger::evaluate_with_Hessian | ( | PatchData & | , |
size_t | , | ||
double & | , | ||
vector< size_t > & | , | ||
vector< Vector3D > & | , | ||
vector< Matrix3D > & | , | ||
MsqError & | err | ||
) | [inline] |
Definition at line 307 of file QualityAssessorTest.cpp.
References CPPUNIT_ASSERT, MSQ_SETERR, and NOT_IMPLEMENTED.
{ // shouldn't be called by QualityAssessor CPPUNIT_ASSERT( false ); MSQ_SETERR( err )( MsqError::NOT_IMPLEMENTED ); return false; }
bool MetricLogger::evaluate_with_indices | ( | PatchData & | , |
size_t | , | ||
double & | , | ||
vector< size_t > & | , | ||
MsqError & | err | ||
) | [inline] |
Definition at line 295 of file QualityAssessorTest.cpp.
References CPPUNIT_ASSERT, MSQ_SETERR, and NOT_IMPLEMENTED.
{ // shouldn't be called by QualityAssessor CPPUNIT_ASSERT( false ); MSQ_SETERR( err )( MsqError::NOT_IMPLEMENTED ); return false; }
void MetricLogger::get_evaluations | ( | PatchData & | pd, |
vector< size_t > & | handles, | ||
bool | free, | ||
MsqError & | err | ||
) | [inline] |
Definition at line 278 of file QualityAssessorTest.cpp.
References mMetric.
{ return mMetric->get_evaluations( pd, handles, free, err ); }
MetricType MetricLogger::get_metric_type | ( | ) | const [inline, virtual] |
Implements MBMesquite::QualityMetric.
Definition at line 263 of file QualityAssessorTest.cpp.
References mMetric.
{ return mMetric->get_metric_type(); }
std::string MetricLogger::get_name | ( | ) | const [inline, virtual] |
Implements MBMesquite::QualityMetric.
Definition at line 268 of file QualityAssessorTest.cpp.
References mMetric.
int MetricLogger::get_negate_flag | ( | ) | const [inline, virtual] |
1 if metric should be minimized, -1 if metric should be maximized.
Implements MBMesquite::QualityMetric.
Definition at line 273 of file QualityAssessorTest.cpp.
References mMetric.
{ return mMetric->get_negate_flag(); }
double MetricLogger::max | ( | ) | const [inline] |
Definition at line 224 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), QualityAssessorTest::test_basic_stats_vertex(), and QualityAssessorTest::test_histogram_unknown_range().
double MetricLogger::min | ( | ) | const [inline] |
Definition at line 220 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), QualityAssessorTest::test_basic_stats_vertex(), and QualityAssessorTest::test_histogram_unknown_range().
bool MetricLogger::no_duplicate_evals | ( | ) | const [inline] |
Definition at line 256 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), and QualityAssessorTest::test_basic_stats_vertex().
{ vector< Mesh::EntityHandle > handles( mHandles ); sort( handles.begin(), handles.end() ); return handles.end() == unique( handles.begin(), handles.end() ); }
double MetricLogger::pmean | ( | double | p | ) | const [inline] |
Definition at line 248 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_power_mean().
double MetricLogger::rms | ( | ) | const [inline] |
Definition at line 240 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), and QualityAssessorTest::test_basic_stats_vertex().
double MetricLogger::sqrsum | ( | ) | const [inline] |
Definition at line 233 of file QualityAssessorTest.cpp.
Definition at line 218 of file QualityAssessorTest.cpp.
vector< Mesh::EntityHandle > MetricLogger::mHandles |
Definition at line 217 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_tag_element(), and QualityAssessorTest::test_tag_vertex().
QualityMetric* MetricLogger::mMetric [private] |
Definition at line 321 of file QualityAssessorTest.cpp.
vector< double > MetricLogger::mValues |
Definition at line 216 of file QualityAssessorTest.cpp.
Referenced by QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), QualityAssessorTest::test_basic_stats_vertex(), QualityAssessorTest::test_histogram_known_range(), QualityAssessorTest::test_histogram_unknown_range(), QualityAssessorTest::test_tag_element(), and QualityAssessorTest::test_tag_vertex().