0

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.?

1 Answers1

0

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.

jeguyer
  • 2,379
  • 1
  • 11
  • 15
  • Thank you for the clarification! I would like to you pysparse for the solver and tried to install it but it doesn't work out. This is the error I get: print 'setuptools module not found.' ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print('setuptools module not found.')? ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. I'm not sure as to how I could fix this. Do you have any suggestions? – abirGeorge Apr 29 '22 at 09:27
  • For context I'm using anaconda with python 3.8 on a windows machine. – abirGeorge Apr 29 '22 at 09:41
  • PySparse only works on Python 2.7. While its LU solver is very fast, its GMRES solver is buggy, and it has not been updated in many years. – jeguyer Apr 29 '22 at 13:58