Repository navigation
This release adds crucial features such as CPML absorbing boundaries and total-field/scattered-field beam injection, updates the Mur ABC and periodic boundaries, and improves CAD meshing with sub-cell smoothing.
See the physics guide for the boundary implementations and the updated notebooks on how to use the new features.
New features
🧱 GridFIT3D
Grid and geometry handling has been significantly extended, particularly for CAD import, meshing and visualization.
- Added multiple STL-to-grid meshing methods through the new
stl_methodoption:legacy,interior_points,implicit_distanceandvoxelize_rectilinear. - Added sub-cell/subpixel smoothing of STL material masks, configurable through
subpixel_smoothing,subpixel_smoothing_factor,subpixel_smoothing_thresholdandsubpixel_smoothing_bool. - Added utilities for identifying STL surface cells, checking overlapping masks and building background masks, supporting more robust handling of complex and non-manifold CAD geometries.
- Optimized STL-mask visualization for large meshes and added
plot_stl_mask_slice()for fast 2D inspection. - Grid plotting routines have been moved to the new
PlotMixinGridclass inplotting.py;GridFIT3Dinherits the mixin, so plotting methods remain directly accessible. - Added standalone interactive STL slice measurement utilities in
geometry.py, including point picking, coordinates and distance measurements.
API changes
GridFIT3D.__init__() gains stl_method, subpixel_smoothing, subpixel_smoothing_factor, subpixel_smoothing_threshold and subpixel_smoothing_bool. The default verbosity changes from verbose=1 to verbose=2.
The plot_stl_mask() interface has changed: show_grid, xmax, ymax and zmax are removed, while clip_plane is added. Its defaults are also lighter for improved performance on large meshes, with only the selected STL displayed by default instead of all solids.
⚡🧲 SolverFIT3D
The electromagnetic solver receives the largest update in v0.8.0, with new absorbing-boundary, surface-impedance and source-injection capabilities.
- Boundary-condition handling has been moved to the new
BCsMixininboundaries.py.SolverFIT3Dnow inherits fromPlotMixinSolver,RoutinesMixinandBCsMixin. - Added Convolutional Perfectly Matched Layers (CPML), including configurable
$\kappa$ ,$\alpha$ , conductivity scaling and polynomial grading, with CPU, MKL, GPU and MPI support. - Added Total-Field/Scattered-Field (TF/SF) beam injection for CPML, PML, Periodic and PEC boundaries, together with an improved soft-source treatment to reduce numerical noise around the beam injection line.
- Added first-order DC Surface Impedance Boundary Conditions (SIBC) using the Leontovich approximation for good conductors, with updated material allocation for resolved conductive materials and SIBC surfaces.
- Fixed periodic boundary conditions in all Cartesian directions by closing the FIT topology directly through the
Px,PyandPzderivative matrices and consistently updating periodic metrics. - Replaced the previous FOEXTRAP absorbing boundary with a first-order Mur ABC. Mur currently supports longitudinal
z-/z+boundaries; transverse ABC configurations raiseNotImplementedError. - Improved MPI state loading/restart support and plotting functionality.
plot2D()now optionally supports a PyVista backend.
API changes
SolverFIT3D.__init__() gains use_sibc=False, fmax=1e9, kappa_max=5, alpha_max=0.05, sigma_factor=1, pml_exp=4 and source_type="direct", with source_type accepting "direct" or "tfsf".
The background material changes from bg=[1.0, 1.0] to bg=[1.0, 1.0, 0.0], corresponding to [relative permittivity, relative permeability, conductivity]. Default verbosity changes from verbose=1 to verbose=2.
The meaning of ABC changes from FOEXTRAP to first-order Mur. Private BC routines such as _fill_pml_sigmas(), get_abc() and update_abc() have also been replaced or moved into BCsMixin.
RoutinesMixin.wakesolve() now accepts wakelength=None and changes the default plot_func from PlotMixin.plot2D to None.
🌊 WakeSolver
Wakefield post-processing has been extended with wake-factor calculations and several fixes to beam initialization and result handling.
- Added direct computation of the longitudinal loss factor and transverse horizontal/vertical kick factors through
calc_loss_factor()andcalc_kick_factors(). - Added
reset()to clear calculated wake and impedance quantities and reuse aWakeSolverinstance. - The injection time
tiis now correctly propagated to theBeamsource created bySolverFIT3D.wakesolve(). - Fixed indexing of
WpxandWpy, saving ofWPy, the transverse-gradient finite-difference factor, and wake-potential processing whenskip_cellsis used with one-dimensional storedEztraces. - Standardized logging and verbosity handling across wake and impedance calculations.
API changes
The default Ez_file changes from "Ez.h5" to None; when omitted, it is resolved automatically relative to results_folder. Default verbosity changes from verbose=0 to verbose=1, and log() now accepts an optional verbosity level through log(txt, level=1).
The existing ti argument is unchanged, but now correctly affects the beam created by wakesolve().
🐛 Bug fixes
- Fixed transverse wake-potential indexing for Wpx and Wpy, including non-uniform grids, and corrected the WPy savefile and transverse-gradient factor.
- Fixed periodic boundary conditions in all Cartesian directions, including topology closure, periodic metrics and preservation of periodic fields.
- Fixed several TF/SF and CPML issues, including MPI compatibility, source coordinates, grid staggering and boundary updates.
- Fixed wake-potential post-processing when using skip_cells with one-dimensional stored Ez traces.
- Fixed active scalar handling and several visualization issues in STL-mask and field plotting routines.
💗 Other highlights
- Added extensive regression coverage for CPML, TF/SF injection, PEC/PMC/periodic/Mur boundaries, STL meshing, wake factors and plotting, including MPI tests and visual debugging with --debug-plots.
- Added new example notebooks for CPML/TF-SF wakefield simulations, boundary-condition comparisons and wake-factor calculations, together with corresponding updates to the Physics Guide.
- Introduced pre-commit hooks and updated developer tooling and formatting workflows.
- Replaced the unsupported vtk-osmesa dependency in CI with PyVista headless-display support and updated Python installation workflows.
- Improved logging and verbosity consistency across GridFIT3D, SolverFIT3D and WakeSolver.
Complete contribution list
- ♻️ Refactor boundary condition routines into
boundaries.pyby @elenafuengar in #68 - 🔧 Add pre-commit hooks and format code by @Wandersalamander in #61
- 🐛 Fix indexing bug in
wakeSolver.pyforWpxandWpyby @BerndStechauner in #65 - 🐛 Fix
WPysavefile and incorrect gradient scheme factor by @BerndStechauner in #71 - 🚨 Update developer installation guide and apply pre-commit hooks by @elenafuengar in #70
- ✨ Implement SIBC (Leontovich boundary condition) for good conductors by @elenafuengar in #73
- ⚡ Optimize STL mask plotting and add
plot_stl_mask_slicefor heavy meshes by @elenafuengar in #76 - 🐛 Fix active scalars in STL mask plots by @Clara2223 in #77
- ✨ Add interactive measurement of STL solids by @elenafuengar in #79
- ✨ Add new CAD importing methods to
GridFIT3Dby @Clara2223 in #81 - 🔧 Remove
requirements.txtand update Python 3.10 workflows by @elenafuengar in #82 - ✨ Improve SIBC implementation by @elenafuengar in #80
- ✨ Add interactive inspection with PyVista backend by @elenafuengar in #83
- ✨ Implement SCS meshing in
GridFIT3Dby @Clara2223 in #86 - 📝 Fix documentation link in README by @mctfr in #89
- ✨ Add
tiparameter to beam initialization inwakesolveby @ErikKvikne in #93 - ✨ Implement CPML and soft-source excitation by @Antoniahuber in #87
- ✨ Implement Total-Field/Scattered-Field injection by @Antoniahuber in #90
- 🚑 Replace unsupported
vtk-osmesadependency in CI by @elenafuengar in #99 - 🐛 Fix periodic boundary implementation in x, y, and z through topology
Pmatrices by @elenafuengar in #100 - ✨ Add wake factor computation for loss and kick factors by @saraadastan in #78
- ✅ Add
--debug-plotsfor visual regression comparison by @elenafuengar in #97 - ✨ Enable TF/SF injection with PML and PEC boundaries by @Antoniahuber in #98
- 🐛 Fix ABC implementation by replacing FOEXTRAP with Mur ABC by @elenafuengar in #101
- 📝 Add CPML usage notebook by @Antoniahuber in #103
- 🔖 Checks before the v0.8.0 release by @elenafuengar in #104
👋👩💻 New Contributors
- @Wandersalamander made their first contribution in #61
- @BerndStechauner made their first contribution in #65
- @Clara2223 made their first contribution in #77
- @ErikKvikne made their first contribution in #93
- @saraadastan made their first contribution in #78
| 78 commits | 📚 Docs | 🧪 Tests | 🐛 Fixes | 🎨 Style | ✨ Features | Other |
|---|---|---|---|---|---|---|
| % of commits | 15% | 22% | 17% | 4% | 28% | 14% |
Full Changelog: v0.7.0...v0.8.0