Skip to content

Commit f2b414a

Browse files
authored
Merge pull request #4339 from GiudGiud/PR_abs_step
Add warning on using the absolute step tolerance with a PETSc nonlinear solver
2 parents 3a6d07d + e7da3a2 commit f2b414a

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/solvers/petsc_nonlinear_solver.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,10 @@ PetscNonlinearSolver<T>::solve (SparseMatrix<T> & pre_in, // System Preconditi
970970
this->max_nonlinear_iterations,
971971
this->max_function_evaluations));
972972

973+
// Not supported by PETSc
974+
if (this->absolute_step_tolerance != 0) // 0 is default value, both in MOOSE and libMesh
975+
libmesh_warning("Setting the absolute step tolerance is not supported with the PETSc nonlinear solver.");
976+
973977
// Set the divergence tolerance for the non-linear solver
974978
#if !PETSC_VERSION_LESS_THAN(3,8,0)
975979
LibmeshPetscCall(SNESSetDivergenceTolerance(_snes, this->divergence_tolerance));

src/solvers/trilinos_nox_nonlinear_solver.C

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ NoxNonlinearSolver<T>::solve (SparseMatrix<T> & /* jac_in */, // System Jacobi
385385
Teuchos::RCP<NOX::Epetra::Group> grpPtr = Teuchos::rcp(new NOX::Epetra::Group(printParams, iReq, x, linSys));
386386
NOX::Epetra::Group & grp = *(grpPtr.get());
387387

388+
if (this->relative_step_tolerance != 0) // 0 is default value
389+
libmesh_warning("Setting the relative step tolerance is currently not supported with the trilinos nox nonlinear solver.");
390+
388391
Teuchos::RCP<NOX::StatusTest::NormF> absresid =
389392
Teuchos::rcp(new NOX::StatusTest::NormF(this->absolute_residual_tolerance, NOX::StatusTest::NormF::Unscaled));
390393
Teuchos::RCP<NOX::StatusTest::NormF> relresid =

0 commit comments

Comments
 (0)