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

knepley at geodynamics.org knepley at geodynamics.org
Tue Oct 23 19:27:33 PDT 2012


Author: knepley
Date: 2012-10-23 19:27:33 -0700 (Tue, 23 Oct 2012)
New Revision: 20893

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc
   short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc
Log:
Fixed AbsorbingDampers Jacobian

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2012-10-24 00:51:43 UTC (rev 20892)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2012-10-24 02:27:33 UTC (rev 20893)
@@ -605,10 +605,14 @@
   assert(valueSection);assert(valueVec);
 
   const topology::Field<topology::Mesh>& solution = fields->solution();
-  PetscSection solutionSection = solution.petscSection(), solutionSubsection;
+  PetscSection solutionSection = solution.petscSection(), solutionGlobalSection, solutionSubsection, solutionGlobalSubsection;
   Vec          solutionVec     = solution.localVector();
+  PetscSF      sf;
   assert(solutionSection);assert(solutionVec);
-  err = PetscSectionCreateSubmeshSection(solutionSection, subpointMap, &solutionSubsection);
+  err = PetscSectionCreateSubmeshSection(solutionSection, subpointMap, &solutionSubsection);CHECK_PETSC_ERROR(err);
+  err = DMGetPointSF(solution.dmMesh(), &sf);CHECK_PETSC_ERROR(err);
+  err = PetscSectionCreateGlobalSection(solutionSection, sf, PETSC_FALSE, &solutionGlobalSection);CHECK_PETSC_ERROR(err);
+  err = PetscSectionCreateSubmeshSection(solutionGlobalSection, subpointMap, &solutionGlobalSubsection);CHECK_PETSC_ERROR(err);
 
   // Get sparse matrix
   const PetscMat jacobianMat = jacobian->matrix();
@@ -698,7 +702,7 @@
 #endif
     
     // Assemble cell contribution into PETSc Matrix
-    err = DMComplexMatSetClosure(subMesh, solutionSubsection, PETSC_NULL, jacobianMat, c, &_cellMatrix[0], ADD_VALUES);
+    err = DMComplexMatSetClosure(subMesh, solutionSubsection, solutionGlobalSubsection, jacobianMat, c, &_cellMatrix[0], ADD_VALUES);
     CHECK_PETSC_ERROR_MSG(err, "Update to PETSc Mat failed.");
 
 #if defined(DETAILED_EVENT_LOGGING)
@@ -707,6 +711,8 @@
   } // for
   err = VecRestoreArray(valueVec, &dampingArray);CHECK_PETSC_ERROR(err);
   err = PetscSectionDestroy(&solutionSubsection);CHECK_PETSC_ERROR(err);
+  err = PetscSectionDestroy(&solutionGlobalSection);CHECK_PETSC_ERROR(err);
+  err = PetscSectionDestroy(&solutionGlobalSubsection);CHECK_PETSC_ERROR(err);
 
 #if !defined(DETAILED_EVENT_LOGGING)
   PetscLogFlops((cEnd-cStart)*numQuadPts*(3+numBasis*(1+numBasis*(1+2*spaceDim))));

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc	2012-10-24 00:51:43 UTC (rev 20892)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc	2012-10-24 02:27:33 UTC (rev 20893)
@@ -116,6 +116,8 @@
 void 
 pylith::topology::Mesh::nondimensionalize(const spatialdata::units::Nondimensional& normalizer)
 { // initialize
+  //TODO Change DM coordinates here, store lengthScale for output routines
+
   // Get coordinates (currently dimensioned).
   assert(!_mesh.isNull());
   const ALE::Obj<RealSection>& coordsSection =

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc	2012-10-24 00:51:43 UTC (rev 20892)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc	2012-10-24 02:27:33 UTC (rev 20893)
@@ -220,7 +220,6 @@
 { // testIntegrateJacobian
   CPPUNIT_ASSERT(0 != _data);
 
-  CPPUNIT_ASSERT(0);
   topology::Mesh mesh;
   AbsorbingDampers bc;
   topology::SolutionFields fields(mesh);



More information about the CIG-COMMITS mailing list