moab
moab::Tqdcfr::GeomHeader Class Reference

#include <Tqdcfr.hpp>

List of all members.

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 121 of file Tqdcfr.hpp.


Constructor & Destructor Documentation

Definition at line 2750 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 2755 of file Tqdcfr.cpp.

{
  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 1760 of file Tqdcfr.cpp.

{
  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 124 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.

Definition at line 127 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.

Definition at line 124 of file Tqdcfr.hpp.


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