FiniteVolumeTransportPhenomena / PyFVTool

Finite volume toolbox in Python
GNU Lesser General Public License v2.1
18 stars 4 forks source link

Calling external sparse solver (#20) - example demonstrating pypardiso #21

Closed mhvwerts closed 1 year ago

mhvwerts commented 1 year ago

A simple mechanism is proposed for calling external sparse solvers (see #20). The mechanism is demonstrated for pypardiso.

The example/documentation Notebook contains a modest calculation (2D cylindrical convection). A ~2.3x speed-up was observed for this short calculation (2.4s pypardiso vs 5.7s SciPy SuperLU).

mhvwerts commented 1 year ago

I fully agree that the support for calling external solvers can be improved later, for instance adding some global parameter setting to facilitate switching solvers globally, and especially introducing a solver interface class to configure and set up specialized solvers and providing the solver function call as you suggest. This could be in some submodule that is only imported optionally, avoiding extra dependencies for those who do not need them.