pythonscipynumerical-integrationfipy

What are the details of the iterative solvers in FiPy?


In fipy there is a default solver for the equations but it isn't clear as to which one it is out of the plethora of possibilities mentioned in the manual. I was wondering as to what kind of algorithm it follows (and what package - Scipy, Pysparse)? What is the integration scheme for the time step, i.e. is it Euler, RK2, etc.?


Solution

  • Which solver is being used can depend on what you have installed, what platform you're on, and whether you're running in parallel.

    You can determine which solver package is being used with

    import fipy as fp
    print(fp.solvers.solver)
    

    You can see which particular algorithm is employed by default with

    print(fp.DefaultSolver)
    

    for symmetric (diffusive) equations and

    print(fp.DefaultAsymmetricSolver)
    

    for asymmetric (convective) equations.

    For example, on my macOS laptop, these both print

    <class 'fipy.solvers.petsc.linearGMRESSolver.LinearGMRESSolver'>
    

    For time integration, FiPy performs forward-Euler steps, although our first example illustrates how to obtain backward-Euler and Crank-Nicolson integrations.

    I have an associated package in development called Steppyngstounes that offers some other time integration schemes that can be used with FiPy.