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): the whole initial mesh gets one quality-improvement pass.

  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.

    Narrow strips (e.g. thin PCB traces) are detected from the geometry tags. Where a strip lies next to tets at the error level just refined, its curve edges are split until they are at most strip_ratio (default 4) strip widths long. Without this, every triangle across a narrow strip is a sliver, whatever the triangulation. Strips in quiet regions keep their mesh. With strip_gated=False, all narrow strips are regularised once in step 0 instead, regardless of the error.

  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, strip_gated, 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.
  • Narrow-strip regularisation 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.2

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.2
File Size Uploaded Provenance
emerge_aura-0.1.2.tar.gz 52.5 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for emerge-aura 0.1.2
File
emerge_aura-0.1.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
emerge_aura-0.1.2-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.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
emerge_aura-0.1.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
emerge_aura-0.1.2-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.2.tar.gz

Download URL emerge_aura-0.1.2.tar.gz
Size 52.5 kB
Tags Source
SHA-256 checksum
How to use checksums
05acb3b595f7606e62463b1f8a199c2a991510a064a4ef487f62e4c684e58095
BLAKE2b-256 checksum
How to use checksums
88ee23f30d2bca7daf530d731ec14c795220bb6404e2d2782ca529e0730cd11f
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 15, 2026.

Transparency log

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

Download URL emerge_aura-0.1.2-cp39-abi3-win_amd64.whl
Size 309.1 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d8af873a759c61f0add2e203ddc73378f93246606a72a35f27a81723ec646de4
BLAKE2b-256 checksum
How to use checksums
7b2f61c38930a47e9a51a793c3da0419cbc724df6c1022e68aee4cb95f68424d
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 15, 2026.

Transparency log

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

Download URL emerge_aura-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 420.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
60cc016aedd83b85259913697119b4e594bee6a86a14501287298cc5e15a23ff
BLAKE2b-256 checksum
How to use checksums
bb76663d5bb86955d1ae1932a2de38a10895e27ea5e5874ddadd5976e58fd8b3
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 15, 2026.

Transparency log

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

Download URL emerge_aura-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 410.9 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
524256d60c370f7a5c270000bee568b3be1b4056c7affe23e0e9929d68a864a2
BLAKE2b-256 checksum
How to use checksums
3ee23d2cf79b6435b4f79e5dabd146ec633b94529f07bc26530333c97dfc1fd7
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 15, 2026.

Transparency log

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

Download URL emerge_aura-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Size 378.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e646802eccbbfadac3f4fa3ea1d9ee04c0a693bc04c7986a10a4f1b12d271538
BLAKE2b-256 checksum
How to use checksums
0f253c3254c272ba8faed1070465c79e9e6d0c34cacd19198197d574ed60c350
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 15, 2026.

Transparency log

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

Download URL emerge_aura-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 394.7 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f3787a0b227a5748abe70a084f16a7563728785f693852f20316e68f617c02c2
BLAKE2b-256 checksum
How to use checksums
6097008cc2cbf380e47942ebba60c3c43471c33ce866ccc4d102e857352cfd36
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 15, 2026.

Transparency log

Security for emerge-aura 0.1.2

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.2.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 15, 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