MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <VertexPMeanP.hpp>
Public Member Functions | |
MESQUITE_EXPORT | VertexPMeanP (double p, ElemSampleQM *metric) |
virtual MESQUITE_EXPORT | ~VertexPMeanP () |
MESQUITE_EXPORT ElemSampleQM * | get_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 | |
ElemSampleQM * | mMetric |
std::vector< size_t > | mHandles |
Definition at line 44 of file VertexPMeanP.hpp.
MBMesquite::VertexPMeanP::VertexPMeanP | ( | double | p, |
ElemSampleQM * | metric | ||
) |
Definition at line 42 of file VertexPMeanP.cpp.
: PMeanPMetric( p ), mMetric( metric ) {}
MBMesquite::VertexPMeanP::~VertexPMeanP | ( | ) | [virtual] |
Definition at line 44 of file VertexPMeanP.cpp.
{}
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.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The 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.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The output metric value. |
indices | The free vertices that the evaluation is a function of, specified as vertex indices in the PatchData. |
gradient | The 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 82 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.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The output metric value. |
indices | The free vertices that the evaluation is a function of, specified as vertex indices in the PatchData. |
gradient | The gradient of the metric as a function of the coordinates of the free vertices passed back in the indices list. |
Hessian | The 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 97 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.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The output metric value. |
indices | The free vertices that the evaluation is a function of, specified as vertex indices in the PatchData. |
gradient | The gradient of the metric as a function of the coordinates of the free vertices passed back in the indices list. |
Hessian_diagonal | The 3x3 blocks along the diagonal of the Hessian matrix. |
Reimplemented from MBMesquite::QualityMetric.
Definition at line 113 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.
pd | The patch. |
handle | The location in the patch (as passed back from get_evaluations). |
value | The output metric value. |
indices | The 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.
int MBMesquite::VertexPMeanP::get_negate_flag | ( | ) | const [virtual] |
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(); }
MESQUITE_EXPORT ElemSampleQM* MBMesquite::VertexPMeanP::get_quality_metric | ( | ) | const [inline] |
Definition at line 51 of file VertexPMeanP.hpp.
References mMetric.
Referenced by evaluate(), evaluate_with_gradient(), evaluate_with_Hessian(), evaluate_with_Hessian_diagonal(), and evaluate_with_indices().
{ return mMetric; }
std::vector< size_t > MBMesquite::VertexPMeanP::mHandles [mutable, private] |
Definition at line 93 of file VertexPMeanP.hpp.
Referenced by evaluate(), evaluate_with_gradient(), evaluate_with_Hessian(), evaluate_with_Hessian_diagonal(), and evaluate_with_indices().
ElemSampleQM* MBMesquite::VertexPMeanP::mMetric [private] |
Definition at line 92 of file VertexPMeanP.hpp.
Referenced by get_name(), get_negate_flag(), and get_quality_metric().