Installation

spectral_galerkin_heat uses uv to manage its environment.

Prerequisites

  • Python: 3.12 or higher.

  • uv: A fast Python package installer and resolver.

For GPU support (optional):

  • CUDA Toolkit: Compatible with CuPy.

  • NVIDIA Driver: Matching your CUDA version.

Installing the Project

  1. Clone the repository:

    git clone https://github.com/theo-andrieux/spectral_galerkin_heat.git
    cd spectral_galerkin_heat
    
  2. Sync the environment (CPU):

    uv sync
    

    This creates an isolated virtual environment and installs the dependencies defined in pyproject.toml.

  3. (Optional) Sync for GPU: For a compatible NVIDIA GPU:

    uv sync --extra gpu
    

Running Simulations

The project is driven by YAML configuration files.

# General invocation
uv run python simulations/main.py <path_to_config.yaml>

# Run the quickstart example (finishes in seconds)
uv run python simulations/main.py simulations/examples/01_quickstart.yaml

See Examples for the full walkthrough of the examples.

Building the Documentation

Requires make (available via your system package manager: apt install make, brew install make, etc.).

uv run make -C docs html

The HTML output is written to docs/_build/html/. Open docs/_build/html/index.html in a browser to view it.