[cig-commits] r20887 - in short/3D/PyLith/trunk: libsrc/pylith/topology unittests/libtests/bc

knepley at geodynamics.org knepley at geodynamics.org
Tue Oct 23 08:22:41 PDT 2012


Author: knepley
Date: 2012-10-23 08:22:41 -0700 (Tue, 23 Oct 2012)
New Revision: 20887

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
   short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
Log:
Now only AbsorbingDampers and Neumann tests fail

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2012-10-23 14:46:46 UTC (rev 20886)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2012-10-23 15:22:41 UTC (rev 20887)
@@ -122,6 +122,7 @@
   PetscSection   s;
   PetscErrorCode err;
 
+  _metadata["default"] = src._metadata["default"];
   err = DMGetDefaultSection(src._dm, &s);CHECK_PETSC_ERROR(err);
   for(PetscInt f = 0; f < numFields; ++f) {
     const char *name;

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc	2012-10-23 14:46:46 UTC (rev 20886)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc	2012-10-23 15:22:41 UTC (rev 20887)
@@ -173,28 +173,36 @@
   const PylithScalar t = _data->tResidual;
   bc.integrateResidual(residual, t, &fields);
 
-  const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
-  CPPUNIT_ASSERT(!sieveMesh.isNull());
-  CPPUNIT_ASSERT(!sieveMesh->depthStratum(0).isNull());
+  DM             dmMesh = mesh.dmMesh();
+  PetscInt       vStart, vEnd;
+  PetscErrorCode err;
 
+  CPPUNIT_ASSERT(dmMesh);
+  err = DMComplexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
+
   const PylithScalar* valsE = _data->residual;
-  const int totalNumVertices = sieveMesh->depthStratum(0)->size();
+  const int totalNumVertices = vEnd-vStart;
   const int sizeE = spaceDim * totalNumVertices;
 
-  const ALE::Obj<RealSection>& residualSection = residual.section();
-  CPPUNIT_ASSERT(!residualSection.isNull());
-  const PylithScalar* vals = residualSection->restrictSpace();
-  const int size = residualSection->sizeWithBC();
+  PetscSection residualSection = residual.petscSection();
+  Vec          residualVec     = residual.localVector();
+  PetscScalar *vals;
+  PetscInt     size;
+
+  CPPUNIT_ASSERT(residualSection);
+  err = PetscSectionGetStorageSize(residualSection, &size);CHECK_PETSC_ERROR(err);
   CPPUNIT_ASSERT_EQUAL(sizeE, size);
 
   //residual.view("RESIDUAL");
 
   const PylithScalar tolerance = 1.0e-06;
+  err = VecGetArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
   for (int i=0; i < size; ++i)
     if (fabs(valsE[i]) > 1.0)
       CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valsE[i], tolerance);
     else
       CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[i], vals[i], tolerance);
+  err = VecRestoreArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
 } // testIntegrateResidual
 
 // ----------------------------------------------------------------------



More information about the CIG-COMMITS mailing list