[cig-commits] r18127 - short/3D/PyLith/trunk/libsrc/problems

knepley at geodynamics.org knepley at geodynamics.org
Tue Mar 22 18:11:31 PDT 2011


Author: knepley
Date: 2011-03-22 18:11:31 -0700 (Tue, 22 Mar 2011)
New Revision: 18127

Modified:
   short/3D/PyLith/trunk/libsrc/problems/Solver.cc
Log:
Fix for Matrix reference count

Modified: short/3D/PyLith/trunk/libsrc/problems/Solver.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/Solver.cc	2011-03-23 00:59:17 UTC (rev 18126)
+++ short/3D/PyLith/trunk/libsrc/problems/Solver.cc	2011-03-23 01:11:31 UTC (rev 18127)
@@ -106,7 +106,6 @@
   assert(0 != formulation);
 
   PetscMat jacobianMat = jacobian.matrix();
-  _jacobianPre = jacobianMat;
   // Make global preconditioner matrix
   const ALE::Obj<RealSection>& solutionSection = fields.solution().section();
   assert(!solutionSection.isNull());
@@ -123,6 +122,11 @@
     _ctx.A              = jacobianMat;
     _ctx.faultFieldName = "3";
     _ctx.faultA         = _precondMatrix;
+  } else {
+    PetscErrorCode err;
+
+    _jacobianPre = jacobianMat;
+    err = PetscObjectReference((PetscObject) jacobianMat);CHECK_PETSC_ERROR(err);
   }
 
   _formulation = formulation;



More information about the CIG-COMMITS mailing list