Hi all,
I have recently added some matrix-free (quasi-Newton) nonlinear solvers
- just simple wrappers around some methods of scipy.optimize.
It was originally meant for the schroedinger application, but the nice
thing is that they work for other problems too, e.g. the Poisson
equation, try the attached patch - no matrix is assembled during the
computation.
r.
diff --git a/input/poisson.py b/input/poisson.py
index b98e381..50b6ee9 100644
--- a/input/poisson.py
+++ b/input/poisson.py
@@ -134,6 +134,17 @@ solver_0 = {
#! ---------------------------
#! Even linear problems are solved by a nonlinear solver (KISS rule) - only one
#! iteration is needed and the final rezidual is obtained for free.
+solver_10 = {
+ 'name' : 'broyden',
+ 'kind' : 'nls.scipy_broyden_like',
+
+ 'method' : 'broyden3',
+ 'i_max' : 50,
+ 'alpha' : 0.5,
+ 'M' : 5,
+ 'w0' : 0.00,
+ 'verbose' : True,
+}
solver_1 = {
'name' : 'newton',
'kind' : 'nls.newton',
@@ -159,7 +170,7 @@ solver_1 = {
#! Use them for anything you like... Here we show how to tell which solvers
#! should be used - reference solvers by their names.
options = {
- 'nls' : 'newton',
+ 'nls' : 'broyden',
'ls' : 'ls',
}