[cig-commits] [commit] knepley/upgrade-petsc-interface: MeshIO: Change check for groups to only use original points (4966842)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Oct 31 10:28:10 PDT 2013


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/0e5e1c14aac776849b92647b93cd74cabed9c592...49668423f0d5c65bf25bb9af83a876ba15cadc06

>---------------------------------------------------------------

commit 49668423f0d5c65bf25bb9af83a876ba15cadc06
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Thu Oct 31 12:30:25 2013 -0500

    MeshIO: Change check for groups to only use original points


>---------------------------------------------------------------

49668423f0d5c65bf25bb9af83a876ba15cadc06
 unittests/libtests/meshio/TestMeshIO.cc | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/unittests/libtests/meshio/TestMeshIO.cc b/unittests/libtests/meshio/TestMeshIO.cc
index 51d71ee..f737d4c 100644
--- a/unittests/libtests/meshio/TestMeshIO.cc
+++ b/unittests/libtests/meshio/TestMeshIO.cc
@@ -238,17 +238,22 @@ pylith::meshio::TestMeshIO::_checkVals(const MeshData& data)
     } // for
     std::string groupType = (firstPoint >= cStart && firstPoint < cEnd) ? "cell" : "vertex";
     CPPUNIT_ASSERT_EQUAL(std::string(data.groupTypes[iGroup]), groupType);
-    PetscInt numPoints;
+    PetscInt numPoints, numVertices = 0;
     err = DMPlexGetStratumSize(dmMesh, name, 1, &numPoints);PYLITH_CHECK_ERROR(err);
-    CPPUNIT_ASSERT_EQUAL(data.groupSizes[iGroup], numPoints);
     PetscIS pointIS = NULL;
     const PetscInt *points = NULL;
     const PetscInt offset = ("vertex" == groupType) ? numCells : 0;
     err = DMPlexGetStratumIS(dmMesh, name, 1, &pointIS);PYLITH_CHECK_ERROR(err);
     err = ISGetIndices(pointIS, &points);PYLITH_CHECK_ERROR(err);
     for(PetscInt p = 0; p < numPoints; ++p) {
-      CPPUNIT_ASSERT_EQUAL(data.groups[index++], points[p]-offset);
+      const PetscInt pStart = ("vertex" == groupType) ? vStart : cStart;
+      const PetscInt pEnd   = ("vertex" == groupType) ? vEnd   : cEnd;
+      if ((points[p] >= pStart) && (points[p] < pEnd)) {
+        CPPUNIT_ASSERT_EQUAL(data.groups[index++], points[p]-offset);
+        ++numVertices;
+      }
     } // for
+    CPPUNIT_ASSERT_EQUAL(data.groupSizes[iGroup], numVertices);
     err = ISRestoreIndices(pointIS, &points);PYLITH_CHECK_ERROR(err);
     err = ISDestroy(&pointIS);PYLITH_CHECK_ERROR(err);
   } // for



More information about the CIG-COMMITS mailing list