Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

GitHub License GitHub Release PyPI - Downloads DOI

Introduction

LinkedInCover

Hello everybody. Thanks for showing interest in my EM FEM library!

EMerge is a python based FEM EM library for the time harmonic helmholtz formulation. It is thus best suited for Electromagnetic wave phenomenon. You can use it to simulate:

  • RF Filters
  • Signal propagation through PCBs
  • Antennas
  • Optycal systems
  • Arrays and periodic structures
  • Much more!

It is designed to be as easy to use and compatible as possible. It runs on all operating systems allthough some solvers are a bit harder to make work on some systems than others.

EMerge is designed to have your entire simulation start and finish in the same Python script (or more if you want). You require no awkward configuration files, JSON's, external software to do modelling etc. It allows you to do everything in Python:

  • Geometry Creation/description
  • Material assignment
  • Meshing + mesh settings and adaptive mesh refinement
  • Boundary condition setup
  • Solving
  • Post processing and visualization

If you have questions, suggestions, bug reports or just want to hang out, feel free to join the discord!

Discord Invitation

How to install

You can now install the basic version of emerge from PyPi!

pip install emerge

Direct solvers

EMerge solves all systems with direct solvers only. Some are faster than others. Depending on the operating system and hardware you have, some might work better and/or are easier to install than others.

MacOS (ARM)

It is advised to use the Apple Accelerate sparse solver for all cases. On all versions before 2.5.3 install through

pip install https://github.com/FennisRobert/emerge-aasds@v0.2.0

By default the Accelrate solver will be limited to a single thread for frequency distributed sweeps. To allow for more threads either set the environment variable manually:

VECLIB_MAXIMUM_THREADS = 4

Or in Python before loading EMerge:

import os
os.environ['VECLIB_MAXIMUM_THREADS'] = '4'

Of from 2.5.3 onwards also through the config sister module

from emerge_config import config
config.set_acc_threads(4)

Single threaded UMFPACK

There is also an UMFPACK interface but it is more difficult to install and not as fast as the Accelerate solver.

brew install cmake swig suite-sparse pkg-config #MacOS
sudo apt-get install libsuitesparse-dev #Linux

Then on MacOS do:

export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="-I/opt/homebrew/include"
export LDFLAGS="-L/opt/homebrew/lib"
export CFLAGS="-Wno-error=int-conversion"

Finally:

pip install meson-python ninja
pip install --no-build-isolation --no-binary=scikit-umfpack scikit-umfpack

note: If you have any corrections to these instructions (for any os) please let me know!

Multi threaded MUMPS

To install the MUMPS solver on MacOS, download the installer directory from my website and follow the instructions. Please note that Accelerate is also faster than MUMPS in multi-core performance.

https://www.emerge-software.com/resources

Windows (x86)

Windows has easy access to the lightning fast PARDISO solver out of the box, no installation needed. If you want to install the UMFPACK solver for distributed sweeps this distribution should work through conda forge:

conda install conda-forge::scikit-umfpack

Otherwise try the solution in the user manual.

https://www.emerge-software.com/resources

GPU bsed CuDSS solver

If you have a new NVidia card you can try the first test implementation of the cuDSS solver. The dependencies can be installed through:

pip install emerge[cudss]

Limitations: * Cupy is currently only supporting 32 bit integer address so large EM problems cannot be correctly solved currently. This is not something I can do anything about.

Required libraries

To run this FEM library you need the following libraries

  • numpy
  • scipy
  • gmsh
  • loguru
  • numba
  • matplotlib (for the matplotlib base display)
  • pyvista (for the PyVista base display)
  • mkl (x86 devices only)
  • emsutil

Optional:

  • scikit-umfpack
  • cudss
  • ezdxf

Resources / Manual

You can find the latest versions of the manual on: https://www.emerge-software.com/resources/

Generative AI Policy

In this project, generative AI and LLM based AI tools are used for coding assistance, writing of code for quick tests and sometimes the implementations of functions.

This project does not or rarely uses functions that are completely written by generative AI.

This project does not accept completely vibe coded functionality without human supervision, interpretation and validation.

Because the repository has one active developer with multiple personal computers, the commit history is used to transfer code between computers that is not finished. The commit history may therefore contain code that is AI generated during development phases after which it is usually refactored/rewritten.

Some small trivial functions may be copied from LLM output but these are often so trivial that they are not copyrightable anyway. Examples are hard coded matrix multiplication for Numba compiled functions: (this function is coincidentally not generated by LLM's but such functions might have been.)

# Example of a function that could have been but in this case is not written by AI models.
@njit(f8[:, :](f8[:, :], f8[:, :]), cache=True, nogil=True)
def matmul(a, b):
    out = np.empty((3, b.shape[1]), dtype=np.float64)
    out[0, :] = a[0, 0] * b[0, :] + a[0, 1] * b[1, :] + a[0, 2] * b[2, :]
    out[1, :] = a[1, 0] * b[0, :] + a[1, 1] * b[1, :] + a[1, 2] * b[2, :]
    out[2, :] = a[2, 0] * b[0, :] + a[2, 1] * b[1, :] + a[2, 2] * b[2, :]
    return out

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emerge-3.0.0a1.tar.gz (783.3 kB view details)

Uploaded Source

Built Distribution

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

emerge-3.0.0a1-py3-none-any.whl (778.7 kB view details)

Uploaded Python 3

File details

Details for the file emerge-3.0.0a1.tar.gz.

File metadata

  • Download URL: emerge-3.0.0a1.tar.gz
  • Upload date:
  • Size: 783.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.19

File hashes

Hashes for emerge-3.0.0a1.tar.gz
Algorithm Hash digest
SHA256 9fb54316b4aed0660e54bac4ee382931b83463c7b2c6b1c978061e15acf07b3b
MD5 6269e34f8def8ddd890c7b5331ab5571
BLAKE2b-256 c602fa401baceb1fbd2a06aa2371dbd0d64be76f0339007fb070582655b3fee1

See more details on using hashes here.

File details

Details for the file emerge-3.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: emerge-3.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 778.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.19

File hashes

Hashes for emerge-3.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 44183f97b117ccd00f9402dc155ffdaf7067e5675f0a8a81a03a1a813ae70d4e
MD5 e5d41848f9a002c06c5be2c942723cbb
BLAKE2b-256 ac007b5f3e89f1be1dd2c0ab94b014fd46c29a9995ec45ed5c82955ba7d22954

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.0.0a1 This release

2 files

2.8.9

2 files

2.8.8

2 files

2.8.7

2 files

2.8.6

2 files

2.8.5

2 files

2.8.4

2 files

2.8.3

2 files

2.8.2

2 files

2.8.1

2 files

2.8.0

2 files

2.7.5

2 files

2.7.4

2 files

2.7.3

2 files

2.7.2

2 files

2.7.1

2 files

2.7.0

2 files

2.6.1

2 files

2.6.0

2 files

2.5.6

2 files

2.5.5

2 files

2.5.4

2 files

2.5.3

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.3

2 files

2.0.1

2 files

2.0.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.6.11

2 files

0.6.10

2 files

0.6.9

2 files

0.6.8

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.11

2 files

0.4.10

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

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