[MOAB-dev] r4214 - MOAB/trunk/src/io
    tautges at mcs.anl.gov 
    tautges at mcs.anl.gov
       
    Wed Oct 13 08:24:23 CDT 2010
    
    
  
Author: tautges
Date: 2010-10-13 08:24:23 -0500 (Wed, 13 Oct 2010)
New Revision: 4214
Modified:
   MOAB/trunk/src/io/Tqdcfr.cpp
Log:
Fixes to enable reading cubit 12 cub files.  Tested on a basic example,
but not extensively.  Removed the check for version, but still reading
the cubit version from the file.
Make check works.
Will add more extensive testing soon, but wanted to get this out for others
to try.
Modified: MOAB/trunk/src/io/Tqdcfr.cpp
===================================================================
--- MOAB/trunk/src/io/Tqdcfr.cpp	2010-10-12 13:13:44 UTC (rev 4213)
+++ MOAB/trunk/src/io/Tqdcfr.cpp	2010-10-13 13:24:23 UTC (rev 4214)
@@ -261,21 +261,13 @@
   if (-1 == md_index) data_version = 1.0;
   else data_version = modelMetaData.metadataEntries[md_index].mdDblValue;
   
-  if (MB_SUCCESS != opts.get_null_option("IGNORE_VERSION")) {
-    md_index = modelMetaData.get_md_entry(2, "CubitVersion");
-    if (md_index >= 0 && !modelMetaData.metadataEntries[md_index].mdStringValue.empty()) {
-      int major, minor;
-      if (2 == sscanf( modelMetaData.metadataEntries[md_index].mdStringValue.c_str(), "%d.%d",
-         &major, &minor)) {
-        if (major > 10 || minor > 2) {
-          readUtilIface->report_error( "Unsupported Cubit version: %d.%d\n", major, minor );
-          return MB_FAILURE;
-        }
-      }
-    }
-  }
+    // get the major/minor cubit version that wrote this file
+  int major = -1, minor = -1;
+  md_index = modelMetaData.get_md_entry(2, "CubitVersion");
+  if (md_index >= 0 && !modelMetaData.metadataEntries[md_index].mdStringValue.empty())
+    sscanf( modelMetaData.metadataEntries[md_index].mdStringValue.c_str(), "%d.%d",
+            &major, &minor);
   
-  
     // ***********************
     // read mesh...
     // ***********************
@@ -517,16 +509,18 @@
   FSEEK(model->modelOffset+nodeseth->memOffset);
   
     // read ids for each entity type
-  unsigned int this_type, num_ents;
+  unsigned int this_type, num_ents, uid;
+  std::vector<char> bc_data;
+  unsigned int num_read = 0;
   std::vector<EntityHandle> ns_entities, excl_entities;
   for (unsigned int i = 0; i < nodeseth->memTypeCt; i++) {
       // get how many and what type
-    FREADI(2);
+    FREADI(2); num_read += 2*sizeof(int);
     this_type = uint_buf[0];
     num_ents = uint_buf[1];
 
       // now get the ids
-    FREADI(num_ents);
+    FREADI(num_ents); num_read += sizeof(int);
    
    
More information about the moab-dev
mailing list