MOAB: Mesh Oriented datABase  (version 5.2.1)
MBMesquite::VertexPMeanP Class Reference

#include <VertexPMeanP.hpp>

+ Inheritance diagram for MBMesquite::VertexPMeanP:
+ Collaboration diagram for MBMesquite::VertexPMeanP:

Public Member Functions

MESQUITE_EXPORT VertexPMeanP (double p, ElemSampleQM *metric)
virtual MESQUITE_EXPORT ~VertexPMeanP ()
MESQUITE_EXPORT ElemSampleQMget_quality_metric () const
virtual MESQUITE_EXPORT std::string get_name () const
virtual MESQUITE_EXPORT int get_negate_flag () const
 1 if metric should be minimized, -1 if metric should be maximized.
virtual MESQUITE_EXPORT bool evaluate (PatchData &pd, size_t handle, double &value, MsqError &err)
 Get metric value at a logical location in the patch.
virtual MESQUITE_EXPORT bool evaluate_with_indices (PatchData &pd, size_t handle, double &value, std::vector< size_t > &indices, MsqError &err)
 Get metric value at a logical location in the patch.
virtual MESQUITE_EXPORT bool evaluate_with_gradient (PatchData &pd, size_t handle, double &value, std::vector< size_t > &indices, std::vector< Vector3D > &gradient, MsqError &err)
 Get metric value and gradient at a logical location in the patch.
virtual MESQUITE_EXPORT bool evaluate_with_Hessian (PatchData &pd, size_t handle, double &value, std::vector< size_t > &indices, std::vector< Vector3D > &gradient, std::vector< Matrix3D > &Hessian, MsqError &err)
 Get metric value and deravitives at a logical location in the patch.
virtual MESQUITE_EXPORT bool evaluate_with_Hessian_diagonal (PatchData &pd, size_t handle, double &value, std::vector< size_t > &indices, std::vector< Vector3D > &gradient, std::vector< SymMatrix3D > &Hessian_diagonal, MsqError &err)
 Get metric value and gradient at a logical location in the patch.

Private Attributes

ElemSampleQMmMetric
std::vector< size_t > mHandles

Detailed Description

Definition at line 44 of file VertexPMeanP.hpp.


Constructor & Destructor Documentation

Definition at line 42 of file VertexPMeanP.cpp.

: PMeanPMetric( p ), mMetric( metric ) {}

Definition at line 44 of file VertexPMeanP.cpp.

{}

Member Function Documentation

bool MBMesquite::VertexPMeanP::evaluate ( PatchData pd,
size_t  handle,
double &  value,
MsqError err 
) [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 59 of file VertexPMeanP.cpp.

References MBMesquite::PMeanPMetric::average(), get_quality_metric(), MBMesquite::VertexQM::get_vertex_corner_handles(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.

Referenced by PMeanPMetricTest::test_vertex_evaluate().

{
    mHandles.clear();
    get_vertex_corner_handles( pd, handle, mHandles, err );
    MSQ_ERRFALSE( err );
    bool result = average( pd, get_quality_metric(), mHandles, value, err );
    return !MSQ_CHKERR( err ) && result;
}
bool MBMesquite::VertexPMeanP::evaluate_with_gradient ( PatchData pd,
size_t  handle,
double &  value,
std::vector< size_t > &  indices,
std::vector< Vector3D > &  gradient,
MsqError err 
) [virtual]

Get metric value and gradient 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.
gradientThe gradient of the metric as a function of the coordinates of the free vertices passed back in the indices list.

Reimplemented from MBMesquite::QualityMetric.

Definition at line 79 of file VertexPMeanP.cpp.

References MBMesquite::PMeanPMetric::average_with_gradient(), get_quality_metric(), MBMesquite::VertexQM::get_vertex_corner_handles(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.

{
    ElemSampleQM* qm = get_quality_metric();
    mHandles.clear();
    get_vertex_corner_handles( pd, handle, mHandles, err );
    MSQ_ERRFALSE( err );
    bool result = average_with_gradient( pd, qm, mHandles, value, indices, gradient, err );
    return !MSQ_CHKERR( err ) && result;
}
bool MBMesquite::VertexPMeanP::evaluate_with_Hessian ( PatchData pd,
size_t  handle,
double &  value,
std::vector< size_t > &  indices,
std::vector< Vector3D > &  gradient,
std::vector< Matrix3D > &  Hessian,
MsqError err 
) [virtual]

Get metric value and deravitives 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.
gradientThe gradient of the metric as a function of the coordinates of the free vertices passed back in the indices list.
HessianThe Hessian of the metric as a function of the coordinates. The Hessian is passed back as the upper-triangular portion of the matrix in row-major order, where each Matrix3D is the portion of the Hessian with respect to the vertices at the corresponding positions in the indices list.

Reimplemented from MBMesquite::QualityMetric.

Definition at line 90 of file VertexPMeanP.cpp.

References MBMesquite::PMeanPMetric::average_with_Hessian(), get_quality_metric(), MBMesquite::VertexQM::get_vertex_corner_handles(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.

{
    ElemSampleQM* qm = get_quality_metric();
    mHandles.clear();
    get_vertex_corner_handles( pd, handle, mHandles, err );
    MSQ_ERRFALSE( err );
    bool result = average_with_Hessian( pd, qm, mHandles, value, indices, gradient, Hessian, err );
    return !MSQ_CHKERR( err ) && result;
}
bool MBMesquite::VertexPMeanP::evaluate_with_Hessian_diagonal ( PatchData pd,
size_t  handle,
double &  value,
std::vector< size_t > &  indices,
std::vector< Vector3D > &  gradient,
std::vector< SymMatrix3D > &  Hessian_diagonal,
MsqError err 
) [virtual]

Get metric value and gradient 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.
gradientThe gradient of the metric as a function of the coordinates of the free vertices passed back in the indices list.
Hessian_diagonalThe 3x3 blocks along the diagonal of the Hessian matrix.

Reimplemented from MBMesquite::QualityMetric.

Definition at line 102 of file VertexPMeanP.cpp.

References MBMesquite::PMeanPMetric::average_with_Hessian_diagonal(), get_quality_metric(), MBMesquite::VertexQM::get_vertex_corner_handles(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.

{
    ElemSampleQM* qm = get_quality_metric();
    mHandles.clear();
    get_vertex_corner_handles( pd, handle, mHandles, err );
    MSQ_ERRFALSE( err );
    bool result = average_with_Hessian_diagonal( pd, qm, mHandles, value, indices, gradient, diagonal, err );
    return !MSQ_CHKERR( err ) && result;
}
bool MBMesquite::VertexPMeanP::evaluate_with_indices ( PatchData pd,
size_t  handle,
double &  value,
std::vector< size_t > &  indices,
MsqError err 
) [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 68 of file VertexPMeanP.cpp.

References MBMesquite::PMeanPMetric::average_with_indices(), get_quality_metric(), MBMesquite::VertexQM::get_vertex_corner_handles(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.

{
    ElemSampleQM* qm = get_quality_metric();
    mHandles.clear();
    get_vertex_corner_handles( pd, handle, mHandles, err );
    MSQ_ERRFALSE( err );
    bool result = average_with_indices( pd, qm, mHandles, value, indices, err );
    return !MSQ_CHKERR( err ) && result;
}
std::string MBMesquite::VertexPMeanP::get_name ( ) const [virtual]

Implements MBMesquite::QualityMetric.

Definition at line 46 of file VertexPMeanP.cpp.

References MBMesquite::QualityMetric::get_name(), and mMetric.

{
    std::string result( "VertexPMeanP(" );
    result += mMetric->get_name();
    result += ")";
    return result;
}

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

Implements MBMesquite::QualityMetric.

Definition at line 54 of file VertexPMeanP.cpp.

References MBMesquite::QualityMetric::get_negate_flag(), and mMetric.

{
    return mMetric->get_negate_flag();
}

Member Data Documentation

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