MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::VertexQM Class Reference

Base type for per-vertex quality metrics. More...

#include <VertexQM.hpp>

+ Inheritance diagram for MBMesquite::VertexQM:
+ Collaboration diagram for MBMesquite::VertexQM:

Public Member Functions

virtual MESQUITE_EXPORT ~VertexQM ()
virtual MESQUITE_EXPORT MetricType get_metric_type () const
virtual MESQUITE_EXPORT void get_evaluations (PatchData &pd, std::vector< size_t > &handles, bool free_vertices_only, MsqError &err)
 Returns list of vertex indices in PatchData.

Static Public Member Functions

static MESQUITE_EXPORT void get_vertex_evaluations (PatchData &pd, std::vector< size_t > &handles, bool free_vertices_only, MsqError &err)
static MESQUITE_EXPORT void get_vertex_corner_handles (PatchData &pd, size_t vertex_index, std::vector< size_t > &handles_out, MsqError &err)

Detailed Description

Base type for per-vertex quality metrics.

Definition at line 42 of file VertexQM.hpp.


Constructor & Destructor Documentation

Definition at line 40 of file VertexQM.cpp.

{}

Member Function Documentation

void MBMesquite::VertexQM::get_evaluations ( PatchData pd,
std::vector< size_t > &  handles,
bool  free_vertices_only,
MsqError err 
) [virtual]

Returns list of vertex indices in PatchData.

Implements MBMesquite::QualityMetric.

Definition at line 42 of file VertexQM.cpp.

References get_vertex_evaluations().

Referenced by PMeanPTemplateTest::check_result(), and PMeanPMetricTest::test_get_vertex_evaluations().

{
    get_vertex_evaluations( pd, handles, free_vertices_only, err );
}
void MBMesquite::VertexQM::get_vertex_corner_handles ( PatchData pd,
size_t  vertex_index,
std::vector< size_t > &  handles_out,
MsqError err 
) [static]

Definition at line 67 of file VertexQM.cpp.

References MBMesquite::PatchData::element_by_index(), MBMesquite::PatchData::get_vertex_element_adjacencies(), MBMesquite::MsqMeshEntity::get_vertex_index_array(), MBMesquite::ElemSampleQM::handle(), MSQ_ERRRTN, and MBMesquite::MsqMeshEntity::node_count().

Referenced by MBMesquite::VertexMaxQM::evaluate(), MBMesquite::VertexPMeanP::evaluate(), MBMesquite::VertexPMeanP::evaluate_with_gradient(), MBMesquite::VertexPMeanP::evaluate_with_Hessian(), MBMesquite::VertexPMeanP::evaluate_with_Hessian_diagonal(), MBMesquite::VertexMaxQM::evaluate_with_indices(), and MBMesquite::VertexPMeanP::evaluate_with_indices().

{
    size_t len;
    const size_t* elems = pd.get_vertex_element_adjacencies( vtx_idx, len, err );MSQ_ERRRTN( err );

    handles.resize( len );
    for( size_t i = 0; i < len; ++i )
    {
        const MsqMeshEntity& elem = pd.element_by_index( elems[i] );
        const size_t* verts       = elem.get_vertex_index_array();
        const size_t* ptr         = std::find( verts, verts + elem.node_count(), vtx_idx );
        unsigned idx              = ptr - verts;
        handles[i]                = ElemSampleQM::handle( Sample( 0, idx ), elems[i] );
    }
}
void MBMesquite::VertexQM::get_vertex_evaluations ( PatchData pd,
std::vector< size_t > &  handles,
bool  free_vertices_only,
MsqError err 
) [static]

Definition at line 47 of file VertexQM.cpp.

References MBMesquite::MsqVertex::get_flags(), MBMesquite::MsqVertex::MSQ_PATCH_FIXED, MBMesquite::PatchData::num_free_vertices(), MBMesquite::PatchData::num_nodes(), and MBMesquite::PatchData::vertex_by_index().

Referenced by get_evaluations().

{
    if( free_vertices_only )
    {
        handles.resize( pd.num_free_vertices() );
        for( size_t i = 0; i < pd.num_free_vertices(); ++i )
            handles[i] = i;
    }
    else
    {
        handles.clear();
        handles.reserve( pd.num_nodes() );
        for( size_t i = 0; i < pd.num_nodes(); ++i )
            if( !( pd.vertex_by_index( i ).get_flags() & MsqVertex::MSQ_PATCH_FIXED ) ) handles.push_back( i );
    }
}

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