MOAB: Mesh Oriented datABase  (version 5.3.1)
EntityCount Class Reference

Public Member Functions

 EntityCount ()
ErrorCode get_counts ()
ErrorCode create_adjacencies (Range &entities, int adj_dim)
void copy_counts (EntityCount &count)
void print ()

Public Attributes

unsigned int node
unsigned int edge
unsigned int quad
unsigned int tri
unsigned int hex
unsigned int tet

Detailed Description

Definition at line 13 of file merge_test.cpp.


Constructor & Destructor Documentation

Definition at line 31 of file merge_test.cpp.

{
    node = 0;
    edge = 0;
    quad = 0;
    tri  = 0;
    hex  = 0;
    tet  = 0;
}

Member Function Documentation

Definition at line 41 of file merge_test.cpp.

References edge, hex, node, quad, tet, and tri.

Referenced by process_bu_auto_merge(), process_merge(), process_mo_auto_merge(), and process_td_auto_merge().

{
    node = count.node;
    edge = count.edge;
    quad = count.quad;
    tri  = count.tri;
    hex  = count.hex;
    tet  = count.tet;
}
ErrorCode EntityCount::create_adjacencies ( Range entities,
int  adj_dim 
)

Definition at line 101 of file merge_test.cpp.

References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), gMB, and MB_SUCCESS.

{
    ErrorCode result;
    Range::iterator iter;
    std::vector< EntityHandle > adjacencies;

    for( iter = entities.begin(); iter != entities.end(); ++iter )
    {
        result = gMB->get_adjacencies( &*iter, 1, adj_dim, true, adjacencies );
        if( result != MB_SUCCESS ) break;
    }

    return result;
}

Definition at line 51 of file merge_test.cpp.

References moab::Range::clear(), entities, moab::Interface::get_entities_by_type(), gMB, MB_SUCCESS, MBEDGE, MBHEX, MBQUAD, MBTET, MBTRI, MBVERTEX, and moab::Range::size().

Referenced by merge_2D_elem(), merge_3D_elem(), merge_edges(), merge_nodes(), merge_top_down(), process_bu_auto_merge(), process_merge(), process_mo_auto_merge(), process_td_auto_merge(), and read_file().

{
    Range entities;
    int do_create = edge == 0;

    if( gMB->get_entities_by_type( 0, MBVERTEX, entities ) != MB_SUCCESS ) return MB_FAILURE;
    node = entities.size();

    entities.clear();
    if( gMB->get_entities_by_type( 0, MBHEX, entities ) != MB_SUCCESS ) return MB_FAILURE;
    hex = entities.size();
    if( hex > 0 && do_create )
    {
        if( create_adjacencies( entities, 2 ) != MB_SUCCESS ) return MB_FAILURE;
        if( create_adjacencies( entities, 1 ) != MB_SUCCESS ) return MB_FAILURE;
    }

    entities.clear();
    if( gMB->get_entities_by_type( 0, MBQUAD, entities ) != MB_SUCCESS ) return MB_FAILURE;
    quad = entities.size();
    if( quad > 0 && do_create )
    {

        if( create_adjacencies( entities, 1 ) != MB_SUCCESS ) return MB_FAILURE;
    }

    entities.clear();
    if( gMB->get_entities_by_type( 0, MBTET, entities ) != MB_SUCCESS ) return MB_FAILURE;
    tet = entities.size();
    if( tet > 0 && do_create )
    {
        if( create_adjacencies( entities, 2 ) != MB_SUCCESS ) return MB_FAILURE;
        if( create_adjacencies( entities, 1 ) != MB_SUCCESS ) return MB_FAILURE;
    }

    entities.clear();
    if( gMB->get_entities_by_type( 0, MBTRI, entities ) != MB_SUCCESS ) return MB_FAILURE;
    tri = entities.size();
    if( tri > 0 && do_create )
    {
        if( create_adjacencies( entities, 1 ) != MB_SUCCESS ) return MB_FAILURE;
    }

    entities.clear();
    if( gMB->get_entities_by_type( 0, MBEDGE, entities ) != MB_SUCCESS ) return MB_FAILURE;
    edge = entities.size();

    return MB_SUCCESS;
}

Definition at line 116 of file merge_test.cpp.

Referenced by process_bu_auto_merge(), process_merge(), process_mo_auto_merge(), and process_td_auto_merge().

{
    std::cout << "   Vertices: " << node << std::endl;
    cout << "   Edges: " << edge << endl;
    if( quad > 0 ) cout << "   Quad Elements: " << quad << endl;
    if( hex > 0 ) cout << "   Hex Elements: " << hex << endl;
    if( tri > 0 ) cout << "   Tri Elements: " << tri << endl;
    if( tet > 0 ) cout << "   Tet Elements: " << tet << endl;
}

Member Data Documentation

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines