-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dear Henrik, On 09/10/15 14:16, Buesing, Henrik wrote:
Dear Firedrakers,
if I wanted to modify the diagonal entries of my Jacobian in a Newton step during a time step... How would I do this? Do I have to define my own preconditioner here?
Do you actually want to modify the Jacobian, or do you only want to precondition the Newton step with an operator that is different from the true Jacobian? In the former case, you'll be doing some kind of quasi-Newton. Recall the Newton update is: du = -J^{-1} F(u) (1) where J is the linearisation of F about u (the Jacobian). If you directly modify J, then you're solving for a different update: du = -J'^{-1} F(u) (2) Which may or may not converge to the solution you want, depending on the choice of J'. If you want to do this, then when you build your solver you can explicitly provide a bilinear form for the Jacobian (rather than asking firedrake to derive it) by saying: solve(F == 0, u, J=bilinear_form, ...) Alternately, you may be wanting to solve (1), i.e. the problem with the exact Jacobian, but you have a choice of how to approximate J^{-1}. The system: J du = -F(u) is solved for du using an iterative method, by default, the preconditioner for this is constructed using J, effectively solving: P(J)^{-1} J du = -P(J)^{-1} F(u) However, you need not use J to construct the preconditioner, you can instead provide an approximate Jacobian that captures the structure of your problem but may be "easier" to invert, call it Jp. Then you end up solving: P(Jp)^{-1} J du = -P(Jp)^{-1} F(u) To do this, you can provide a bilinear form for Firedrake to construct Jp like so: solve(F == 0, u, Jp=approximate_jacobian, ...) Cheers, Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJWJMWhAAoJECOc1kQ8PEYvMGoH/iSoNwXTlgZL1BmPj5jr9QYB BWG8JsUn+v0yO/CHHx7MY1HRFELjtzUCyfmLHzOQcJYb7pYJIiE9UtKtMKYktR1g lo9O/GKuw8oIEED9usx+jFtw5tZvV9KB45JyXtOHrPY9jroRubXC6o5ZTNtlCRyG G85/zKFmnRZB+sF7PFkFUjxewr95WpQ+E/O4uvyuII4FfUYMwVTmxNc7mg6iXJnd 0LKwf7etueG1VnCkTnNA8vPjPzhRbltpXFoZJy3tLzhRRkjFjdKBhDGUz7ZjWXrj 35ozjxfC1jSG8VgH8IkaN0BDy4NhCw4o85eZLMCsAQwXSWbJIcTRVVDSLYKBikw= =w1/i -----END PGP SIGNATURE-----