[cig-commits] r19295 - short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio

brad at geodynamics.org brad at geodynamics.org
Tue Dec 13 17:15:06 PST 2011


Author: brad
Date: 2011-12-13 17:15:05 -0800 (Tue, 13 Dec 2011)
New Revision: 19295

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc
Log:
Fixed output of mesh cells for boundary mesh. Use depth of 1 for cells rather than relying on VTKViewer to pick desired depth.

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc	2011-12-13 23:50:47 UTC (rev 19294)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc	2011-12-14 01:15:05 UTC (rev 19295)
@@ -133,15 +133,16 @@
     err = VTKViewer::writeVertices(sieveMesh, _viewer);
     CHECK_PETSC_ERROR(err);
     //std::cout << "Wrote vertices for " << filename << std::endl;
-    if (0 == label) {
-      err = VTKViewer::writeElements(sieveMesh, _viewer);
-      CHECK_PETSC_ERROR(err);
-    } else {
-      const std::string labelName = 
-	(sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
-      err = VTKViewer::writeElements(sieveMesh, label, labelId, labelName, 0, _viewer);      
-      CHECK_PETSC_ERROR(err);
-    } // if
+
+    const int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
+    const int depth = (!label) ? cellDepth : labelId;
+    const std::string cLabelName = (!label) ?
+      ((sieveMesh->hasLabel("censored depth")) ?
+       "censored depth" : "depth") : label;
+    const std::string vLabelName = 
+      (sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
+    err = VTKViewer::writeElements(sieveMesh, cLabelName, depth, vLabelName, 0,
+				   _viewer); CHECK_PETSC_ERROR(err);
     //std::cout << "Wrote elements for " << filename << std::endl;
 
     _wroteVertexHeader = false;



More information about the CIG-COMMITS mailing list