MOAB: Mesh Oriented datABase  (version 5.2.1)
ParabolicVertexMetric Class Reference

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

+ Inheritance diagram for ParabolicVertexMetric:
+ Collaboration diagram for ParabolicVertexMetric:

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 square of the value of the y-coordinate of that vertex. Thus the Hessian of the "quality" at every vertex should be {2,0,0}.

Definition at line 183 of file QualityMetricTest.cpp.


Member Function Documentation

bool ParabolicVertexMetric::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 194 of file QualityMetricTest.cpp.

References value(), and MBMesquite::PatchData::vertex_by_index().

    {
        value = pd.vertex_by_index( vtx_idx )[1];
        value *= value;
        return true;
    }
bool ParabolicVertexMetric::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 200 of file QualityMetricTest.cpp.

References value(), and MBMesquite::PatchData::vertex_by_index().

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

Implements MBMesquite::QualityMetric.

Definition at line 186 of file QualityMetricTest.cpp.

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

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

Implements MBMesquite::QualityMetric.

Definition at line 190 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