This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Adaptive time stepping / getting residual from failed nonlinear solve

+2 votes

I'm ultimately trying to implement adaptive time stepping into model I've created and I was wondering if

1) there is a standard example for adaptive timestepping with fenics? (I've looked but can't find one) or
2) is there a way to have a non linear solver return a residual instead of raising a non-convergence error?

any suggestions are greatly appreciated.

Also I'm using the same type of solver as the example problem in the link below, but open to using an arguably "better one"

https://fenicsproject.org/documentation/dolfin/dev/python/demo/documented/cahn-hilliard/python/documentation.html

asked Nov 16, 2016 by jlurban FEniCS Novice (190 points)

1 Answer

0 votes
 
Best answer

1) Not as far as I'm aware. This depends on how you've discretised in time. If you're implementing a "finite differencing" Euler-type theta scheme, there is a crude description of a method here.

2) try solver.parameters["error_on_nonconvergence"] = False

answered Nov 16, 2016 by nate FEniCS Expert (17,050 points)
selected Nov 16, 2016 by jlurban

The solver.parameters["error_on_nonconvergence"] = False is exactly what I was looking for!!!

I'm familiar with the theory of how adaptive timestepping works, I was hoping a for an example to see if there were any non-obvious intricacies with performing it.

...