yunfei zhu wrote:
> Hi, all
> I find that the number of nonlinear steps can not be controled by:
> es.parameters.set<unsigned int> ("nonlinear solver maximum iterations") = 100
> In the function NonlinearImplicitSystem::solve ( ) , the parameter is
> assigned to "maxits" by:
> const unsigned int maxits = es.parameters.get<unsigned int>("nonlinear
> solver maximum iterations");
>
> Then "maxits" is transfered to nonlinear_solver:
> const std::pair<unsigned int, Real> rval =
> nonlinear_solver->solve (*matrix,
> *solution, *rhs, rel_resid_tol, maxits);
>
> I have checked the file of petsc_nonlinear_solver.C, actually, the
> "maxits" is not adopted in the following function:
> template<typename T >
> std::pair< unsigned int, Real > PetscNonlinearSolver< T >::solve (
> SparseMatrix< T > & jac_in, NumericVector< T > & x_in,
> NumericVector< T > & r_in, const double, const unsigned int ) .
>
> I just tried to make add the following in the function
> PetscNonlinearSolver< T >::solve() before ierr = SNESSolve (_snes,
> PETSC_NULL, x->vec()); CHKERRABORT(libMesh::COMM_WORLD,ierr);
>
> EquationSystems& es = this->system().get_equation_systems();
> int maxFails = es.parameters.get<unsigned int>("maxFails");
>
> ierr = SNESSetMaximumUnsuccessfulSteps(_snes,maxFails);
> CHKERRABORT(libMesh::COMM_WORLD,ierr);
>
> But it does not work.
> I am a beginner for C++, so maybe this question is stupid. But I
> really do not know how to solve it. Controlling the NL steps is
> important for my nonlinear PDEs. Could anyone give me some
> suggestion? Thanks in advance.
I think someone (Derek?) changed this around a bit when working on the
Trilinos nonlinear solver interfaces; perhaps the changes haven't quite
been completed. I believe a few arguments to solve() are now
deprecated, and some member variables (max_nonlinear_iterations, for
this case) are intended to be used instead.
But (at least in the SVN head), it looks like the
NonlinearImplicitSystem code is setting max_nonlinear_iterations
correctly. I take it this is a bug in libMesh 0.6.3?
The PETSc call to make to fix it is SNESSetTolerances, but as Ben
pointed out, you may be able to just use their command line options as a
workaround.
But it looks like this may mean we ought to think about cleaning the
development head up and releasing a 0.6.4 soon.
---
Roy
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users