Skip to main content

A framework to design systems of partial differential equations (PDEs), and convert them to ordinary differential equations (ODEs) via Galerkin-type expansions.

Project description

LayerCake

“Welcome to the layer cake son.”

-- Michael Gambon - Layer Cake (2004)

PyPI version PyPI pyversions DOI Documentation Status License

General Information

LayerCake is a framework to design models based on systems of partial differential equations (PDEs), and convert them to ordinary differential equations (ODEs) via Galerkin-type expansions.

LayerCake allows you to construct systems of PDEs, and to specify coordinate systems and basis functions to build the corresponding ODE systems. To build these systems, LayerCake relies heavily on the Sympy symbolic computation framework. The output of this procedure is either a Numbaified Python callable, or a list of symbolic ODE tendencies that can be integrated in any of the supported languages (Fortran, Julia and Python for the moment). These two kinds of output allow for the study of the computed models with the modern tools available in all these languages.

LayerCake has been designed with geophysics in mind, although it may be useful for other applications.

About

(c) 2025-2026 Jonathan Demaeyer and Oisín Hamilton

See LICENSE.txt for license information.

Installation

With pip

The easiest way to install and run LayerCake is to use pip. Type in a terminal

pip install layercake-model

and you are set!

Additionally, you can clone the repository

git clone https://github.com/Climdyn/LayerCake.git

and perform a test by running the script

python LayerCake/examples/atmospheric/barotropic_one_layer.py

to see if everything runs smoothly (this should take less than 5 minutes).

With Anaconda

The second-easiest way to install and run LayerCake is to use an appropriate environment created through Anaconda.

First install Anaconda and clone the repository:

git clone https://github.com/jodemaey/LayerCake.git

Then install and activate the Python3 Anaconda environment:

conda env create -f environment.yml
conda activate layercake

You can then perform a test by running the script

python examples/atmospheric/barotropic_one_layer.py

to see if everything runs smoothly (this should take less than 5 minutes to run).

Documentation

To build the documentation, please run (with the conda environment activated):

cd documentation
make html

You may need to install make if it is not already present on your system. Once built, the documentation is available here.

The documentation is also available online at https://climdyn.github.io/LayerCake/. In particular, please consider reading the User guide.

Examples

A few examples are available in the examples folder. More examples will be provided as the code is further developed.

Dependencies

LayerCake needs mainly:

  • Numpy for numeric support
  • sparse for sparse multidimensional arrays support
  • Numba for code acceleration
  • Sympy for symbolic computations

Check the YAML file environment.yml for the dependencies.

Contributing

LayerCake is in beta development phase, bug reports and tests of the features are welcome. Please simply raise an issue on Github.

If you want to contribute actively to the development, please contact the main authors. In addition, if you have made changes that you think will be useful to others, please feel free to suggest these as a pull request on the LayerCake Github repository.

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

layercake_model-1.0.7b0.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

layercake_model-1.0.7b0-py3-none-any.whl (81.1 kB view details)

Uploaded Python 3

File details

Details for the file layercake_model-1.0.7b0.tar.gz.

File metadata

  • Download URL: layercake_model-1.0.7b0.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for layercake_model-1.0.7b0.tar.gz
Algorithm Hash digest
SHA256 f92e578717feb76ba755dd2adc0ede7a05fe97022276ad11589473751d3912bc
MD5 f552abf0169d00de0019a5653fb69e6e
BLAKE2b-256 3360932537279391e8180821b0d2aa36134b87821316edb999469aaf05cf263e

See more details on using hashes here.

File details

Details for the file layercake_model-1.0.7b0-py3-none-any.whl.

File metadata

File hashes

Hashes for layercake_model-1.0.7b0-py3-none-any.whl
Algorithm Hash digest
SHA256 32ed64fe83ab6accaf211a47a9419c5e3073efee9863b340d7cfc4d8c70f2681
MD5 49fe62c2e3ac4454a31324fda65406e7
BLAKE2b-256 f668383082abf00781a7c6dd83e6aa2f65f3acebfe0ed433da29cfbb101daeeb

See more details on using hashes here.

Supported by

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