This is just what I need. Thanks, Jed. Cheers Lei
-----Original Message----- From: Jed Brown [mailto:[email protected]] Sent: 29 June 2018 16:25 To: WANG, LEI; [email protected] Subject: Re: [petsc-users] how to exit in SNES iteration See SNESSetFunctionDomainError() "WANG, LEI" <[email protected]> writes: > Dear all > > I am writing a code for nonlinear mechanical problem with SNES. The code > often stops inside of the iterations when computing the Jacobian or Function. > I would like to force the code exit once some abnormal value appears, but do > not know what function to use? I have tried to set the residual norm to a > large value, iteration number to a large value, but seems those not work. > What should I write in 'if(abnormal) ???' for exiting SNES iteration in the > functions FormJacobian or FormFunction? > > Cheers > Lei
