[cig-commits] [commit] knepley/upgrade-petsc-interface: Upgrade to latest petsc - KSPSetOperators() changed (40ec07c)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Feb 28 13:42:40 PST 2014


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/24efc9fb9b5b90f87986cf32eb8135576abc4fcb...40ec07ced2073ebe68dd6602550e9b505fe2fbf2

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

commit 40ec07ced2073ebe68dd6602550e9b505fe2fbf2
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Fri Feb 28 15:42:42 2014 -0600

    Upgrade to latest petsc
    - KSPSetOperators() changed


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

40ec07ced2073ebe68dd6602550e9b505fe2fbf2
 libsrc/pylith/faults/FaultCohesiveDyn.cc  | 2 +-
 libsrc/pylith/problems/SolverLinear.cc    | 6 +-----
 libsrc/pylith/problems/SolverNonlinear.cc | 5 ++---
 libsrc/pylith/problems/SolverNonlinear.hh | 6 ++----
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/libsrc/pylith/faults/FaultCohesiveDyn.cc b/libsrc/pylith/faults/FaultCohesiveDyn.cc
index 464cc8f..c63c78e 100644
--- a/libsrc/pylith/faults/FaultCohesiveDyn.cc
+++ b/libsrc/pylith/faults/FaultCohesiveDyn.cc
@@ -1897,7 +1897,7 @@ pylith::faults::FaultCohesiveDyn::_sensitivitySolve(void)
 
   PetscErrorCode err = 0;
   const PetscMat jacobianMat = _jacobian->matrix();
-  err = KSPSetOperators(_ksp, jacobianMat, jacobianMat, DIFFERENT_NONZERO_PATTERN);PYLITH_CHECK_ERROR(err);
+  err = KSPSetOperators(_ksp, jacobianMat, jacobianMat);PYLITH_CHECK_ERROR(err);
 
   const PetscVec residualVec = residual.globalVector();
   const PetscVec solutionVec = solution.globalVector();
diff --git a/libsrc/pylith/problems/SolverLinear.cc b/libsrc/pylith/problems/SolverLinear.cc
index f063210..7feec68 100644
--- a/libsrc/pylith/problems/SolverLinear.cc
+++ b/libsrc/pylith/problems/SolverLinear.cc
@@ -118,11 +118,7 @@ pylith::problems::SolverLinear::solve(topology::Field* solution,
 
   PetscErrorCode err = 0;
   const PetscMat jacobianMat = jacobian->matrix();
-  if (!jacobian->valuesChanged()) {
-    err = KSPSetOperators(_ksp, jacobianMat, jacobianMat, SAME_PRECONDITIONER);PYLITH_CHECK_ERROR(err);
-  } else {
-    err = KSPSetOperators(_ksp, jacobianMat, jacobianMat, DIFFERENT_NONZERO_PATTERN);PYLITH_CHECK_ERROR(err);
-  } // else
+  err = KSPSetOperators(_ksp, jacobianMat, jacobianMat);PYLITH_CHECK_ERROR(err);
   jacobian->resetValuesChanged();
 
   const PetscVec residualVec = residual.globalVector();
diff --git a/libsrc/pylith/problems/SolverNonlinear.cc b/libsrc/pylith/problems/SolverNonlinear.cc
index 63f7aa6..8cf90d4 100644
--- a/libsrc/pylith/problems/SolverNonlinear.cc
+++ b/libsrc/pylith/problems/SolverNonlinear.cc
@@ -193,9 +193,8 @@ pylith::problems::SolverNonlinear::reformResidual(PetscSNES snes,
 PetscErrorCode
 pylith::problems::SolverNonlinear::reformJacobian(PetscSNES snes,
 						  PetscVec tmpSolutionVec,
-						  PetscMat* jacobianMat,
-						  PetscMat* preconditionerMat,
-						  MatStructure* preconditionerLayout,
+						  PetscMat jacobianMat,
+						  PetscMat preconditionerMat,
 						  void* context)
 { // reformJacobian
   PYLITH_METHOD_BEGIN;
diff --git a/libsrc/pylith/problems/SolverNonlinear.hh b/libsrc/pylith/problems/SolverNonlinear.hh
index e0632eb..1da01f9 100644
--- a/libsrc/pylith/problems/SolverNonlinear.hh
+++ b/libsrc/pylith/problems/SolverNonlinear.hh
@@ -98,16 +98,14 @@ public :
    * @param tmpSolveSolnVec Temporary PETSc vector for solution.
    * @param jacobianMat PETSc sparse matrix for system Jacobian.
    * @param preconditionerMat PETSc sparse matrix for preconditioner.
-   * @param Flag indicating layout of preconditioner matrix.
    * @param context ArgsJacobian structure with arguments.
    * @returns PETSc error code.
    */
   static
   PetscErrorCode reformJacobian(PetscSNES snes,
 				PetscVec tmpSolveSolnVec,
-				PetscMat* jacobianMat,
-				PetscMat* preconditionerMat,
-				MatStructure* preconditionerLayout,
+				PetscMat jacobianMat,
+				PetscMat preconditionerMat,
 				void* context);
 
   /** Generic C interface for customized PETSc line search.



More information about the CIG-COMMITS mailing list