Skip to main content

GMES

GMES (GIST Maxwell's Equations Solver) is a free electromagnetic simulator that solves Maxwell's equations with the explicit finite-difference time-domain (FDTD) method. It provides a Python interface backed by C++, SWIG, and Cython extensions for modeling photonic devices in one-, two-, and three-dimensional Cartesian domains.

Features

  • 1D, 2D, and 3D Cartesian FDTD simulations
  • TE, TM, and TEM simulation classes
  • Dielectric, Drude, Lorentz, critical-point, and related dispersive material models
  • UPML and CPML absorbing boundary layers
  • Point, continuous-wave, Gaussian, bandpass, and total-field/scattered-field sources
  • Geometric primitives including blocks, spheres, cylinders, cones, ellipsoids, and shells
  • Bloch-periodic simulations with complex-valued fields
  • Optional MPI-based parallel execution
  • Field visualization and HDF5 output utilities

Requirements

  • Python 3.14 or newer (the tested 0.10.0 release target is Python 3.14)
  • A C++23 compiler and standard library
  • SWIG 4
  • NumPy 2.3 or newer
  • SciPy 1.16 or newer

GMES 0.10.0 publishes binary wheels for the following combinations:

Python Operating system Architecture Minimum platform
CPython 3.14 Linux x86_64 glibc 2.34 (manylinux_2_34)
CPython 3.14 macOS arm64 (Apple silicon) macOS 11

Source installations are supported on current Linux x86_64 and macOS arm64 systems with the native toolchain documented below. Windows and macOS x86_64 are not supported by the 0.10.0 release because they do not have tested wheel builds. Python versions newer than 3.14 may satisfy the package metadata but are not part of the 0.10.0 tested release matrix.

Matplotlib, mpi4py, and PyTables are available through the plot, mpi, and hdf5 optional dependency groups.

System prerequisites

On Ubuntu 24.04 or newer, install the compiler toolchain and SWIG with:

sudo apt-get update
sudo apt-get install --yes build-essential swig
c++ --version
swig -version

On macOS, install the current Xcode Command Line Tools and SWIG:

xcode-select --install
brew install swig
c++ --version
swig -version

The native extensions are always compiled in C++23 mode. They use std::mdspan when the standard library provides <mdspan> and otherwise use the internal contiguous-indexing fallback. That fallback does not add support for older C++ language modes.

Installation

On a supported wheel platform, create an isolated Python environment and install the release from PyPI; a compiler and SWIG are not needed for this path:

python3.14 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "gmes==0.10.0"

For a source checkout or source distribution, install SWIG and the compiler toolchain first, then install the local project:

python3.14 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install .

For development, install uv, then create the locked Python 3.14 environment with the optional runtime dependencies needed by the tests:

uv python install 3.14
uv sync --locked --extra hdf5
uv run --no-sync python -m unittest discover -v
uv build

This checkout requires uv 0.12.5; uv exits with an actionable version error when a different release is used.

The dev dependency group is installed by default. Other supported runtime combinations include --extra plot, --extra mpi, and --extra all. The build uses the PEP 517 configuration in pyproject.toml; invoking setup.py directly is not supported.

If an existing checkout used python -m pip install -e ".[dev,hdf5]", switch to the commands above. dev is now a PEP 735 dependency group rather than a package extra, and uv sync installs it by default. Extras such as hdf5, plot, and mpi remain explicit --extra options. Use uv sync --locked when consuming the committed lockfile; reserve uv lock --upgrade for a deliberate dependency-update change.

Quick start

The following example creates a two-dimensional TMz domain in air, surrounds it with a CPML absorbing boundary, and excites an Ez point source:

from gmes import Cartesian, Continuous, Cpml, DefaultMedium, Dielectric
from gmes import Ez, PointSource, Shell, TMzFDTD

space = Cartesian(size=(10, 10, 0), resolution=20)
geometry = [
    DefaultMedium(material=Dielectric()),
    Shell(material=Cpml()),
]
sources = [
    PointSource(
        src_time=Continuous(freq=0.8),
        center=(0, 0, 0),
        component=Ez,
    ),
]

simulation = TMzFDTD(space, geometry, sources)
simulation.init()
simulation.step_until_t(10)

The quick-start code above uses only the base dependencies. To run the visualizing air2d.py example, install its plotting and HDF5 dependencies and then launch it from the repository root:

uv sync --locked --extra plot --extra hdf5
uv run --no-sync python examples/air2d.py

See examples/ for simulations of wave propagation, Fresnel reflection, photonic-crystal waveguides, slab waveguides, plasmonic arrays, and total-field/scattered-field excitation. Some three-dimensional examples require more than 1 GB of memory and are not suitable as routine smoke tests.

Testing and packaging

Run the complete test suite and build both distribution formats with:

uv run --no-sync python -m unittest discover -v
uv build

The tests include component coverage, geometry and source-time checks, a deterministic FDTD regression, and optional HDF5 output coverage. The HDF5 tests are skipped when PyTables is not installed.

macOS wheels target macOS 11 by default. Set MACOSX_DEPLOYMENT_TARGET explicitly before building only when a wheel intentionally requires a newer macOS release; the build verifies both the wheel platform tag and every native extension's minimum OS load command.

Release artifacts are built only by the tag-triggered GitHub Actions release workflow. Maintainers must not upload files from a local dist/ directory. See docs/releasing.md for the release checklist.

Parallel execution

Install an MPI implementation (libopenmpi-dev openmpi-bin on Ubuntu or open-mpi with Homebrew on macOS), then install the Python extra and use its launcher through the uv environment:

# Ubuntu
sudo apt-get install --yes libopenmpi-dev openmpi-bin

# macOS
brew install open-mpi
uv sync --locked --extra mpi
uv run --no-sync mpiexec -n <process-count> python <simulation.py>

Repository layout

gmes/       Python package and public simulation API
src/        C++, SWIG, and Cython extension sources
examples/   Example electromagnetic simulations
tests/      Unit and numerical regression tests
utils/      Data-processing and diagnostic utilities
docs/       Maintenance and migration notes

Known limitations

  • Do not use numpy.inf for simulation bounds; use a sufficiently large finite value instead. GMES does not consistently treat numpy.inf as infinity.
  • Some large examples retain their historical problem sizes and can consume substantial memory and execution time.
  • Linux and macOS are exercised by CI; other platforms may require build-system adjustments.

Contributing and support

See CONTRIBUTING.md for the development workflow. Bug reports and patches are welcome through the GitHub issue tracker. Historical releases and discussions remain available on the GMES SourceForge project.

License

GMES is distributed under the GNU General Public License version 3 or later (GPL-3.0-or-later). See LICENSE for the full license text.

Copyright (C) 2007-2012 Kyungwon Chun.

Metadata

Release files for gmes 0.10.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 gmes 0.10.0
File Size Uploaded
gmes-0.10.0.tar.gz 573.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for gmes 0.10.0
File Interpreter ABI Platform
gmes-0.10.0-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
gmes-0.10.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details

Total release size: 8.3 MB

Release files / gmes-0.10.0.tar.gz

Download URL gmes-0.10.0.tar.gz
Size 573.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d3ea220037df17208909e9bc1cb5bfa9a75fc976b60a7f9bd87ea78e71b70c23
BLAKE2b-256 checksum
How to use checksums
37520eb5e576955b510b840a321c5834dc74e9c55daf95d1cba27f800770504e
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 Aug 21, 2026.

Transparency log

Release files / gmes-0.10.0-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL gmes-0.10.0-cp314-cp314-manylinux_2_34_x86_64.whl
Size 7.0 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
429bf3767f8c638f0e1c171974cff24a606fae43ee100446a74bcc6e16967ea1
BLAKE2b-256 checksum
How to use checksums
fcd0a137c3ae88b44b7c703773b37b7c5e1113153a8f202e70f32937d2b90bd8
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 Aug 21, 2026.

Transparency log

Release files / gmes-0.10.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL gmes-0.10.0-cp314-cp314-macosx_11_0_arm64.whl
Size 710.1 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
819a99cb66919d6280083e3d29bcc2d0665efea6786c72c9689ce3b07dda279c
BLAKE2b-256 checksum
How to use checksums
000274829104b133e2a30982b379d45140ae6963783f1d720c5ae29fdc67945d
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 Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

3 release 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