Skip to main content

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

Project description

ADMESH

An advanced, automatic unstructured mesh generator for 2D shallow-water models. Built for ADCIRC compatibility — meshes round-trip natively as fort.14.

Colton J. Conroy1, Ethan J. Kubatko1, Dustin W. West1
1Computational Hydrodynamics and Informatics Lab (CHIL), The Ohio State University
Ocean Dynamics 62, 1503–1517 (2012) · doi:10.1007/s10236-012-0574-0

Python implementation maintained by Dominik Mattioli (Penn State University).

ADMESH mesh of the Western North Atlantic, Gulf of Mexico, and Caribbean Sea.


Install

🚧 0.1.0 in progress. Spec 002 lands the default size-field stack

  • ADCIRC paired-edge BC support; the first PyPI tag follows when the Tier-2 / WNAT structural-validity gate is green (issue #10). Until then, install from source.
pip install admesh2D            # core (when 0.1.0 ships)
pip install admesh2D[viz]       # adds matplotlib for mesh.plot()

From source (current):

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

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


Quickstart

🚧 The triangulate() defaults are stabilizing across spec 002. The 3-line idiom below works today; advanced kwargs (enable_curvature, enable_medial_axis, bathymetry, tide_period, default_depth, …) are documented in specs/002-size-field-defaults/contracts/python-api-default-stack.md.

import admesh

domain = admesh.domain_from_polygon([outer_ring_xy, hole_ring_xy])
mesh = admesh.triangulate(domain)
mesh.to_fort14("out.14")

mesh is a frozen Mesh dataclass — typed nodes, elements, boundary segments (with BoundaryType codes), and per-element quality.

Round-trip with ADCIRC fort.14

mesh = admesh.read_fort14("input.14")
mesh.to_fort14("output.14")
assert mesh.equals(admesh.read_fort14("output.14"))

Custom size-field contribution

def refine_near_breaker(pts):
    return 50.0 + 0.2 * np.abs(pts[:, 0] - 1500.0)

mesh = admesh.triangulate(domain, user_contribs=[refine_near_breaker])

Built-in size-field stages (curvature, medial axis, bathymetry, tide) min-stack identically to MATLAB. User contributions compose on top via a user-chosen combiner (default elementwise minimum).


Status

Under construction. The v1 plan and task list live in specs/001-pythonize-and-fort14-integration/ (shipped) and specs/002-size-field-defaults/ (in progress — wires the MATLAB-faithful size-field stack as the default Phase-1 in triangulate() + extends fort.14 for IBTYPE 3 / 4 / 13 / 24 paired-edge BC records). The faithful Python port of the original 13-stage pipeline is the production path (now 250+ tests passing); the Pythonic API + fort.14 I/O are the 0.1.0 deliverables.

Upstream

The reference MATLAB implementation is coltonjconroy/ADMESH, maintained by the original author. That repository may carry features beyond what this port currently covers; new functionality is adopted here as it's pulled across.

Citation

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

A copy is included at papers/Conroy-2012-ADMESH.pdf.

Contact

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.1.0.tar.gz (109.4 kB view details)

Uploaded Source

Built Distribution

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

admesh2d-0.1.0-py3-none-any.whl (72.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for admesh2d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92352ae56b8cdad8e8d51c9bee4585251064d481084f478cc1c45fe273588ff2
MD5 cb038c9ac421c8fd6088e309f032a945
BLAKE2b-256 1dc5eeed447a576929e3b09db542c0c1d18fefba458373dfddc7bb8615ff80b3

See more details on using hashes here.

File details

Details for the file admesh2d-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: admesh2d-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 72.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for admesh2d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 337a73afb847b7f1acfe4755af6b5c17f088dcf9077334e7a188690298b19021
MD5 80a8967df7ccd4504d04ebc4644720ba
BLAKE2b-256 2f3f6454daf1b6d730f230d937f562c9d68efef20f98d32a1297fd6bed3de64b

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