[cig-commits] r21943 - short/3D/PyLith/trunk/libsrc/pylith/meshio

knepley at geodynamics.org knepley at geodynamics.org
Thu Apr 25 11:13:07 PDT 2013


Author: knepley
Date: 2013-04-25 11:13:07 -0700 (Thu, 25 Apr 2013)
New Revision: 21943

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
Log:
Fixed fault output

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2013-04-25 18:09:01 UTC (rev 21942)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5.cc	2013-04-25 18:13:07 UTC (rev 21943)
@@ -129,10 +129,11 @@
     err = VecView(coordVector, _viewer);PYLITH_CHECK_ERROR(err);
     err = PetscViewerHDF5PopGroup(_viewer); PYLITH_CHECK_ERROR(err);
 
-    PetscInt vStart, vEnd, cStart, cEnd, cMax, dof, conesSize, numCorners, numCornersLocal = 0;
+    PetscInt vStart, vEnd, cellHeight, cStart, cEnd, cMax, dof, conesSize, numCorners, numCornersLocal = 0;
 
+    err = DMPlexGetVTKCellHeight(dmMesh, &cellHeight);PYLITH_CHECK_ERROR(err);
     err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);PYLITH_CHECK_ERROR(err);
-    err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);PYLITH_CHECK_ERROR(err);
+    err = DMPlexGetHeightStratum(dmMesh, cellHeight, &cStart, &cEnd);PYLITH_CHECK_ERROR(err);
     err = DMPlexGetHybridBounds(dmMesh, &cMax, PETSC_NULL, PETSC_NULL, PETSC_NULL);PYLITH_CHECK_ERROR(err);
     if (cMax >= 0) {
       cEnd = PetscMin(cEnd, cMax);
@@ -166,7 +167,6 @@
     } else {
       conesSize = (cEnd - cStart)*numCorners;
     } // if/else
-    CHKMEMA; // MATT Why is this here?
 
     PetscIS globalVertexNumbers = NULL;
     const PetscInt *gvertex = NULL;
@@ -188,8 +188,7 @@
       if (label) {
         PetscInt value;
         err = DMPlexGetLabelValue(dmMesh, label, cell, &value);PYLITH_CHECK_ERROR(err);
-        if (value != labelId)
-	  continue;
+        if (value != labelId) continue;
       } // if
 
       err = DMPlexGetTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
@@ -200,9 +199,8 @@
         } // if
       } // for
       err = DMPlexRestoreTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
-      //assert(v == (cell-cStart+1)*numCorners); :TODO: MATT Why is this here?
+      //assert(v == (cell-cStart+1)*numCorners); Would be true without the label check
     } // for
-    CHKMEMA; // MATT why is this here?
     err = VecRestoreArray(cellVec, &vertices);PYLITH_CHECK_ERROR(err);
     err = PetscViewerHDF5PushGroup(_viewer, "/topology");PYLITH_CHECK_ERROR(err);
     err = VecView(cellVec, _viewer);PYLITH_CHECK_ERROR(err);

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2013-04-25 18:09:01 UTC (rev 21942)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2013-04-25 18:13:07 UTC (rev 21943)
@@ -177,9 +177,10 @@
     // Write cells
 
     // Account for censored cells
-    PetscInt cStart, cEnd, cMax, dof, conesSize, numCells, numCorners, numCornersLocal = 0;
+    PetscInt cellHeight, cStart, cEnd, cMax, dof, conesSize, numCells, numCorners, numCornersLocal = 0;
+    err = DMPlexGetVTKCellHeight(dmMesh, &cellHeight);PYLITH_CHECK_ERROR(err);
     err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);PYLITH_CHECK_ERROR(err);
-    err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);PYLITH_CHECK_ERROR(err);
+    err = DMPlexGetHeightStratum(dmMesh, cellHeight, &cStart, &cEnd);PYLITH_CHECK_ERROR(err);
     err = DMPlexGetHybridBounds(dmMesh, &cMax, PETSC_NULL, PETSC_NULL, PETSC_NULL);PYLITH_CHECK_ERROR(err);
     if (cMax >= 0) {
       cEnd = PetscMin(cEnd, cMax);
@@ -211,7 +212,6 @@
     } else {
       conesSize = (cEnd - cStart)*numCorners;
     } // if/else
-    CHKMEMA;
 
     PetscIS globalVertexNumbers = NULL;
     const PetscInt *gvertex = NULL;
@@ -234,8 +234,7 @@
         PetscInt value;
 
         err = DMPlexGetLabelValue(dmMesh, label, cell, &value);PYLITH_CHECK_ERROR(err);
-        if (value != labelId)
-	  continue;
+        if (value != labelId) continue;
       } // if
       err = DMPlexGetTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
       for(p = 0; p < closureSize*2; p += 2) {
@@ -245,9 +244,8 @@
         } // if
       } // for
       err = DMPlexRestoreTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
-      //assert(v == (cell-cStart+1)*numCorners);
+      //assert(v == (cell-cStart+1)*numCorners); Would be true without label check
     } // for
-    CHKMEMA;
     err = ISRestoreIndices(globalVertexNumbers, &gvertex);PYLITH_CHECK_ERROR(err);
     err = VecRestoreArray(cellVec, &vertices);PYLITH_CHECK_ERROR(err);
     err = VecGetSize(cellVec, &numCells);PYLITH_CHECK_ERROR(err);



More information about the CIG-COMMITS mailing list