MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Base type for metrics evaluated at several sample points within each element. More...
#include <ElemSampleQM.hpp>
Public Types | |
enum | { ELEM_INDEX_BITS = sizeof( size_t ) * 8 - Sample::NUMBER_PACKED_BITS, MAX_ELEM_PER_PATCH = ( (size_t)1 ) << ELEM_INDEX_BITS, ELEM_SAMPLE_MASK = MAX_ELEM_PER_PATCH - 1 } |
Public Member Functions | |
virtual MESQUITE_EXPORT | ~ElemSampleQM () |
virtual MESQUITE_EXPORT MetricType | get_metric_type () const |
virtual MESQUITE_EXPORT void | get_element_evaluations (PatchData &pd, size_t elem_index, std::vector< size_t > &handles, MsqError &err)=0 |
Get evaluation point handles for a given element. | |
Static Public Member Functions | |
static size_t | handle (Sample sample, size_t index) |
static Sample | sample (size_t handle) |
static size_t | elem (size_t handle) |
Base type for metrics evaluated at several sample points within each element.
This class defines an interface for metrics that are evaluated at multiple sample points within each element. This interface is used by ElemAverageQM and is the base for ElemCornerQM and ElemTargetQM.
Definition at line 50 of file ElemSampleQM.hpp.
anonymous enum |
Misc constants used in defining how element index, side dimension, and side number are packed into a single handle describing a logical location in the patch at which a sample-based metric is to be evaluated.
ELEM_INDEX_BITS |
the number of bits in a handle that are used to store element index |
MAX_ELEM_PER_PATCH |
the maximum number of elements in a PatchData without overflowing handle space |
ELEM_SAMPLE_MASK |
Mask to remove sample bits from handle |
Definition at line 79 of file ElemSampleQM.hpp.
{ /** the number of bits in a handle that are used to store element index */ ELEM_INDEX_BITS = sizeof( size_t ) * 8 - Sample::NUMBER_PACKED_BITS, /** the maximum number of elements in a PatchData without overflowing handle space */ MAX_ELEM_PER_PATCH = ( (size_t)1 ) << ELEM_INDEX_BITS, /** Mask to remove sample bits from handle */ ELEM_SAMPLE_MASK = MAX_ELEM_PER_PATCH - 1 };
ElemSampleQM::~ElemSampleQM | ( | ) | [virtual] |
Definition at line 37 of file ElemSampleQM.cpp.
{}
static size_t MBMesquite::ElemSampleQM::elem | ( | size_t | handle | ) | [inline, static] |
Definition at line 101 of file ElemSampleQM.hpp.
References ELEM_SAMPLE_MASK.
Referenced by MBMesquite::AffineMapMetric::evaluate(), MBMesquite::TMPQualityMetric::evaluate(), FauxMetric< B >::evaluate(), MBMesquite::AWQualityMetric::evaluate_internal(), MBMesquite::TQualityMetric::evaluate_internal(), MBMesquite::AWQualityMetric::evaluate_with_gradient(), MBMesquite::TQualityMetric::evaluate_with_gradient(), MBMesquite::TQualityMetric::evaluate_with_Hessian(), MBMesquite::AWQualityMetric::evaluate_with_Hessian(), MBMesquite::TQualityMetric::evaluate_with_Hessian_diagonal(), MBMesquite::AWQualityMetric::evaluate_with_Hessian_diagonal(), MBMesquite::AffineMapMetric::evaluate_with_indices(), MBMesquite::TMPQualityMetric::evaluate_with_indices(), FauxMetric< B >::evaluate_with_indices(), MBMesquite::MeshUtil::lambda_distribution(), and test_handle().
{ return handle & ELEM_SAMPLE_MASK; }
virtual MESQUITE_EXPORT void MBMesquite::ElemSampleQM::get_element_evaluations | ( | PatchData & | pd, |
size_t | elem_index, | ||
std::vector< size_t > & | handles, | ||
MsqError & | err | ||
) | [pure virtual] |
Get evaluation point handles for a given element.
Similar to QualityMetric::get_evaluations, this method returns a list of handles corresponding to sample points at which the metric may be evaluated. While QualityMetric::get_evaluations returns sample points for all elements in a PatchData, this method returns only the subset corresponding to a single element.
Implemented in FauxMetric< B >, MBMesquite::TMPQualityMetric, and MBMesquite::AffineMapMetric.
Referenced by MBMesquite::ElementAvgQM::evaluate(), MBMesquite::ElementMaxQM::evaluate(), MBMesquite::ElementPMeanP::evaluate(), MBMesquite::ElementPMeanP::evaluate_with_gradient(), MBMesquite::ElementPMeanP::evaluate_with_Hessian(), MBMesquite::ElementPMeanP::evaluate_with_Hessian_diagonal(), and QualityMetricTester::test_get_in_element_evaluations().
virtual MESQUITE_EXPORT MetricType MBMesquite::ElemSampleQM::get_metric_type | ( | ) | const [inline, virtual] |
Implements MBMesquite::QualityMetric.
Reimplemented in FauxMetric< B >.
Definition at line 55 of file ElemSampleQM.hpp.
References MBMesquite::QualityMetric::ELEMENT_BASED.
{ return ELEMENT_BASED; }
static size_t MBMesquite::ElemSampleQM::handle | ( | Sample | sample, |
size_t | index | ||
) | [inline, static] |
Definition at line 91 of file ElemSampleQM.hpp.
References ELEM_INDEX_BITS, and MBMesquite::Sample::pack().
Referenced by MBMesquite::append_elem_samples(), MBMesquite::VertexQM::get_vertex_corner_handles(), MBMesquite::InverseMetricWeight::get_weight(), MBMesquite::MetricWeight::get_weight(), TMPQualityMetricTest< QMType >::test_gradient_3D(), TMPQualityMetricTest< QMType >::test_gradient_common(), test_handle(), and PMeanPMetricTest::test_vertex_evaluate().
{ return ( sample.pack() << ELEM_INDEX_BITS ) | index; }
static Sample MBMesquite::ElemSampleQM::sample | ( | size_t | handle | ) | [inline, static] |
Definition at line 96 of file ElemSampleQM.hpp.
Referenced by MBMesquite::AffineMapMetric::evaluate(), MBMesquite::TMPQualityMetric::evaluate(), FauxMetric< B >::evaluate(), MBMesquite::AWQualityMetric::evaluate_internal(), MBMesquite::TQualityMetric::evaluate_internal(), MBMesquite::AWQualityMetric::evaluate_with_gradient(), MBMesquite::TQualityMetric::evaluate_with_gradient(), MBMesquite::AWQualityMetric::evaluate_with_Hessian(), MBMesquite::TQualityMetric::evaluate_with_Hessian(), MBMesquite::TQualityMetric::evaluate_with_Hessian_diagonal(), MBMesquite::AWQualityMetric::evaluate_with_Hessian_diagonal(), MBMesquite::AffineMapMetric::evaluate_with_indices(), MBMesquite::TMPQualityMetric::evaluate_with_indices(), FauxMetric< B >::evaluate_with_indices(), and test_handle().
{ return Sample( handle >> ELEM_INDEX_BITS ); }