Continuous-Time Galerkin (CTG) space-time finite element method (FEM) for deterministic and stochastic wave equations.
![]() |
![]() |
| Space‑time slabs | Solution over space–time |
- Continuous Time Galerkin (CTG) finite element methods for wave equations
- Space-time finite element discretization
- Parametric coefficient handling for uncertainty quantification
- Brownian motion coefficient implementation
- Efficient sparse matrix assembly for space-time operators
- Multiple examples and convergence studies
- Support for various boundary and initial conditions
- Post-processing and error analysis tools
For those who have no time to lose:
# create and activate the conda environment
mamba env create -f environment.yml
conda activate ctg-wave
# install
pip install -e .
# Run default example (uses data in ctg/presets/swe.yaml)
ctg
# Or run with new custom data:
ctg --config-path examples/data_examples/data_swe.yaml
# run tests
pytest -qThe command produces results under results/<timestamp>/ containing:
meta.json: Simulation metadata and simple metrics on the outputconfig_used.yaml: A copy of the configuration file containing problem data and solver parameters- numerical outputs / plots
- Clone the repository
git clone git@github.com:andreascaglioni/CTG_wave.git- Install the dependencies with Mamba
mamba env create -f environment.yml
conda activate ctg-waveNote: This package has only been tested with dolfinx v0.9.0.
- Install the package + hooks
pip install -e .
pre-commit install- Run the CLI script with default parameters
python -m ctg.cli- Run Pytest tests (options set in
pyproject.toml)
pytestThe program can be run from the command line with a YAML file containing the physics and numerics data:
ctg --config-path [data/your_config.yaml]If no YAML file is provided, the program will use a default file ctg/default_data/data_swe.yaml.
Give a look to it to understand how it is structured. Note that in the same directory there is a file data_swe_functions.py containing the callables referenced in data_swe.yaml (e.g., initial and boundary data functions).
More examples are available in the examples/ directory:
examples/SWE_CTG_example.py- Basic parametric wave equation example, similar to the CLI scriptexamples/WE_CTG_conv_dt.py- Time step convergence studyexamples/SWE_example_ensamble.py- Ensemble simulation example
The documentation contains detailed API reference and mathematical background. Find it at https://andreascaglioni.github.io/ctg-wave/
Contributions are welcome! Please open an issue or submit a pull request.
Distributed under the MIT License. See LICENSE for more information.
Andrea Scaglioni - Get in touch on my website

