MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <ElementPMeanP.hpp>
Public Member Functions | |
MESQUITE_EXPORT | ElementPMeanP (double p, ElemSampleQM *metric) |
virtual MESQUITE_EXPORT | ~ElementPMeanP () |
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_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 ElementPMeanP.hpp.
MBMesquite::ElementPMeanP::ElementPMeanP | ( | double | p, |
ElemSampleQM * | metric | ||
) |
Definition at line 41 of file ElementPMeanP.cpp.
: PMeanPMetric( p ), mMetric( metric ) {}
MBMesquite::ElementPMeanP::~ElementPMeanP | ( | ) | [virtual] |
Definition at line 43 of file ElementPMeanP.cpp.
{}
bool MBMesquite::ElementPMeanP::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 58 of file ElementPMeanP.cpp.
References MBMesquite::PMeanPMetric::average(), MBMesquite::ElemSampleQM::get_element_evaluations(), get_quality_metric(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.
Referenced by PMeanPMetricTest::test_element_evaluate(), and PMeanPMetricTest::test_indices().
{ ElemSampleQM* qm = get_quality_metric(); mHandles.clear(); qm->get_element_evaluations( pd, handle, mHandles, err ); MSQ_ERRFALSE( err ); bool result = average( pd, qm, mHandles, value, err ); return !MSQ_CHKERR( err ) && result; }
bool MBMesquite::ElementPMeanP::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 68 of file ElementPMeanP.cpp.
References MBMesquite::PMeanPMetric::average_with_gradient(), MBMesquite::ElemSampleQM::get_element_evaluations(), get_quality_metric(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.
Referenced by PMeanPMetricTest::test_gradient(), and PMeanPMetricTest::test_hessian().
{ ElemSampleQM* qm = get_quality_metric(); mHandles.clear(); qm->get_element_evaluations( 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::ElementPMeanP::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 83 of file ElementPMeanP.cpp.
References MBMesquite::PMeanPMetric::average_with_Hessian(), MBMesquite::ElemSampleQM::get_element_evaluations(), get_quality_metric(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.
Referenced by PMeanPMetricTest::test_hessian(), and PMeanPMetricTest::test_hessian_diagonal().
{ ElemSampleQM* qm = get_quality_metric(); mHandles.clear(); qm->get_element_evaluations( 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::ElementPMeanP::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 99 of file ElementPMeanP.cpp.
References MBMesquite::PMeanPMetric::average_with_Hessian_diagonal(), MBMesquite::ElemSampleQM::get_element_evaluations(), get_quality_metric(), mHandles, MSQ_CHKERR, and MSQ_ERRFALSE.
Referenced by PMeanPMetricTest::test_hessian_diagonal().
{ ElemSampleQM* qm = get_quality_metric(); mHandles.clear(); qm->get_element_evaluations( 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; }
std::string MBMesquite::ElementPMeanP::get_name | ( | ) | const [virtual] |
Implements MBMesquite::QualityMetric.
Definition at line 45 of file ElementPMeanP.cpp.
References MBMesquite::QualityMetric::get_name(), and mMetric.
int MBMesquite::ElementPMeanP::get_negate_flag | ( | ) | const [virtual] |
1 if metric should be minimized, -1 if metric should be maximized.
Implements MBMesquite::QualityMetric.
Definition at line 53 of file ElementPMeanP.cpp.
References MBMesquite::QualityMetric::get_negate_flag(), and get_quality_metric().
{ return get_quality_metric()->get_negate_flag(); }
MESQUITE_EXPORT ElemSampleQM* MBMesquite::ElementPMeanP::get_quality_metric | ( | ) | const [inline] |
Definition at line 51 of file ElementPMeanP.hpp.
References mMetric.
Referenced by evaluate(), evaluate_with_gradient(), evaluate_with_Hessian(), evaluate_with_Hessian_diagonal(), get_negate_flag(), and MBMesquite::VertexMover::loop_over_mesh().
{ return mMetric; }
std::vector< size_t > MBMesquite::ElementPMeanP::mHandles [mutable, private] |
Definition at line 87 of file ElementPMeanP.hpp.
Referenced by evaluate(), evaluate_with_gradient(), evaluate_with_Hessian(), and evaluate_with_Hessian_diagonal().
ElemSampleQM* MBMesquite::ElementPMeanP::mMetric [private] |
Definition at line 86 of file ElementPMeanP.hpp.
Referenced by get_name(), and get_quality_metric().