From: yunfei zhu <yzhu2009@go...>  20090113 22:56:39

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. With best wishes, yunfei 