Skip to content

Wakis v0.8.0

Latest

Choose a tag to compare

@elenafuengar elenafuengar released this 02 Oct 16:00
· 2 commits to main since this release
e0d8f2f

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_method option: legacy, interior_points, implicit_distance and voxelize_rectilinear.
  • Added sub-cell/subpixel smoothing of STL material masks, configurable through subpixel_smoothing, subpixel_smoothing_factor, subpixel_smoothing_threshold and subpixel_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 PlotMixinGrid class in plotting.py; GridFIT3D inherits 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 BCsMixin in boundaries.py. SolverFIT3D now inherits from PlotMixinSolver, RoutinesMixin and BCsMixin.
  • 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, Py and Pz derivative 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 raise NotImplementedError.
  • 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() and calc_kick_factors().
  • Added reset() to clear calculated wake and impedance quantities and reuse a WakeSolver instance.
  • The injection time ti is now correctly propagated to the Beam source created by SolverFIT3D.wakesolve().
  • Fixed indexing of Wpx and Wpy, saving of WPy, the transverse-gradient finite-difference factor, and wake-potential processing when skip_cells is used with one-dimensional stored Ez traces.
  • 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

👋👩‍💻 New Contributors

78 commits 📚 Docs 🧪 Tests 🐛 Fixes 🎨 Style ✨ Features Other
% of commits 15% 22% 17% 4% 28% 14%

Full Changelog: v0.7.0...v0.8.0