Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: yunfei zhu <yzhu2009@go...>  20090113 23:10:22

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 
From: Roy Stogner <roystgnr@ic...>  20090113 23:29:43

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 
From: Derek Gaston <friedmud@gm...>  20090114 00:02:36

On Jan 13, 2009, at 4:29 PM, Roy Stogner wrote: > 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. Yeah  it was me.... and (in my reply a moment ago) I didn't think about him possibly using a released version of libMesh.... sometimes I forget that people actually do that! The short answer is.... with 0.6.3 use the commandline arguments for Petsc.... with SVN head you can use the parameter. > But it looks like this may mean we ought to think about cleaning the > development head up and releasing a 0.6.4 soon. It's probably getting close. We're going to be doing more work on the Trilinos stuff again starting this week (I say we because we got someone else to pick up my slack ;) It would be nice if that worked before 0.6.4.... Derek 
From: Roy Stogner <roystgnr@ic...>  20090114 00:08:03

Derek Gaston wrote: > It's probably getting close. We're going to be doing more work on the > Trilinos stuff again starting this week (I say we because we got someone > else to pick up my slack ;) It would be nice if that worked before > 0.6.4.... I agree completely. If the biggest outstanding problem with 0.6.3 is "people are lured by the PETSc nonlinear solver interface but thwarted by an incomplete implementation", then replacing that with "people are lured by the Trilinos nonlinear solver interface but thwarted by an incomplete implementation" would not be a huge improvement. ;)  Roy 
Sign up for the SourceForge newsletter:
No, thanks