lisawim / pySDC

pySDC is a Python implementation of the spectral deferred correction (SDC) approach and its flavors, esp. the multilevel extension MLSDC and PFASST.
http://www.parallel-in-time.org/pySDC
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Fix for battery problem with residual tolerance #4

Closed brownbaerchen closed 1 year ago

brownbaerchen commented 1 year ago

I am not sure that I fixed completely, but at least it now does something when you supply a residual tolerance larger 0. The problem was that the A matrix was only changed from zeros in the solve system function. Before this was called, however the right hand side was computed and there was zero change in the solution, so the residual was also zero and there was nothing to solve. If you initialise the A matrix correctly in the __init__ function, this does not happen. I don't know anything about your problem, though. I started this PR to show where a fix is needed, but I don't know if this changes the behaviour of the problem for the worse in some other part. In particular, the test does not pass anymore because the iteration count is now different. Feel free to reject the PR and fix the issue in some other manner!