simulate_step_FEM#
- simpleEMS.fem_backend.simulate_step_FEM(step_file: str, freqs: NDArray, *, unit: str = 'mm', dielectrics: dict | None = None, pec: list | None = None, lossy_conductor: dict | None = None, ports: dict | None = None, FEM_boundary: str = 'silver_muller', FEM_symmetry: tuple | None = None, FEM_fe_order: int = 1, FEM_air_pad_frac: float = 0.25, FEM_air_pad_mm: float | tuple | None = None, FEM_elems_per_wavelength: float = 16.0, FEM_mesh_freq: float | None = None, FEM_mesh_fine_scale: float = 1.0, FEM_min_layers: int = 3, FEM_num_solve_points: int = 10, FEM_max_solve_points: int | None = None, charac_imp: float = 50.0, output_path: str | Path = 'Sim_Path', run: bool = True, show_mesh: bool = True, mesh_style: str = 'wireframe', verbose: bool = True) SimData#
Simulate a STEP geometry with the FEM backend and return the results.
A standalone entry point that needs no CSXCAD geometry: it meshes the STEP file, runs the frequency sweep, and returns the same results bundle the rest of the pipeline uses, so all
SimToolspost-processing applies.- Parameters:
step_file (str) – Path to the
.stepfile to simulate.freqs (NDArray) – Frequency points (Hz) to report results at.
unit (str) – Advisory only – the unit declared in the STEP file itself is what gets used. Default
"mm".dielectrics (dict, optional) – Dielectric solids, as
{solid_name: (eps_r, tan_d)}.pec (list, optional) – Names of solids to treat as perfect electric conductors.
lossy_conductor (dict, optional) – Lossy conductors, as
{solid_name: sigma}withsigmain S/m.ports (dict, optional) – Ports, as
{solid_name: {"z0": ..., "direction": "x|y|z", "number": ..., "kind": "lumped|wave", "prop_dir": "x|y|z"}}. Onlykind: "wave"readsprop_dir, the axis the line runs along; such a port’s solid must be the line’s cross-section, normal to it. Ifportsis omitted, solids whose names look like ports are used instead.FEM_boundary (str) – Outer boundary condition:
"silver_muller"(default),"pml"or"pec".FEM_symmetry (tuple, optional) – Mirror-symmetry plane
(axis, kind, at), so only half the structure is meshed. SeeFEMOptions. DefaultNone.FEM_fe_order (int) – Element order:
1(default) or2.FEM_air_pad_frac (float) – Air padding around the structure, as a fraction of the longest wavelength. Default
0.25. Ignored whenFEM_air_pad_mmis set.FEM_air_pad_mm (float or tuple, optional) – Air padding around the structure in millimetres, used in place of
FEM_air_pad_frac. Either one value for all six faces, three values[x, y, z], or three[low, high]pairs. DefaultNone.FEM_elems_per_wavelength (float) – Target number of mesh elements per wavelength. Default
16.0.FEM_mesh_freq (float, optional) – Frequency the mesh is sized at, in Hz – both the element size and the air padding come off its wavelength. Default
None, which sizes the mesh at the top offreqs. Name the frequency the structure was designed at to stop a wide sweep refining the mesh.FEM_mesh_fine_scale (float) – Multiplier on the element size near conductors. Default
1.0.FEM_min_layers (int) – Number of element layers through the dielectric thickness. Default
3.FEM_num_solve_points (int) – Number of frequencies the sweep solves at (must be
>= 4). Default10.FEM_max_solve_points (int, optional) – Ceiling on the solve count when the curve breaks passivity. Default
None, which allows twiceFEM_num_solve_points.charac_imp (float) – Port reference impedance in ohms, used for any port that does not set its own. Default
50.0.output_path (str | Path) – Working directory for the mesh, problem, and result files. Default
"Sim_Path".run (bool) – Whether to solve. If
False, the geometry is only meshed and the results are read back from an earlier run inoutput_path. DefaultTrue.show_mesh (bool) – Whether to show the created mesh. Default is
True.mesh_style (str) – mesh style to be used for visualisation. default is “wireframe”. other options are: “surface” | “wireframe” | “points”,
verbose (bool) – Print progress. Default
True.
- Returns:
Named tuple of
freqs,s11,s21(Nonefor a single-port problem),z11,vswr,input_power,port_voltage,port_current, andref_impedance. SeeSimData.- Return type:
SimData
- Raises:
RuntimeError – If no ports are found or specified, or if
runisFalseandoutput_pathholds no results from an earlier run.