Skip to main content

emerge-aura

AURA — Adaptive Unstructured Refinement Algorithm for the EMerge full-wave FEM solver.

What it does

EMerge's default adaptive mesh refinement (AMR) regenerates the whole mesh with GMSH on every pass, using a size field derived from the error estimate. AURA instead refines the existing mesh locally:

  1. Step 0 (once, before the first solve): narrow strips such as thin PCB traces are detected purely from the geometry tags. The curve edges along each strip are split until they are at most strip_ratio (default 4) strip widths long, and the whole mesh gets one quality pass. Without this, every triangle across a narrow strip is a sliver, whatever the triangulation.

  2. The tetrahedra with the highest error are bisected through their longest edge, one at a time, until the mesh has (1 + growth) times as many tets. Every split is conforming: all tets around the split edge are bisected together, so there are never hanging nodes.

  3. New nodes on curved faces and curves (spheres, cylinders, circles, B-splines, …) are projected onto a one-time snapshot of the original OCC geometry, so the mesh converges to the real geometry rather than the initial facets.

  4. The new tets, plus a few layers of neighbouring old tets where new and old elements meet, are improved by flips and smoothing:

    • 2-3 flips,
    • edge removal for edges with 3 to 7 tets around them,
    • smoothing of interior nodes,
    • in-plane sliding of nodes on planar geometric faces,
    • surface flips (swapping the diagonal between two triangles of the same planar face).

    A change is only accepted if it improves the worst tet it touches. Curve nodes never move, and face nodes never leave their plane.

  5. Periodic boundaries are supported. An edge on a periodic face is always split together with all of its periodic images, so paired faces stay exact translated copies. Node numbering stays consistent across each pair, which EMerge needs for consistent edge orientations.

  6. Every geometric tag is inherited exactly: volumes, faces (boundary conditions!), curves and points. EMerge's Mesh3D is rebuilt from that, without calling GMSH.

Why

Speed. Regenerating the whole mesh every pass is slow on complex geometries with many edges and faces, such as PCBs. The size-field interpolation of the remeshing method also gets very expensive at high tet counts. AURA's cost per pass grows only with the number of tets and doesn't depend on how complicated the geometry is.

The GMSH remeshing AMR builds a fresh, globally optimised mesh every pass, so it remains the reference for mesh quality. AURA aims to stay close to it while being much faster. On smooth geometries with few edges and low tet counts the speed gain is small: about 1.5× for the mesh-update step at 130k tets on the patch antenna test case. That test case also shows AURA keeping the minimum element quality roughly constant over many passes.

Installation

pip install emerge-aura

