A Quadrangular ADvanced, automatic unstructured MESH generator for 2D shallow-water models.
Python API and port of the MATLAB library and 'QuADMESH+'
Dominik Mattioli1†, Ethan Kubatko2
†Corresponding author | 1Unaffiliated | 2Ohio State University ()
- Converts an existing, validated shallow-water triangulation into quadrilaterals by merging adjacent triangle pairs.
- Reuses the input vertices; triangle pairing adds no points.
can_remove_edges=Falsestops boundary-edge collapse. - Leaves zero interior residual triangles (triangles with no domain-boundary edge), checked by
tests/test_no_interior_tris.py. - Adds points only to clear leftover boundary triangles; this step is on by default and
point_insert=Falseturns it off. - Returns a quad-pure mesh by default;
remove_boundary_tris=Falsekeeps leftover boundary triangles instead.
Attention MATLAB users: This Python library is the actively developed successor to the original MATLAB code, which is no longer maintained and is frozen under
archive/matlab.
Table of Contents
- Status & Roadmap
- Installation
- Quick Start
- Meshes from the Valence registry
- Limitations
- Documentation
- Citation
- Related Projects
- Contributing & Contact
- License
1. Status & Roadmap
Current release: 0.2.0. Next: 0.2.5 (unreleased); see CHANGELOG.
The default method="quadmesh+" runs the thesis per-layer sweep and leaves zero interior residual triangles; CI checks this on the meshes bundled with chilmesh.data. Algorithm and MATLAB parity status: docs/algorithm.md.
- Now: boundary-layer walkability and post-process quality tuning.
- Next: pre- and post-processing quality work; performance; evaluate a C++ or Rust backend; wire
tri2quad(aggressive=)to CHILmeshmerge_elements. - Future: formal integration within a unified ecosystem including
and
Headline result: on ENPAC2003 (531,680 triangles), QuADMESH 0.1.0 with chilmesh 1.0.0 produced 274,321 quads with zero interior residual triangles in 773 s, single-threaded. Details: docs/benchmarks.
2. Installation
pip install quadmesh # release from PyPI
pip install -e ".[dev]" # from a clone, plus pytest
pip install -e ".[plot]" # plus matplotlib for quality plots
chilmesh is an external dependency and is not vendored. Mesh-dependent tests need a Valence token; see tests/fixtures/README.md.
3. Quick Start
python -m quadmesh.cli input.14 -o output.14
Useful flags: --polygon domain.poly (domain boundary), --no-post-process, --n-smooth-iter N, --preserve-boundary. Run python -m quadmesh.cli --help for all of them. The MATLAB to Python function map is in MAPPING.md.
4. Meshes from the Valence registry
quadmesh --from-registry NAME -o out.14 ships in 0.2.5 (unreleased). Test meshes are available through Valence, a token-gated mesh service.
- Sign in with GitHub at https://valence-api.iqh766c2.workers.dev .
- A GitHub account at least 30 days old gets a token at once. The page shows it once; copy it then.
- A token allows 500 downloads per day (reset at midnight UTC) and expires after one year.
export VALENCE_TOKEN=<your token>; quadmesh --from-registry Block_O.14 -o out.14
5. Limitations
- Converts an existing, validated triangulation. It does not generate meshes from scratch.
- Boundary-layer quads have the lowest quality, and some can be concave (#90).
- The default post-process may drop boundary vertices; use
preserve_boundary=Trueto keep them.
6. Documentation
- Algorithm and MATLAB mapping
- Python quickstart
- Performance and benchmarks (
quadmesh-bench, diagnostics) - Repository layout, share your mesh
7. Citation
Algorithm and theory (cite the original thesis):
Mattioli, DO (2017). QuADMESH+: A Quadrangular ADvanced Mesh Generator for Hydrodynamic Models. The Ohio State University, OhioLINK - Electronic Theses and Dissertations Center. Master's Thesis. http://rave.ohiolink.edu/etdc/view?acc_num=osu1500627779532088
This software (cite the Zenodo release):
Mattioli, DO, Kubatko, EJ (2026). QuADMESH: A Quadrangular ADvanced, automatic unstructured MESH generator for 2D hydrodynamic domains. Zenodo. https://doi.org/10.5281/zenodo.20350483
The DOI resolves to the latest release; version DOIs are on the Zenodo record.
8. Related Projects
- ADMESH: Python port of the ADMESH adaptive mesh generator.
- CHILmesh: mesh data structure, smoother, and quality analysis.
9. Contributing & Contact
See CONTRIBUTING.md. To share a mesh, open an issue in this repository (https://github.com/domattioli/quadmesh/issues/new).
Dominik Mattioli (repo owner): GitHub | Ethan J. Kubatko: kubatko.3@osu.edu
10. License
Noncommercial and research use only. PolyForm Noncommercial License 1.0.0 with an additional No-AI/ML-training restriction; see LICENSE and AI-USAGE.md.
Commercial or AI-training licenses: contact domattioli via mango-kooky-okay@duck.com
Metadata
Release files for quadmesh 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quadmesh-0.2.5.tar.gz | 82.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quadmesh-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 174.8 kB
Release files / quadmesh-0.2.5.tar.gz
| Download URL | quadmesh-0.2.5.tar.gz |
|---|---|
| Size | 82.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d573c52450dbd7d543358eebb419ffce9c597d4bf7c354fe9db614b0950c140
|
|
BLAKE2b-256 checksum How to use checksums |
f867b8d4bdc8c3a15275a084de955bd114d244ab0028f829e66b65e63db67187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / quadmesh-0.2.5-py3-none-any.whl
| Download URL | quadmesh-0.2.5-py3-none-any.whl |
|---|---|
| Size | 92.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8caecdd7db433c98454ee9bb59f33762a0c40f93c8232b23e4f6ce34c8717329
|
|
BLAKE2b-256 checksum How to use checksums |
223ff0f8e0f7e328bbfbb417aee7e0f91eb7b2dadda00118e63c5c06b0362289
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|