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

Use inverse of metric value as target weight. More...

#include <InverseMetricWeight.hpp>

+ Inheritance diagram for MBMesquite::InverseMetricWeight:
+ Collaboration diagram for MBMesquite::InverseMetricWeight:

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

ElemSampleQMmMetric

Detailed Description

Use inverse of metric value as target weight.

Definition at line 44 of file InverseMetricWeight.hpp.


Constructor & Destructor Documentation

Definition at line 47 of file InverseMetricWeight.hpp.

: mMetric( metric ) {}

Member Function Documentation

double MBMesquite::InverseMetricWeight::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 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;
}

Member Data Documentation

Definition at line 54 of file InverseMetricWeight.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