[firedrake] disentangling solver setup costs

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Tue Apr 21 11:23:10 BST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 21/04/15 11:20, Eike Mueller wrote:
> Hi Lawrence,
> 
> thanks! When I build a LinearSolver, can I solve the same problem
> (but for different RHSs) to two different tolerances? Currently I
> construct the LinearSolver twice, and that is very wasteful since I
> assemble the matrix twice).

Yes:

foo = LinearSolver(..., solver_parameters={'ksp_rtol': 1e-10})

foo.solve(...)

foo.parameters = {'ksp_rtol': 1e-4}

Note that setting this dict completely overwrites all the solver options.

Lawrence
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVNiULAAoJECOc1kQ8PEYvD0cH/jQTIJp1xRouxpWv02CydaLQ
7uKPkQ7RA2E2HfdSqEwJDz1cv7uVfi9mevlz8sY8sKfzb3QTodyzFY6/oFI+IFb6
W7Ae/d2LmhFRLv0aeGVNh7KneNHepZNVXMvzjxKmBNy7OQpnuifMVCVlE+KLYw/u
M/+um5X5RRintrbq1NGNx/Lle6FSfds9r7cO2rgB/nNpI0FUHvCwuvOx21R1kNHe
ym+DcJdCP3O/V/Nc5IzyHrhCbf5W40MGyNSW0wgw0gKAninYiGQwkyd49AnKemuf
pijIZB3xjO1AcIt8X0fS/C5glotdpISc2QxqDGouc38MgOib4ov4gR6KGi2h77k=
=qd87
-----END PGP SIGNATURE-----



More information about the firedrake mailing list