MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MetricWeight Class Reference

Use metric value as target weight. More...

#include <MetricWeight.hpp>

+ Inheritance diagram for MBMesquite::MetricWeight:
+ Collaboration diagram for MBMesquite::MetricWeight:

Public Member Functions

 MetricWeight (ElemSampleQM *metric)
virtual ~MetricWeight ()
virtual double get_weight (PatchData &pd, size_t element, Sample sample, MsqError &err)
 Get target metric weight.

Private Attributes

ElemSampleQMmMetric

Detailed Description

Use metric value as target weight.

Definition at line 44 of file MetricWeight.hpp.


Constructor & Destructor Documentation

Definition at line 47 of file MetricWeight.hpp.

: mMetric( metric ) {}

Definition at line 40 of file MetricWeight.cpp.

{}

Member Function Documentation

double MBMesquite::MetricWeight::get_weight ( PatchData pd,
size_t  element,
Sample  sample,
MsqError err 
) [virtual]

Get target metric weight.

Parameters:
pdThe current PatchData
elementThe index an element within the patch data.
sampleThe sample point in the element.

Implements MBMesquite::WeightCalculator.

Definition at line 42 of file MetricWeight.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 value;
}

Member Data Documentation

Definition at line 54 of file MetricWeight.hpp.

Referenced by get_weight().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines