[MOAB-dev] r3841 - MOAB/trunk/src/io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue May 4 15:16:47 CDT 2010


Author: kraftche
Date: 2010-05-04 15:16:47 -0500 (Tue, 04 May 2010)
New Revision: 3841

Modified:
   MOAB/trunk/src/io/Tqdcfr.cpp
Log:
Fail if asked to read Cub file from Cubit later than 10.2

Modified: MOAB/trunk/src/io/Tqdcfr.cpp
===================================================================
--- MOAB/trunk/src/io/Tqdcfr.cpp	2010-05-04 17:10:25 UTC (rev 3840)
+++ MOAB/trunk/src/io/Tqdcfr.cpp	2010-05-04 20:16:47 UTC (rev 3841)
@@ -263,6 +263,21 @@
   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;
+        }
+      }
+    }
+  }
+  
+  
     // ***********************
     // read mesh...
     // ***********************



























More information about the moab-dev mailing list