[cig-commits] r21953 - short/3D/PyLith/trunk/unittests/libtests/meshio

brad at geodynamics.org brad at geodynamics.org
Fri Apr 26 12:49:10 PDT 2013


Author: brad
Date: 2013-04-26 12:49:09 -0700 (Fri, 26 Apr 2013)
New Revision: 21953

Modified:
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
Log:
Simpler implementation for checking cells (get cone).

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc	2013-04-26 14:51:44 UTC (rev 21952)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc	2013-04-26 19:49:09 UTC (rev 21953)
@@ -164,21 +164,18 @@
   PetscErrorCode err = 0;
   CPPUNIT_ASSERT_EQUAL(numCellsE, cellsStratum.size());
   for (PetscInt c = cStart, index = 0; c < cEnd; ++c) {
-    PetscInt *closure = NULL;
-    PetscInt closureSize = 0;
-    err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
-    int count = 0;
-    for (int i=0; i < closureSize; ++i) {
-      const PetscInt p = closure[2*i];
-      if (p >= vStart && p < vEnd) {
-	const int coneE = numCellsE+index;
-	CPPUNIT_ASSERT_EQUAL(coneE, p);
-	++count;
-	++index;
-      } // if
+    const PetscInt *cone = NULL;
+    PetscInt coneSize = 0;
+
+    err = DMPlexGetConeSize(dmMesh, c, &coneSize);PYLITH_CHECK_ERROR(err);
+    err = DMPlexGetCone(dmMesh, c, &cone);PYLITH_CHECK_ERROR(err);
+
+    CPPUNIT_ASSERT_EQUAL(numCornersE, coneSize);
+
+    for (PetscInt p = 0; p < coneSize; ++p, ++index) {
+      const int coneE = numCellsE+index;
+      CPPUNIT_ASSERT_EQUAL(coneE, cone[p]);
     } // for
-    CPPUNIT_ASSERT_EQUAL(numCornersE, count);
-    err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
   } // for
   
   PYLITH_METHOD_END;



More information about the CIG-COMMITS mailing list