setup_simulation#

simpleEMS.sim_tools.setup_simulation(params: SimParams, FDTD_boundary: list[str] | None = None) → SimSetup#

Build the CSXCAD geometry container and configure the openEMS/FDTD (or FEM) solver from a parameter object.

Creates the ContinuousStructure and openEMS objects, applies the boundary conditions and Gaussian excitation derived from params.freq_range, and (for the FEM backend) carries params.fem_options through to the returned SimSetup, which is passed to most other SimTools methods.

Parameters:
  • params (SimParams) – Parameter object that holds all simulation parameters, including freq_range, num_points, FDTD_timestep, FDTD_end_criteria, backend_engine, the flat FEM_* mesh/solver tuning fields (including FEM_num_solve_points), and charac_imp.

  • FDTD_boundary (list[str], optional) – Six openEMS boundary-condition strings, one per box face in the order [xmin, xmax, ymin, ymax, zmin, zmax]. Only used by the FDTD backend. Defaults to ["PML_8"] * 6.

Returns:

Named tuple with CSX (CSXCAD geometry), FDTD (openEMS FDTD object), freqs (frequency array), backend_engine, FEM_options (None for FDTD), and charac_imp.

Return type:

SimSetup