geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
227 stars 237 forks source link

Simplify Newton solver function arguments #6125

Closed gassmoeller closed 2 weeks ago

gassmoeller commented 2 weeks ago

Still looking into the reason why #6116 changes test results I noticed a number of things that could be simplified around the newton solver. This PR does:

  1. Update documentation that is out of date
  2. Simplifies function arguments, in particular I do no longer assume the calling function already happens to have a copy of a vector if the called function needs a copy. If we need a backup copy of a vector in a function, the function should create and destroy that copy. This may cost 1-2 additional vector copies per nonlinear iteration, but it makes the code much easier to understand. I also think because of this complexity there is a bug in compute_initial_newton_residual that I will address in a follow up.

This PR should not change any test results, it contains only code style improvements.