MOAB: Mesh Oriented datABase  (version 5.4.1)
LinearVertexMetric Class Reference

Fake quality metric for testing numerial gradient. More...

+ Inheritance diagram for LinearVertexMetric:
+ Collaboration diagram for LinearVertexMetric:

Public Member Functions

std::string get_name () const
int get_negate_flag () const
 1 if metric should be minimized, -1 if metric should be maximized.
bool evaluate (PatchData &pd, size_t vtx_idx, double &value, MsqError &)
 Get metric value at a logical location in the patch.
bool evaluate_with_indices (PatchData &pd, size_t vtx_idx, double &value, std::vector< size_t > &indices, MsqError &)
 Get metric value at a logical location in the patch.

Detailed Description

Fake quality metric for testing numerial gradient.

Implement a vertex metric for which the "quality" at a given vertex is the value of the x-coordinate of that vertex. Thus the gradient of the "quality" at every vertex should be {1,0,0}.

Definition at line 122 of file QualityMetricTest.cpp.


Member Function Documentation

bool LinearVertexMetric::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.

Parameters:
pdThe patch.
handleThe location in the patch (as passed back from get_evaluations).
valueThe output metric value.

Implements MBMesquite::QualityMetric.

Definition at line 133 of file QualityMetricTest.cpp.

References MBMesquite::PatchData::vertex_by_index().

    {
        value = pd.vertex_by_index( vtx_idx )[0];
        return true;
    }
bool LinearVertexMetric::evaluate_with_indices ( PatchData pd,
size_t  handle,
double &  value,
std::vector< size_t > &  indices,
MsqError err 
) [inline, virtual]

Get metric value at a logical location in the patch.

Evaluate the metric at one location in the PatchData.

Parameters:
pdThe patch.
handleThe location in the patch (as passed back from get_evaluations).
valueThe output metric value.
indicesThe free vertices that the evaluation is a function of, specified as vertex indices in the PatchData.

Implements MBMesquite::QualityMetric.

Definition at line 138 of file QualityMetricTest.cpp.

References MBMesquite::PatchData::vertex_by_index().

    {
        value = pd.vertex_by_index( vtx_idx )[0];
        indices.resize( 1 );
        indices[0] = vtx_idx;
        return true;
    }
std::string LinearVertexMetric::get_name ( ) const [inline, virtual]

Implements MBMesquite::QualityMetric.

Definition at line 125 of file QualityMetricTest.cpp.

    {
        return "Fake metric for testing numerical gradient";
    }
int LinearVertexMetric::get_negate_flag ( ) const [inline, virtual]

1 if metric should be minimized, -1 if metric should be maximized.

Implements MBMesquite::QualityMetric.

Definition at line 129 of file QualityMetricTest.cpp.

    {
        return 1;
    }

List of all members.


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