MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Use inverse of metric value as target weight. More...
#include <InverseMetricWeight.hpp>
Public Member Functions | |
InverseMetricWeight (ElemSampleQM *metric) | |
virtual | ~InverseMetricWeight () |
virtual double | get_weight (PatchData &pd, size_t element, Sample sample, MsqError &err) |
Get target metric weight. | |
Private Attributes | |
ElemSampleQM * | mMetric |
Use inverse of metric value as target weight.
Definition at line 44 of file InverseMetricWeight.hpp.
MBMesquite::InverseMetricWeight::InverseMetricWeight | ( | ElemSampleQM * | metric | ) | [inline] |
Definition at line 47 of file InverseMetricWeight.hpp.
: mMetric( metric ) {}
MBMesquite::InverseMetricWeight::~InverseMetricWeight | ( | ) | [virtual] |
Definition at line 40 of file InverseMetricWeight.cpp.
{}
double MBMesquite::InverseMetricWeight::get_weight | ( | PatchData & | pd, |
size_t | element, | ||
Sample | sample, | ||
MsqError & | err | ||
) | [virtual] |
Get target metric weight.
pd | The current PatchData |
element | The index an element within the patch data. |
sample | The sample point in the element. |
Implements MBMesquite::WeightCalculator.
Definition at line 42 of file InverseMetricWeight.cpp.
References MBMesquite::QualityMetric::evaluate(), MBMesquite::ElemSampleQM::handle(), MBMesquite::MsqError::INVALID_STATE, mMetric, MSQ_ERRZERO, MSQ_SETERR, and value().
{ size_t h = ElemSampleQM::handle( sample, element ); double value; bool flag = mMetric->evaluate( pd, h, value, err ); MSQ_ERRZERO( err ); if( !flag ) { MSQ_SETERR( err ) ( "Invalid metric value canot be used as target weight", MsqError::INVALID_STATE ); return 0.0; } return 1.0 / value; }
Definition at line 54 of file InverseMetricWeight.hpp.
Referenced by get_weight().