Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::Tqdcfr::GeomHeader Class Reference

#include <Tqdcfr.hpp>

Public Member Functions

void print ()
 GeomHeader ()

Static Public Member Functions

static ErrorCode read_info_header (const unsigned int model_offset, const FEModelHeader::ArrayInfo &info, Tqdcfr *instance, GeomHeader *&entity_headers)

Public Attributes

unsigned int geomID
unsigned int nodeCt
unsigned int nodeOffset
unsigned int elemCt
unsigned int elemOffset
unsigned int elemTypeCt
unsigned int elemLength
int maxDim
EntityHandle setHandle

Detailed Description

Definition at line 118 of file Tqdcfr.hpp.


Constructor & Destructor Documentation

Definition at line 2899 of file Tqdcfr.cpp.

    : geomID( 0 ), nodeCt( 0 ), nodeOffset( 0 ), elemCt( 0 ), elemOffset( 0 ), elemTypeCt( 0 ), elemLength( 0 ),
      maxDim( 0 ), setHandle( 0 )
{
}

Member Function Documentation

Definition at line 2905 of file Tqdcfr.cpp.

Referenced by moab::Tqdcfr::ModelEntry::print_geom_headers().

{
    std::cout << "geomID = " << geomID << std::endl;
    std::cout << "nodeCt = " << nodeCt << std::endl;
    std::cout << "nodeOffset = " << nodeOffset << std::endl;
    std::cout << "elemCt = " << elemCt << std::endl;
    std::cout << "elemOffset = " << elemOffset << std::endl;
    std::cout << "elemTypeCt = " << elemTypeCt << std::endl;
    std::cout << "elemLength = " << elemLength << std::endl;
    std::cout << "setHandle = " << setHandle << std::endl;
}
ErrorCode moab::Tqdcfr::GeomHeader::read_info_header ( const unsigned int  model_offset,
const FEModelHeader::ArrayInfo info,
Tqdcfr instance,
Tqdcfr::GeomHeader *&  geom_headers 
) [static]

Definition at line 1876 of file Tqdcfr.cpp.

References CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE, moab::Tqdcfr::categoryTag, moab::Tqdcfr::create_set(), moab::CN::Dimension(), elemCt, elemLength, elemOffset, elemTypeCt, ErrorCode, moab::Tqdcfr::FREADI(), moab::Tqdcfr::FSEEK(), geomID, moab::Tqdcfr::geomTag, moab::major, maxDim, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_OPAQUE, moab::Tqdcfr::mdbImpl, moab::Tqdcfr::mp_type_to_mb_type, nodeCt, nodeOffset, moab::Tqdcfr::FEModelHeader::ArrayInfo::numEntities, setHandle, moab::Tqdcfr::FEModelHeader::ArrayInfo::tableOffset, moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), moab::Tqdcfr::uidSetMap, moab::Tqdcfr::uint_buf, and moab::Tqdcfr::uniqueIdTag.

Referenced by moab::Tqdcfr::ModelEntry::read_header_info().

{
    geom_headers = new GeomHeader[info.numEntities];
    instance->FSEEK( model_offset + info.tableOffset );
    int dum_int;
    ErrorCode result;

    if( 0 == instance->categoryTag )
    {
        static const char val[CATEGORY_TAG_SIZE] = { 0 };
        result = instance->mdbImpl->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE, MB_TYPE_OPAQUE,
                                                    instance->categoryTag, MB_TAG_SPARSE | MB_TAG_CREAT, val );
        if( MB_SUCCESS != result ) return result;
    }

    for( unsigned int i = 0; i < info.numEntities; i++ )
    {
        instance->FREADI( 8 );
        geom_headers[i].nodeCt     = instance->uint_buf[0];
        geom_headers[i].nodeOffset = instance->uint_buf[1];
        geom_headers[i].elemCt     = instance->uint_buf[2];
        geom_headers[i].elemOffset = instance->uint_buf[3];
        geom_headers[i].elemTypeCt = instance->uint_buf[4];
        geom_headers[i].elemLength = instance->uint_buf[5];
        geom_headers[i].geomID     = instance->uint_buf[6];

        // Don't represent in MOAB if no mesh
        if( geom_headers[i].nodeCt == 0 && geom_headers[i].elemCt == 0 ) continue;

        // Create an entity set for this entity
        result = instance->create_set( geom_headers[i].setHandle );
        if( MB_SUCCESS != result ) return result;

        // Set the dimension to -1; will have to reset later, after elements are read
        dum_int = -1;
        result  = instance->mdbImpl->tag_set_data( instance->geomTag, &( geom_headers[i].setHandle ), 1, &dum_int );
        if( MB_SUCCESS != result ) return result;

        // Set a unique id tag
        result = instance->mdbImpl->tag_set_data( instance->uniqueIdTag, &( geom_headers[i].setHandle ), 1,
                                                  &( geom_headers[i].geomID ) );
        if( MB_SUCCESS != result ) return result;

        // Put the set and uid into a map for later
        instance->uidSetMap[geom_headers[i].geomID] = geom_headers[i].setHandle;
    }

    // Now get the dimensions of elements for each geom entity
    for( unsigned int i = 0; i < info.numEntities; i++ )
    {
        if( geom_headers[i].elemTypeCt == 0 ) continue;
        instance->FSEEK( model_offset + geom_headers[i].elemOffset );
        for( unsigned int j = 0; j < geom_headers[i].elemTypeCt; j++ )
        {
            // For this elem type, get the type, nodes per elem, num elems
            instance->FREADI( 3 );
            int int_type           = instance->uint_buf[0];
            int nodes_per_elem     = instance->uint_buf[1];
            int num_elem           = instance->uint_buf[2];
            EntityType elem_type   = mp_type_to_mb_type[int_type];
            geom_headers[i].maxDim = std::max( geom_headers[i].maxDim, (int)CN::Dimension( elem_type ) );
            if( j < geom_headers[i].elemTypeCt - 1 )
            {
                int num_skipped_ints = num_elem + num_elem * nodes_per_elem;
                if( major >= 14 ) num_skipped_ints += num_elem;
                instance->FREADI( num_skipped_ints );
            }
        }
    }

    return MB_SUCCESS;
}

Member Data Documentation

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by moab::Tqdcfr::read_elements(), and read_info_header().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by moab::Tqdcfr::read_elements(), and read_info_header().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header(), and moab::Tqdcfr::read_nodes().

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header(), and moab::Tqdcfr::read_nodes().

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