MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <ElementMaxQM.hpp>
Public Member Functions | |
MESQUITE_EXPORT | ElementMaxQM (ElemSampleQM *metric) |
virtual MESQUITE_EXPORT | ~ElementMaxQM () |
MESQUITE_EXPORT ElemSampleQM * | get_quality_metric () const |
virtual MESQUITE_EXPORT std::string | get_name () const |
virtual MESQUITE_EXPORT int | get_negate_flag () const |
1 if metric should be minimized, -1 if metric should be maximized. | |
virtual MESQUITE_EXPORT bool | evaluate (PatchData &pd, size_t handle, double &value, MsqError &err) |
Get metric value at a logical location in the patch. | |
Private Attributes | |
ElemSampleQM * | mMetric |
std::vector< size_t > | mHandles |
Definition at line 43 of file ElementMaxQM.hpp.
MBMesquite::ElementMaxQM::ElementMaxQM | ( | ElemSampleQM * | metric | ) |
Definition at line 42 of file ElementMaxQM.cpp.
: mMetric( metric ) {}
MBMesquite::ElementMaxQM::~ElementMaxQM | ( | ) | [virtual] |
Definition at line 44 of file ElementMaxQM.cpp.
{}
bool MBMesquite::ElementMaxQM::evaluate | ( | PatchData & | pd, |
size_t | handle, | ||
double & | value, | ||
MsqError & | err | ||
) | [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 59 of file ElementMaxQM.cpp.
References MBMesquite::QualityMetric::evaluate(), MBMesquite::ElemSampleQM::get_element_evaluations(), get_quality_metric(), mHandles, and MSQ_ERRFALSE.
{ ElemSampleQM* qm = get_quality_metric(); mHandles.clear(); qm->get_element_evaluations( pd, handle, mHandles, err ); MSQ_ERRFALSE( err ); bool valid = true; double tmpval; bool tmpvalid; value = -1.e+100; // initialize max computation for( std::vector< size_t >::iterator h = mHandles.begin(); h != mHandles.end(); ++h ) { tmpvalid = qm->evaluate( pd, *h, tmpval, err ); // MSQ_ERRZERO(err); if( !tmpvalid ) { value = +1.e+100; return false; // if any handle within the element makes tmpvalid false, then valid is // false, no matter what the other handles say } else if( tmpval > value ) value = tmpval; } return valid; }
std::string MBMesquite::ElementMaxQM::get_name | ( | ) | const [virtual] |
Implements MBMesquite::QualityMetric.
Definition at line 46 of file ElementMaxQM.cpp.
References MBMesquite::QualityMetric::get_name(), and mMetric.
int MBMesquite::ElementMaxQM::get_negate_flag | ( | ) | const [virtual] |
1 if metric should be minimized, -1 if metric should be maximized.
Implements MBMesquite::QualityMetric.
Definition at line 54 of file ElementMaxQM.cpp.
References MBMesquite::QualityMetric::get_negate_flag(), and get_quality_metric().
{ return get_quality_metric()->get_negate_flag(); }
MESQUITE_EXPORT ElemSampleQM* MBMesquite::ElementMaxQM::get_quality_metric | ( | ) | const [inline] |
Definition at line 50 of file ElementMaxQM.hpp.
References mMetric.
Referenced by evaluate(), get_negate_flag(), and MBMesquite::VertexMover::loop_over_mesh().
{ return mMetric; }
std::vector< size_t > MBMesquite::ElementMaxQM::mHandles [mutable, private] |
Definition at line 63 of file ElementMaxQM.hpp.
Referenced by evaluate().
ElemSampleQM* MBMesquite::ElementMaxQM::mMetric [private] |
Definition at line 62 of file ElementMaxQM.hpp.
Referenced by get_name(), and get_quality_metric().