Skip to main content

ADMESH: an advanced, automatic unstructured mesh generator for 2D shallow-water models.

Project description

ADMESH meshing Delaware Bay through three stages: initialized point cloud, DistMesh truss-solver relaxation, then FEM smoothing — element color tracks quality from magenta (poor) to cyan (equilateral).

An ADvanced, automatic unstructured MESH generator for 2D shallow-water models
Python API and port of the original MATLAB library

Dominik Mattioli1†, Colton Conroy, Dustin West, Ethan Kubatko2
Corresponding author | 1Unaffiliated | 2Ohio State University (CHIL)

PyPI version Python 3.10+ Tests Open issues DOI License

Lineage: Two branches of ADMESH descend from the 2012 original by Conroy et al. The original group's current MATLAB line is ADMESH+ v3 (OSU-CHIL/ADMESH; archived at 10.5281/zenodo.10242565), maintained by Younghun Kang with Ethan Kubatko: it adds constraint extraction for coupled 1D–2D hydrodynamic models, a revised medial-axis method, and GUI components (Kang & Kubatko, 2024). This repository is the parallel branch: an independent Python port of the 2012 library, maintained separately. A copy of the ported MATLAB source is vendored at src/matlab/ for provenance.


Table of Contents


Status & Roadmap

Current release: 0.6.0 (July 2026), stable and actively-maintained. The octree adaptive background grid (background="octree") refines the size field on a quadtree to better resolve medial-axis and channel feature widths.

  • Now: address open issues.
  • Next: enhanced pre- and post-processing for quality improvement; performance optimization; evaluate a C++ or Rust backend; parallelization.
  • Future: formal integration within a unified ecosystem including QuADMESH PyPI version and CHILmesh PyPI version

Why ADMESH

For shallow-water modelers who need ADCIRC-ready meshes with minimal user input:

  • Native ADCIRC fort.14 I/O. Bit-faithful read/mesh/write round-trip, including paired-edge boundary records (IBTYPE 3/4/13/24). ADCIRC format only — not gmsh, not generic.
  • Element size follows the physics. Size adapts to boundary curvature, channel width, bathymetric gradient, and tidal wavelength through automatic min-stack composition; custom contributions layer on top. No hand-tuned scalar.
  • An adaptive background grid for multiscale domains. triangulate(background="octree") refines the size field on a quadtree instead of a uniform grid, concentrating evaluation where the geometry demands it — opt-in; the uniform grid remains the default.
  • Pythonic surface, faithful internals. Domain / Mesh / BoundarySegment are frozen, typed dataclasses; the numerics stay inside the locked faithful-port modules.

Not the right tool for 3-D, anisotropic, or non-triangular elements — use QuADMESH PyPI version for quads, or gmsh otherwise.

Installation

pip install admesh2D            # core
pip install admesh2D[viz]       # adds chilmesh for mesh.plot() / plot_quality()

⚠️ Install admesh2D, not admesh. The distribution name is admesh2D; the import name stays admesh (import admesh). pip install admesh pulls an unrelated C STL-repair library that needs admesh/stl.h at build time and will fail.

Requires Python ≥ 3.10. Core dependencies: NumPy, SciPy, Numba, Shapely. From source:

git clone https://github.com/domattioli/ADMESH.git
cd ADMESH && pip install -e ".[dev]"

Quick start

import admesh
from admesh import domains

# Uniform sizing
mesh = admesh.triangulate(domains.UNIT_DISK, h_max=0.1)
mesh.to_fort14("disk.14")

# Graded sizing: fine features, coarse interior
mesh = admesh.triangulate(domains.NOTCHED_RECTANGLE, h_max=0.2, h_min=0.02)
mesh.to_fort14("notched.14")

mesh is a frozen Mesh dataclass: typed nodes, elements, boundaries (each a BoundarySegment carrying a BoundaryType code), optional bathymetry, and per-element quality. h_min / h_max set the size bounds; pass a size_field callable to grade explicitly. fort.14 boundary labels round-trip through BoundaryType, an IntEnum over ADCIRC IBTYPE codes (OPEN=0, MAINLAND=1, ISLAND=11, MAINLAND_FLUX=20); paired-edge and weir codes (3/4/13/24) preserve as plain int.

