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.0

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.0
File Size Uploaded Provenance
emerge_aura-0.1.0.tar.gz 50.5 kB With provenance Details

Built distributions (wheels)

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

Total release size: 1.9 MB

Release files / emerge_aura-0.1.0.tar.gz

Download URL emerge_aura-0.1.0.tar.gz
Size 50.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aae21a9a85d3eaa9172718cc39ec96618920584512a251f7819b354df0243c0c
BLAKE2b-256 checksum
How to use checksums
0ec5530f4e424770f3821686768f9b7d11c0f0ca19c99049be59cece869db521
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.0-cp39-abi3-win_amd64.whl

Download URL emerge_aura-0.1.0-cp39-abi3-win_amd64.whl
Size 303.9 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
848ca9c2841574d6a47eec66213b1a5b5c659927fd5a8b347e7898d00d179cb3
BLAKE2b-256 checksum
How to use checksums
07d30b0267a3dd40d58968a2231e5bfd54984d547d36e742d8d286b269639f2b
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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL emerge_aura-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 416.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8c2b620a7deb46ee035d3b826d7130f4ca573d6e1a77b9815a140b4427255d7e
BLAKE2b-256 checksum
How to use checksums
fe6e314d2755c2a8a9b94e6dc12f3b3a70f358a28616831fd0e3820aafa92f9d
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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL emerge_aura-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 404.9 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5b5ee71459db1169f38f568fcc0e477766b91283930af3ef873a210b733760d1
BLAKE2b-256 checksum
How to use checksums
06d3518b7fc055e7541a3acc61ebda365000b08c6a445709bf82b87a333f6f8b
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.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL emerge_aura-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Size 374.1 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f35921d515fd265f0d999e033a37e740f8413bbe87554715ff86c032b256db23
BLAKE2b-256 checksum
How to use checksums
c31a31a87407d7ec0d666b8dbee471e422bcb9e58482ef1c45e1b76e6ea83738
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.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL emerge_aura-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 390.6 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
99f6df7889d8e8f83cee739146e9998d087215f01aa4ff042a3434bcf1dac9ac
BLAKE2b-256 checksum
How to use checksums
a80e7481726d48613d0c71daf780df71b262e780285f312e661ad85e635ba8d0
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.0

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.0.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