To continue beating this horse, I wrote this:
PetscErrorCode CheckStageTrue(TSAdapt adapt,TS ts,PetscBool *accept){
*accept = PETSC_TRUE;
}
TSAdaptSetCheckStage(adapt,CheckStageTrue);
But TSAdapt then still rejects the stage, but quits altogether instead
of continuing:
Nonlinear solve did not converge due to DIVERGED_LINEAR_SOLVE
iterations 4
TSAdapt 'basic': step 0 stage rejected t=0 + 1.000e-01
retrying with dt=2.500e-02
Am I not using TSAdaptSetCheckStage correctly?
On 04/27/2015 12:55 PM, Jed Brown wrote:
Mark Lohry <[email protected]> writes:
TSAdaptChoose_None is being called, yes. Output with -ts_adapt monitor
looks like this:
TSAdapt 'none': step 17 accepted t=680 + 4.000e+01
family='beuler' scheme=0:'(null)' dt=4.000e+01
TSAdapt 'none': step 18 accepted t=720 + 4.000e+01
family='beuler' scheme=0:'(null)' dt=4.000e+01
TSAdapt 'none': step 19 accepted t=760 + 4.000e+01
family='beuler' scheme=0:'(null)' dt=4.000e+01
TSAdapt 'none': step 20 stage rejected t=800 + 4.000e+01
retrying with dt=1.000e+01
Add -snes_converged_reason. What do you want to do when the solver
fails? Pretend like it succeeded and get the wrong answer? Usually
people shorten the time step and retry, which is what you see happening
here.
You can call TSAdaptSetCheckStage and have your function unconditionally
set accept to PETSC_TRUE (and you'll likely get the wrong answer).