See docs/ for fort.14 round-trip, re-meshing, custom size-field, and SDF-domain examples.

Pipeline

triangulate(...) runs the 13-stage ADMESH pipeline; a Numba-JIT solver replaces the original C MEX, so there is no compile step at install.

flowchart LR
    A["SDF / fort.14"] --> B["Domain"]
    B --> C["Size field<br>(curvature + medial axis<br>+ bathymetry + tide)"]
    C --> D["distmesh2d<br>(truss equilibrium)"]
    D --> E["Mesh<br>(fort.14 out)"]

Performance

The Numba-JIT SDF kernel and solve_iter smoother cut end-to-end mesh generation on the Western North Atlantic benchmark from 1257.5 s to 47.2 s — a 26.6× speedup at unchanged quality (mean 0.963), measured at hmin=0.05 / g=0.10 / niter=120.

v0.2.1 v0.5.0 (Numba)
total 1257.5 s 47.2 s
nodes / elements 49 377 / 93 655 49 377 / 93 642
mean element quality 0.963 0.962

The C++ force kernel and full-stage native rewrite (v1.0.0 / v1.1.0) are in flight; the per-stage breakdown and the version-comparison harness live in benchmarks/. The forward benchmark standard is the ENPAC 2003 tidal database (272,913 nodes), replacing WNAT for large-domain timing.

Reproduce or extend:

python benchmarks/compare_versions.py --hist \
    --mesh tests/fixtures/fort14/adcirc_examples/wnat_test.14 \
    --domain benchmarks/data/wnat_onur_boundary.json \
    --hmin 0.05 --g 0.10 --niter 120

Citation

Algorithm (cite the original paper):

Conroy, C.J., Kubatko, E.J. & West, D.W. (2012). ADMESH: an advanced, automatic unstructured mesh generator for shallow water models. Ocean Dynamics 62, 1503–1517. https://doi.org/10.1007/s10236-012-0574-0

This software (cite the archived release):

Mattioli, D.O., Conroy, C.J., West, D.W., Kubatko, E.J. (2026). ADMESH: An advanced, automatic unstructured mesh generator for 2D shallow-water models (Python port). Zenodo. https://doi.org/10.5281/zenodo.20264101

Upstream MATLAB line (ADMESH+, if you use or compare against it):

Kang, Y. & Kubatko, E.J. (2024). An automatic mesh generator for coupled 1D–2D hydrodynamic models. Geoscientific Model Development 17, 1603–1625. https://doi.org/10.5194/gmd-17-1603-2024

Kang, Y., Kubatko, E.J., Conroy, C.J. & West, D.W. (2023). Younghun-Kang/ADMESH: v3.0.1. Zenodo. https://doi.org/10.5281/zenodo.10242565

A CITATION.cff feeds GitHub's "Cite this repository" button; version-specific DOIs are on the Zenodo record.

Documentation

API reference lives in the docstrings (triangulate, Domain, Mesh, BoundarySegment, read_fort14 / write_fort14, the 13 stage modules). Design notes, the porting log, and domain-format specs are under docs/ and specs/; project invariants in CONSTITUTION.md.

Contributing

Issues and pull requests are welcome on GitHub.

License

Apache 2.0 — see LICENSE.

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

