Skip to main content

WENO-4 Interpolation implemented from Janett et al (2019)

Project description

Simple Implementation of Fourth-Order WENO Interpolation

Chris Osborne, University of Glasgow, 2020, MIT License

Direct implementation from the very clear method presented in Janett et al (2019). Weighted Essentially Non-Oscillatory (WENO) techniques are used to provide high order reconstructions of data, whilst remaining stable around discontinuities. Most WENO algorithms are designed for reconstructing interface values in finite difference and finite volume codes (often assuming uniform grids). The method implemented here was designed for arbitrary interpolation on non-uniform grids.

The file weno4.py, provides one function weno4, that performs the interpolation, with optional quadratic extrapolation on the extremities (off by default). See the docstring for more information.

Running the file weno4.py directly should reproduce the test cases from the paper, and should look something like this:

Comparison of WENO4 against other interpolators on test cases

Note that this WENO scheme does not enforce monotonicity, and may introduce small under- or overshoots around extrema (although without "ringing"), which can possibly introduce negative values in the the interpolation of a strictly positive function (e.g. the modified Heaviside test case).

Prerequisites

  • python >=3.6
  • numpy (tested on 1.18.2)
  • numba (tested on 0.48 & 0.49)

If you want to run the examples:

  • scipy
  • matplotlib

Installation

pip install weno4

Reference

Janett et al (2019). A&A 624, A104

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weno4-1.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

weno4-1.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file weno4-1.1.0.tar.gz.

File metadata

  • Download URL: weno4-1.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for weno4-1.1.0.tar.gz
Algorithm Hash digest
SHA256 94c860102fe03125ea3b7413c2d6661bd97ea031ead7d2b606198034ca49f7e4
MD5 e9976b847a0d085a083caada1ec960c6
BLAKE2b-256 a91f5441350052e9413e79d78103e169d47a3e0efaeba52da2009753eb5c0551

See more details on using hashes here.

File details

Details for the file weno4-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: weno4-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for weno4-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8958f4741b6805ca9cbbde1da54f169246228b6d7ef9418a61e4797d9c1f5322
MD5 b816c9898665c5393317a3b0535cdd2e
BLAKE2b-256 9e292b588da2216694e9788d3b5f1fc89e9a77442135d70ba80fcd0a7e2e87e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page