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)
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 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 manipulation of inner products
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file layercake_model-1.0.2a0.tar.gz.
File metadata
- Download URL: layercake_model-1.0.2a0.tar.gz
- Upload date:
- Size: 64.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
164969d08045b7da523f9c476c72f5e337c2d7a4b68f86dc725482d85c835408
|
|
| MD5 |
1ee23cf0794e6e9926733e0b98678740
|
|
| BLAKE2b-256 |
aa6fdc530eaf49e7a8262ec7f3ac08bcb87fa5f813d4019764672d74cffab7e2
|
File details
Details for the file layercake_model-1.0.2a0-py3-none-any.whl.
File metadata
- Download URL: layercake_model-1.0.2a0-py3-none-any.whl
- Upload date:
- Size: 76.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
139484e3a57172add26d3c8c4b9108cf1125f12075e2a75be24091650b89ea47
|
|
| MD5 |
ac9b33b713266599b3b35dc3f28f16ef
|
|
| BLAKE2b-256 |
c72bb2e7c8af56e35140fbd9661b7deb4d93e74919677f5154fdaa3de689d11f
|