admesh2d-0.6.0.tar.gz (111.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

admesh2d-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (246.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

admesh2d-0.6.0-cp313-cp313-macosx_11_0_arm64.whl (207.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

admesh2d-0.6.0-cp313-cp313-macosx_10_13_x86_64.whl (212.8 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

admesh2d-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (245.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

admesh2d-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (207.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

admesh2d-0.6.0-cp312-cp312-macosx_10_13_x86_64.whl (212.8 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

admesh2d-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (244.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

admesh2d-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (206.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

admesh2d-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl (210.8 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

admesh2d-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

admesh2d-0.6.0-cp310-cp310-macosx_11_0_arm64.whl (204.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

admesh2d-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl (209.4 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file admesh2d-0.6.0.tar.gz.

File metadata

  • Download URL: admesh2d-0.6.0.tar.gz
  • Upload date:
  • Size: 111.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for admesh2d-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8ec565bf32a8a911b7a2e1c46789e7452e51258fd112dbccf96c6d21776281f7
MD5 9b37f980ab215035cd464c6c2c5c83d6
BLAKE2b-256 7fcc71a7d9093532d1944ec5c653f3118f5df35933855531979b531a5d661bfd

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 630826f460f7dfdec437bdafce82bc0d1b5771f263c63e52e4adad0047556a0d
MD5 ac63df0bc9534ff4af2dd3fbf2f02e85
BLAKE2b-256 d51e9568c430accd9c45912b1e9729608c466937fb868771033fbd160c4fc5f3

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a89aa9820e304ae0e333ebe007e5c3493885a314094d349f65da80e371b152b8
MD5 5433657555b24fcdd19ebf9c413faa0b
BLAKE2b-256 13d000e8046884da12115897e2ce4a150c5b8a8643ee4b38e974ec75730f7e70

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c468d92a790dfee8744841b24ada9e3756d6de1c3f8177154fe01001dc737388
MD5 7400a1408c6ee6f0daca5fbc25cc11d4
BLAKE2b-256 d8e171a141c93df57c609cd482029e2e869359bd8680cd5e7fdc91c21dd42e7c

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31573a7c3619b160b1b0c1951456169517c27f5a5b445fddfa43f8800761e2d5
MD5 26f53b89c064d20e2394865cef46739c
BLAKE2b-256 1dd881a855931f06587dd6db6c55def54c7b67be3f3856919d9ef29146d9791f

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1901300ad4b6df8a7e47591c617d77053dedd0202a3791d899a93a0df4aeb584
MD5 945f04ae153c9a5fc7fa21cf0fe4de88
BLAKE2b-256 11e450d1562192c68e78502b68bcf4e707a3010ea05e6bcf66e8cc1d7d6ff6b0

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 65e0356930947bab0d2fa233449a8196a4faab4f9b2083f2b5f6ee741fb2c436
MD5 f73256936dba54e8c75ae53a698a2b26
BLAKE2b-256 f399bd33700f4f1de4071045eb69760667bff428b85a8865155a9cf279772606

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d129883e733ef5a7520fd790b2f00d82b0785d54a603c6b5cbea4a77ba9faa04
MD5 54b940db0a6c1aa358203914c8f48a25
BLAKE2b-256 531921cb157776a6ce239d31dc000eecb2fc71ce92f1e8d2713950dfba61ef53

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b40782ea88e1971ea0b9122fd83bcdc26d6bc1e8d89db3c7808ddc1acbd407c
MD5 7cc6127ff8d7142c8533bf625872fb6f
BLAKE2b-256 c66380c3d5b659c5f566767e9868a973b243b26e768cc44d9c1f66c7b03942c0

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 06f190da218a1608aed2940ddd4f737e5ef8c13d96878ac6578473478acc4d08
MD5 8f72ce5d5d26c43993325906aec70c5d
BLAKE2b-256 e62151b1c49c004f27ad4deb8b2094496dd7f5108b4b521eb2530ff7ee54128a

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4ac2858e333d14b5fdbdbf7f7984b0a9ae0891d104b1d42de1e8bba2b94e997
MD5 e05464077a5054e30b233b18664a543a
BLAKE2b-256 8904f23db0febcc81e6c9a6538c488217cf325c5dcaf0b1178721848d60c7282

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c326f325e27ace7719abe2b17108479576b16cb97f1a395d23308ebb82b17c67
MD5 97ca7f14022c1899be5cf007bff68bf7
BLAKE2b-256 110a0e7ffda8771c5713afd559f5c062b4a843180a7944665859819e730e612f

See more details on using hashes here.

File details

Details for the file admesh2d-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for admesh2d-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5b909513fa4fafdd342e075847d1f2a71e712cde5d0f55667880a44e58448cbf
MD5 4152fc1d9b6c1e5286d8314d66057d64
BLAKE2b-256 682fb7652887386e471e1e72e8e37eba35df826a21f2fe66d93c524124fed837

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