Shenfun -- Automated Spectral-Galerkin framework
Project description
Try it in a jupyter hub using 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 (e.g., but not limited to, polar, cylindrical, spherical or parabolic). 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. For interactive demos, see the jupyter book. Note that shenfun currently comes with the possibility to use two non-periodic directions (see biharmonic demo), and equations may be solved coupled and implicit (see MixedPoisson.py).
Note that there is now also support for solving equations using curvilinear coordinates. For example, it is possible to solve equations on a sphere (using spherical coordinates), on the surface of a torus, or along any curved line in 2D/3D, like for the coil show below. Actually, any new coordinates may be defined by the user as long as the coordinates lead to separable systems of equations. After defining new coordinates, operators like div, grad and curl work automatically with the new curvilinear coordinates. See also this notebook on the sphere or an illustration of the vector Laplacian.
For a more psychedelic experience, have a look at the simulation of the Ginzburg-Landau equation on the sphere (click for Youtube-video):
Shenfun can also be used to approximate analytical functions with global spectral basis functions, and to integrate over highly complex domains, like the seashell below, see this demo.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file shenfun-3.0.4.tar.gz
.
File metadata
- Download URL: shenfun-3.0.4.tar.gz
- Upload date:
- Size: 147.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a22fe88d8b1ace2e41057fdef865e40bfce522692f614c1aaab5fd86ee7da9be |
|
MD5 | ac6bb7de86ce077fcc15350ea7fc7994 |
|
BLAKE2b-256 | c81c4e2f46d4ea26c4d8b6fed5512e07e10c134e09024e752c8b440e64cc6fc8 |