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

brad at geodynamics.org brad at geodynamics.org
Tue May 7 12:00:15 PDT 2013


Author: brad
Date: 2013-05-07 12:00:15 -0700 (Tue, 07 May 2013)
New Revision: 21997

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc
Log:
Fixed bug in cell avg when using label arg.

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc	2013-05-07 17:56:39 UTC (rev 21996)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc	2013-05-07 19:00:15 UTC (rev 21997)
@@ -111,13 +111,12 @@
     if (cMax >= 0) {cEnd = PetscMin(cEnd, cMax);}
     numCells = cEnd - cStart;
   } else {
-    const PetscInt *cells;
+    const PetscInt *cells = NULL;
     err = DMPlexGetStratumIS(dmMesh, label, 1, &cellIS);PYLITH_CHECK_ERROR(err);
     err = ISGetSize(cellIS, &numCells);PYLITH_CHECK_ERROR(err);
     err = ISGetIndices(cellIS, &cells);PYLITH_CHECK_ERROR(err);
     cStart = cells[0];
     err = ISRestoreIndices(cellIS, &cells);PYLITH_CHECK_ERROR(err);
-    err = ISDestroy(&cellIS);PYLITH_CHECK_ERROR(err);
   } // if
 
   topology::VecVisitorMesh fieldInVisitor(fieldIn);
@@ -192,7 +191,6 @@
       } // for
     } // for
     err = ISRestoreIndices(cellIS, &cells);PYLITH_CHECK_ERROR(err);
-    err = ISDestroy(&cellIS);PYLITH_CHECK_ERROR(err);
   } else {
     for(PetscInt c = cStart; c < cEnd; ++c) {
       const PetscInt ioff = fieldInVisitor.sectionOffset(c);
@@ -208,6 +206,7 @@
       } // for
     } // for
   } // if/else
+  err = ISDestroy(&cellIS);PYLITH_CHECK_ERROR(err);
   PetscLogFlops(numCells * numQuadPts*fiberDim*3);
 
   PYLITH_METHOD_RETURN(*_fieldAvg);



More information about the CIG-COMMITS mailing list