![](https://secure.gravatar.com/avatar/97d945680ed363e4cce48666d41c586e.jpg?s=120&d=mm&r=g)
You might want to look at fipy <http://www.ctcms.nist.gov/fipy>, it has the Van Leer flux limiting schemes for convection terms as well as other options. Also, it uses either pysparse or trilinos, which both have a number or preconditioning options. On Mon, Mar 29, 2010 at 6:59 PM, Darcoux Christine <bouloumag@gmail.com> wrote:
Thnak you. I will look at these links.
I am using the finite volume method, with QUICK advection (maybe I will try flux limiters in the future if there are too much oscillations).
2010/3/29 Joshua Stults <joshua.stults@gmail.com>
On Mon, Mar 29, 2010 at 4:54 PM, Darcoux Christine <bouloumag@gmail.com> wrote:
I am developping a Jacobian-Free Newton-Krylov code to solve the Navier Stokes equations. In this code, the product of the Jacobian matrix with a given vector is represented by the matvec method of a "LinearOperator" object. The scipy.sparse.linalg.isolve.gmres method can takes an optional preconditioner as parameter which is either an object "LinearOperator" or a matrix. However, the scipy documentation does not explain how one can form this preconditioner in a (ideally) matrix-free manner given only the matvec method of the jacobian.
Any suggestions on this would be very appreciated.
A pretty straight-forward way to precondition these types of problems in a matrix-free way is with symmetric successive over relaxation (the symmetric part is important, you need to do a 'forward' and a 'backward' sweep or things won't converge): http://www.netlib.org/linalg/old_html_templates/subsection2.6.2.4.html
You'll have to derive the update formulas yourself based on the type of discretization you are using; if you are using a transform based method, then you can still precondition based on a low-order scheme. IIRC Boyd has a pretty decent discussion of this in his spectral methods book.
Maybe you could construct one of the approximate factorization preconditioners using only the matvec of your Jacobian, but I've never gone with this approach, maybe someone else could chime in with recommendations along those lines? http://www.netlib.org/linalg/old_html_templates/chapter2.7.html
What sort of spatial discretization are you using?
Thanks,
Christine
HtH, -- Joshua Stults Website: http://j-stults.blogspot.com _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
-- Daniel Wheeler