[MOAB-dev] r4391 - MOAB/trunk/tools/vtkMOABReader

tautges at mcs.anl.gov tautges at mcs.anl.gov
Mon Dec 20 15:36:33 CST 2010


Author: tautges
Date: 2010-12-20 15:36:33 -0600 (Mon, 20 Dec 2010)
New Revision: 4391

Modified:
   MOAB/trunk/tools/vtkMOABReader/vtkMOABMesh.cpp
   MOAB/trunk/tools/vtkMOABReader/vtkMOABReader.xml
Log:
Fix some init issues, and a buggy assert on vtk ids.



Modified: MOAB/trunk/tools/vtkMOABReader/vtkMOABMesh.cpp
===================================================================
--- MOAB/trunk/tools/vtkMOABReader/vtkMOABMesh.cpp	2010-12-20 21:30:58 UTC (rev 4390)
+++ MOAB/trunk/tools/vtkMOABReader/vtkMOABMesh.cpp	2010-12-20 21:36:33 UTC (rev 4391)
@@ -213,7 +213,7 @@
       if (MB_TYPE_DOUBLE == dtype) {
         ddata = (double*)data;
         for (int i = 0; i < count; i++) {
-          assert(-1 != vids[i]);
+          assert(-1 < vids[i] && vids[i] <= maxCellId);
           if (!has_default || ddata[i] != ddef)
             dbl_array->InsertValue(vids[i], ddata[i]);
         }
@@ -221,7 +221,7 @@
       else if (MB_TYPE_INTEGER == dtype) {
         idata = (int*)data;
         for (int i = 0; i < count; i++) {
-          assert(-1 != vids[i]);
+          assert(-1 < vids[i] && vids[i] <= maxCellId);
           if (!has_default || idata[i] != idef)
             int_array->InsertValue(vids[i], idata[i]);
         }
@@ -245,7 +245,7 @@
       if (MB_TYPE_DOUBLE == dtype) {
         ddata = (double*)data;
         for (int i = 0; i < count; i++) {
-          assert(-1 != vids[i]);
+          assert(-1 < vids[i] && vids[i] <= maxCellId);
           if (!has_default || ddata[i] != ddef)
             dbl_array->InsertValue(vids[i], ddata[i]);
         }
@@ -253,7 +253,7 @@
       else if (MB_TYPE_INTEGER == dtype) {
         idata = (int*)data;
         for (int i = 0; i < count; i++) {
-          assert(-1 != vids[i]);
+          assert(-1 < vids[i] && vids[i] <= maxCellId);
           if (!has_default || idata[i] != idef)
             int_array->InsertValue(vids[i], idata[i]);
         }
@@ -295,7 +295,7 @@
       if (MB_TYPE_DOUBLE == dtype) {
         ddata = (double*)data;
         for (int i = 0; i < count; i++) {
-          assert(vids[i] == i);
+          assert(vids[i] >= 0 && vids[i] <= maxPointId);
           if (!has_default || ddata[i] != ddef)
             dbl_array->InsertValue(vids[i], ddata[i]);
         }
@@ -303,7 +303,7 @@
       else if (MB_TYPE_INTEGER == dtype) {


More information about the moab-dev mailing list