Skip to content

High performance computational platform in Python for the spectral Galerkin method

License

Notifications You must be signed in to change notification settings

sciencewiki/shenfun

 
 

Repository files navigation

Shenfun

https://api.codacy.com/project/badge/Grade/dc9c6e8e33c34382b76d38916852b36b https://circleci.com/gh/spectralDNS/shenfun.svg?style=svg https://dev.azure.com/spectralDNS/shenfun/_apis/build/status/spectralDNS.shenfun?branchName=master

Try it in a jupyter hub using Binder

binder

Description

Shenfun is a high performance computing platform for solving partial differential equations (PDEs) by the spectral Galerkin method. The user interface to shenfun is very similar to FEniCS, but applications are limited to multidimensional tensor product grids, using either Cartesian or curvilinear grids (polar/cylindrical/spherical). The code is parallelized with MPI through the mpi4py-fft package.

Shenfun enables fast development of efficient and accurate PDE solvers (spectral order and accuracy), in the comfortable high-level Python language. The spectral accuracy is ensured by using high-order global orthogonal basis functions (Fourier, Legendre, Chebyshev, Laguerre, Hermite and Jacobi), as opposed to finite element codes that are using low-order local basis functions. Efficiency is ensured through vectorization (Numpy), parallelization (mpi4py) and by moving critical routines to Cython or Numba. Shenfun has been used to run turbulence simulations (Direct Numerical Simulations) on thousands of processors on high-performance supercomputers, see the spectralDNS repository.

The demo folder contains several examples for the Poisson, Helmholtz and Biharmonic equations. For extended documentation and installation instructions see ReadTheDocs. Note that shenfun currently comes with the possibility to use two non-periodic directions (see biharmonic demo). Furthermore, equations may be solved coupled and implicit (see MixedPoisson.py).

Note that there is now some support for solving equations using curvilinear coordinates. For example, it is possible to solve equations on a spherical shell using spherical coordinates, or along any curved line in 2D/3D, like for the coil show below.

Solution of Poisson's equation on a Coil

Solution of Poisson's equation on a spherical shell

Installation

Shenfun can be installed using either pip or conda, see installation chapter on readthedocs.

Dependencies

Contact

For comments, issues, bug-reports and requests, please use the issue tracker of the current repository, or see How to contribute? at readthedocs. Otherwise the principal author can be reached at:

Mikael Mortensen
mikaem at math.uio.no
http://folk.uio.no/mikaem/
Department of Mathematics
University of Oslo
Norway

About

High performance computational platform in Python for the spectral Galerkin method

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 62.1%
  • Jupyter Notebook 37.6%
  • Other 0.3%