Prebuilt wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon, Intel) and Windows (x64), for Python 3.9 and newer. On other platforms pip builds from source, which needs a Rust toolchain (https://rustup.rs). To install the latest development version:

pip install git+https://github.com/FennisRobert/EMerge-aura.git

It will also install as an EMerge extra: pip install emerge[aura].

emerge-aura only depends on numpy. It does not import EMerge.

Usage with EMerge

Nothing changes in your script. When emerge_aura is installed, Simulation.adaptive_mesh_refinement uses it automatically:

model.adaptive_mesh_refinement(
    max_steps=10,
    frequency=1.59e9,
    growth=0.3,          # +30 % tets per pass
    show_mesh=True,      # show the mesh after every pass
)

AURA-specific arguments:

Argument Default Meaning
growth 0.3 Tet growth per pass: a float, a per-pass list such as [1.0, 0.6, 0.3], "auto" (predicted from the error estimate using theta/order), or a callable f(step, info) -> float
growth_limits (0.1, 1.0) Clamp on the growth of every pass
use_aura True Set to False to force the original GMSH remeshing AMR
aura_options None Dict with max_depth, lepp_ratio, improve_sweeps, improve_layers, improve_initial, improve_global, strip_ratio, strip_max_growth, project_boundaries

For a callable growth, info contains n_tets, error (per-tet error indicator), convergence (the last max |ΔS|, or None) and auto (the value "auto" would have used). For example:

model.adaptive_mesh_refinement(growth=lambda step, info: 1.0 if step < 3 else 0.3)

Periodic models (e.g. em.HexCell unit cells) work as well. On test_cases/test_4_periodic.py (hexagonal waveguide array cell with a PEC sphere and iris), the AURA AMR result is within 0.15 dB of a uniformly fine reference mesh.

Standalone API

The core works on plain numpy arrays (row-major: nodes (N, 3), tets (M, 4)):

import emerge_aura

result = emerge_aura.refine(
    nodes, tets, error,
    tet_region=region,                              # optional, e.g. volume tag per tet
    face_tris=tris, face_tri_tags=tri_tags,         # optional, tagged boundary triangles
    curve_edges=edges, curve_edge_tags=edge_tags,   # optional, tagged curve edges
    growth=0.3,
)
result.nodes, result.tets, result.tet_region, result.face_tris, result.face_tri_tags, result.stats

q = emerge_aura.quality(result.nodes, result.tets)  # mean-ratio quality per tet (1 = regular)

The original nodes keep their indices, and new nodes are appended after them.

Layout

src/refine.rs                      Longest-edge bisection with conforming edge splits and tag inheritance
src/improve.rs                     Flips (2-3, edge removal 3..7) and constrained smoothing, incl. in-plane sliding
src/geom.rs                        BREP snapshot primitives and point projection
src/lib.rs                         PyO3 bindings
python/emerge_aura/__init__.py     refine(), quality()
python/emerge_aura/brep.py         One-time geometry snapshot from GMSH/OCC (gmsh imported lazily)
python/emerge_aura/emerge_tools.py Mesh3D rebuild without GMSH, refine_mesh_step(), growth rules
test_cases/                        EMerge models used for testing, plus check_mesh_update.py

Development

cargo test --no-default-features                 # Rust unit tests (no Python needed)
pip install .                                    # build the extension with maturin
python test_cases/check_mesh_update.py           # Mesh3D consistency checks (requires EMerge)
python test_cases/check_periodic.py              # periodic face matching / ordering checks (requires EMerge)

check_mesh_update.py verifies that the GMSH-free topology rebuild reproduces EMerge's own Mesh3D._pre_update exactly. It also checks that a refined mesh passes Mesh3D.diagnose() and keeps every domain volume, face area and tag intact.

Releasing

Wheels for all platforms are built by GitHub Actions (.github/workflows/release.yml) on every push and pull request. To publish a release to PyPI:

  1. Bump version in Cargo.toml. It is the single source of the package version.
  2. Commit, then tag and push: git tag v0.1.1 && git push origin main v0.1.1.

The workflow checks that the tag matches Cargo.toml, builds and smoke-tests all wheels, and uploads them with the sdist to PyPI using Trusted Publishing.

Known limitations

  • Refinement only: the mesh is never coarsened.
  • Quality improvement only covers the refined region plus improve_layers rings of neighbours.
  • Flat tets in thin layers (e.g. a substrate meshed one element thick) cannot be fixed without refining the whole layer, so they stay as they are.
  • Step 0 does not grade the faces next to a refined strip. Very small strip_ratio values (around 2) therefore create fan-shaped slivers beside the strip; the default of 4 avoids this.
  • The number of tets per pass slightly overshoots the target when the last split has a large shell.

License

GPL-2.0-or-later, the same as EMerge.

Metadata

Release files for emerge-aura 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emerge-aura 0.1.1
File Size Uploaded Provenance
emerge_aura-0.1.1.tar.gz 51.2 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for emerge-aura 0.1.1
File
emerge_aura-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
emerge_aura-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
emerge_aura-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 2.0 MB

Release files / emerge_aura-0.1.1.tar.gz

Download URL emerge_aura-0.1.1.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
729e434e6b2db32f1f12a09aa2a1f30ea196409327410bdb9677d8219b01a92c
BLAKE2b-256 checksum
How to use checksums
387dd9e3e45458e729c84cfc57c0fbcbfcebf26e28bcf99d04c288abf8bf5da2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / emerge_aura-0.1.1-cp39-abi3-win_amd64.whl

Download URL emerge_aura-0.1.1-cp39-abi3-win_amd64.whl
Size 307.9 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e954c2f9990f6b887b94237e6aefae16ab7898212877406f1ed788128c8b2c84
BLAKE2b-256 checksum
How to use checksums
b4690288315373922791112d3c665e71c1d5ca3f8117d878b3138997aa4b3bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 419.9 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
88d4b6f220038f59006fd82cfd1094d119ce353e86a1603a9ba4e2713305d2d1
BLAKE2b-256 checksum
How to use checksums
fea7cd2983934dd33d077b8f1f137759674332d6622201d92fd8036346a09c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL emerge_aura-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 409.3 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
8fec6b85da8916848941f882942754d5fadac35e52b2e2181b362bb7370e4733
BLAKE2b-256 checksum
How to use checksums
6d9f9d3f4d1c073ad0677d3f135c7a463c9e93684b28c934587d050774abc14a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / emerge_aura-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL emerge_aura-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 377.7 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cf26fde6c14401a8f2284d96efae88a5b2755854f5793f68df5e7feb6e88c4b3
BLAKE2b-256 checksum
How to use checksums
c3c76804a27e264c857156ae8d8ed1a9665ec54c9e53656905e8f6665f620ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / emerge_aura-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL emerge_aura-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 393.6 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5e6b7a7f8cdb4d17496d736346057667c7b3eec041ebe4192cf2bc6190ad13c1
BLAKE2b-256 checksum
How to use checksums
42211f79c99b93e5124389ace1b56252060f253977bb800fe0662bc907b3b86f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Security for emerge-aura 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for emerge_aura-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page