[cig-commits] [commit] baagaard/add-release-2.0.3, baagaard/add-release-2.1.0, baagaard/dynrup-new-lagrange, baagaard/feature-output-station-names, baagaard/feature-progress-monitor, baagaard/fix-custom-faultpc, baagaard/fix-error-messages, baagaard/fix-faults-intersect, baagaard/fix-friction-initial-state, baagaard/update-autoconf, knepley/feature-petsc-fe, knepley/fix-dm-composition, knepley/upgrade-petsc-3.5, knepley/upgrade-petsc-master, maint, master, next, willic3/fix-plasticity: Solver: Remove DM from Vecs used in MatNullSpace - This avoids a reference cycle (6753495)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 15:43:17 PST 2014


Repository : https://github.com/geodynamics/pylith

On branches: baagaard/add-release-2.0.3,baagaard/add-release-2.1.0,baagaard/dynrup-new-lagrange,baagaard/feature-output-station-names,baagaard/feature-progress-monitor,baagaard/fix-custom-faultpc,baagaard/fix-error-messages,baagaard/fix-faults-intersect,baagaard/fix-friction-initial-state,baagaard/update-autoconf,knepley/feature-petsc-fe,knepley/fix-dm-composition,knepley/upgrade-petsc-3.5,knepley/upgrade-petsc-master,maint,master,next,willic3/fix-plasticity
Link       : https://github.com/geodynamics/pylith/compare/f33c75b19fd60eedb2a3405db76a1fee333bb1d7...5b6d812b1612809fea3bd331c4e5af98c25a536a

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

commit 6753495fc98dd431738ab42abd96f19b223fb39f
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Wed Jun 25 17:16:01 2014 -0700

    Solver: Remove DM from Vecs used in MatNullSpace
    - This avoids a reference cycle


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

6753495fc98dd431738ab42abd96f19b223fb39f
 libsrc/pylith/problems/Solver.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libsrc/pylith/problems/Solver.cc b/libsrc/pylith/problems/Solver.cc
index ad906fc..fa9f6eb 100644
--- a/libsrc/pylith/problems/Solver.cc
+++ b/libsrc/pylith/problems/Solver.cc
@@ -178,6 +178,8 @@ pylith::problems::Solver::_createNullSpace(const topology::SolutionFields& field
     const int m = (spaceDim * (spaceDim + 1)) / 2;
     for(int i = 0; i < m; ++i) {
       err = VecDuplicate(solutionGlobalVec, &mode[i]);PYLITH_CHECK_ERROR(err);
+      // This is necessary to avoid circular references when we compose this MatNullSpace with a field in the DM
+      err = VecSetDM(mode[i], NULL);PYLITH_CHECK_ERROR(err);
     } // for
     // :KLUDGE: Assume P1
     for(int d = 0; d < spaceDim; ++d) {



More information about the CIG-COMMITS mailing list