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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Fri Apr 16 13:35:14 CDT 2010


Author: tautges
Date: 2010-04-16 13:35:14 -0500 (Fri, 16 Apr 2010)
New Revision: 3784

Modified:
   MOAB/trunk/src/io/WriteVtk.cpp
Log:
Small change; if vtk doesn't support a type with one number of vertices, 
try it with one fewer vertex.



Modified: MOAB/trunk/src/io/WriteVtk.cpp
===================================================================
--- MOAB/trunk/src/io/WriteVtk.cpp	2010-04-15 20:48:34 UTC (rev 3783)
+++ MOAB/trunk/src/io/WriteVtk.cpp	2010-04-16 18:35:14 UTC (rev 3784)
@@ -284,10 +284,15 @@
       // Get VTK type
     const VtkElemType* vtk_type = VtkUtil::get_vtk_type( type, conn_len );
     if (!vtk_type) {
-      writeTool->report_error( "Vtk file format does not support elements "
-        "of type %s (%d) with %d nodes.\n", CN::EntityTypeName(type), 
-        (int)type, conn_len);
-      return MB_FAILURE;
+        // try connectivity with 1 fewer node
+      vtk_type = VtkUtil::get_vtk_type( type, conn_len-1 );
+      if (vtk_type) conn_len--;
+      else {
+        writeTool->report_error( "Vtk file format does not support elements "
+                                 "of type %s (%d) with %d nodes.\n", CN::EntityTypeName(type), 
+                                 (int)type, conn_len);
+        return MB_FAILURE;
+      }
     }
 
       // Get IDs from vertex handles





























More information about the moab-dev mailing list