Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
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

◆ GeomHeader()

moab::Tqdcfr::GeomHeader::GeomHeader ( )

Definition at line 2899 of file Tqdcfr.cpp.

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

Member Function Documentation

◆ print()

void moab::Tqdcfr::GeomHeader::print ( )

Definition at line 2905 of file Tqdcfr.cpp.

2906 {
2907  std::cout << "geomID = " << geomID << std::endl;
2908  std::cout << "nodeCt = " << nodeCt << std::endl;
2909  std::cout << "nodeOffset = " << nodeOffset << std::endl;
2910  std::cout << "elemCt = " << elemCt << std::endl;
2911  std::cout << "elemOffset = " << elemOffset << std::endl;
2912  std::cout << "elemTypeCt = " << elemTypeCt << std::endl;
2913  std::cout << "elemLength = " << elemLength << std::endl;
2914  std::cout << "setHandle = " << setHandle << std::endl;
2915 }

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

◆ read_info_header()

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.

1880 {
1881  geom_headers = new GeomHeader[info.numEntities];
1882  instance->FSEEK( model_offset + info.tableOffset );
1883  int dum_int;
1884  ErrorCode result;
1885 
1886  if( 0 == instance->categoryTag )
1887  {
1888  static const char val[CATEGORY_TAG_SIZE] = { 0 };
1889  result = instance->mdbImpl->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE, MB_TYPE_OPAQUE,
1890  instance->categoryTag, MB_TAG_SPARSE | MB_TAG_CREAT, val );
1891  if( MB_SUCCESS != result ) return result;
1892  }
1893 
1894  for( unsigned int i = 0; i < info.numEntities; i++ )
1895  {
1896  instance->FREADI( 8 );
1897  geom_headers[i].nodeCt = instance->uint_buf[0];
1898  geom_headers[i].nodeOffset = instance->uint_buf[1];
1899  geom_headers[i].elemCt = instance->uint_buf[2];
1900  geom_headers[i].elemOffset = instance->uint_buf[3];
1901  geom_headers[i].elemTypeCt = instance->uint_buf[4];
1902  geom_headers[i].elemLength = instance->uint_buf[5];
1903  geom_headers[i].geomID = instance->uint_buf[6];
1904 
1905  // Don't represent in MOAB if no mesh
1906  if( geom_headers[i].nodeCt == 0 && geom_headers[i].elemCt == 0 ) continue;
1907 
1908  // Create an entity set for this entity
1909  result = instance->create_set( geom_headers[i].setHandle );
1910  if( MB_SUCCESS != result ) return result;
1911 
1912  // Set the dimension to -1; will have to reset later, after elements are read
1913  dum_int = -1;
1914  result = instance->mdbImpl->tag_set_data( instance->geomTag, &( geom_headers[i].setHandle ), 1, &dum_int );
1915  if( MB_SUCCESS != result ) return result;
1916 
1917  // Set a unique id tag
1918  result = instance->mdbImpl->tag_set_data( instance->uniqueIdTag, &( geom_headers[i].setHandle ), 1,
1919  &( geom_headers[i].geomID ) );
1920  if( MB_SUCCESS != result ) return result;
1921 
1922  // Put the set and uid into a map for later
1923  instance->uidSetMap[geom_headers[i].geomID] = geom_headers[i].setHandle;
1924  }
1925 
1926  // Now get the dimensions of elements for each geom entity
1927  for( unsigned int i = 0; i < info.numEntities; i++ )
1928  {
1929  if( geom_headers[i].elemTypeCt == 0 ) continue;
1930  instance->FSEEK( model_offset + geom_headers[i].elemOffset );
1931  for( unsigned int j = 0; j < geom_headers[i].elemTypeCt; j++ )
1932  {
1933  // For this elem type, get the type, nodes per elem, num elems
1934  instance->FREADI( 3 );
1935  int int_type = instance->uint_buf[0];
1936  int nodes_per_elem = instance->uint_buf[1];
1937  int num_elem = instance->uint_buf[2];
1938  EntityType elem_type = mp_type_to_mb_type[int_type];
1939  geom_headers[i].maxDim = std::max( geom_headers[i].maxDim, (int)CN::Dimension( elem_type ) );
1940  if( j < geom_headers[i].elemTypeCt - 1 )
1941  {
1942  int num_skipped_ints = num_elem + num_elem * nodes_per_elem;
1943  if( major >= 14 ) num_skipped_ints += num_elem;
1944  instance->FREADI( num_skipped_ints );
1945  }
1946  }
1947  }
1948 
1949  return MB_SUCCESS;
1950 }

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().

Member Data Documentation

◆ elemCt

unsigned int moab::Tqdcfr::GeomHeader::elemCt

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

◆ elemLength

unsigned int moab::Tqdcfr::GeomHeader::elemLength

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

◆ elemOffset

unsigned int moab::Tqdcfr::GeomHeader::elemOffset

Definition at line 121 of file Tqdcfr.hpp.

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

◆ elemTypeCt

unsigned int moab::Tqdcfr::GeomHeader::elemTypeCt

Definition at line 121 of file Tqdcfr.hpp.

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

◆ geomID

unsigned int moab::Tqdcfr::GeomHeader::geomID

Definition at line 121 of file Tqdcfr.hpp.

Referenced by read_info_header().

◆ maxDim

int moab::Tqdcfr::GeomHeader::maxDim

Definition at line 123 of file Tqdcfr.hpp.

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

◆ nodeCt

unsigned int moab::Tqdcfr::GeomHeader::nodeCt

Definition at line 121 of file Tqdcfr.hpp.

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

◆ nodeOffset

unsigned int moab::Tqdcfr::GeomHeader::nodeOffset

Definition at line 121 of file Tqdcfr.hpp.

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

◆ setHandle

EntityHandle moab::Tqdcfr::GeomHeader::setHandle

The documentation for this class was generated from the following files: