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.3a0.tar.gz (66.3 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.3a0-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

Details for the file layercake_model-1.0.3a0.tar.gz.

File metadata

  • Download URL: layercake_model-1.0.3a0.tar.gz
  • Upload date:
  • Size: 66.3 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.3a0.tar.gz
Algorithm Hash digest
SHA256 20dacecc120af9a60cbf067a6eb70379c1edaaeaa40726ddec476d89bc064494
MD5 0baf8d5baaaed236689f1961eb1b654d
BLAKE2b-256 53a269c1e9ae4cbaf796068288031cca44baea94cc795dff17fef332b6931e73

See more details on using hashes here.

File details

Details for the file layercake_model-1.0.3a0-py3-none-any.whl.

File metadata

File hashes

Hashes for layercake_model-1.0.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9c99d2b4323398b85df6a525e2a6bd5ef7196633f8f771677f21372b7e8fb35
MD5 ddc2223cb092ff8467c786bc75af200c
BLAKE2b-256 e1c3f7247001c53b00af37b0943dea3c4640a379255d2842817661dc931f2c8b

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