FEMOptions#
- class simpleEMS.fem_backend.FEMOptions(boundary: str = 'silver_muller', symmetry: tuple | None = None, fe_order: int = 1, air_pad_frac: float = 0.25, air_pad_mm: float | tuple | None = None, elems_per_wavelength: float = 16.0, mesh_freq: float | None = None, mesh_fine_scale: float = 1.0, min_layers: int = 3, num_solve_points: int = 10, max_solve_points: int | None = None, port_type: str = 'lumpedport', port_mode_modes: int = 6, port_mode_index: int = 0, port_mode_zc: float | None = None, port_mode_eps_eff: float | None = None, waveport_width_mm: float | None = None, waveport_height_mm: float | None = None, kappa_freq: float | None = None)#
Bases:
objectSolver and mesh options shared by every FEM entry point.
Bundles the settings into one object so they can be passed around together instead of as many separate arguments.
- Parameters:
boundary (str) – Outer boundary condition:
"silver_muller"(default),"pml"or"pec". SeeSimParamsfor what each one is for.symmetry (tuple, optional) – Mirror-symmetry plane
(axis, kind, at), whereaxisis"x","y", or"z",kindis"pec"or"pmc", andatis the plane coordinate in metres (Nonefor the structure centre). Only the half of the structure on one side of the plane is meshed. DefaultNone(no symmetry).fe_order (int) – Element order, either
1(default) or2. Order2is more accurate and roughly three times as expensive to solve.air_pad_frac (float) – Air padding around the structure, as a fraction of the free-space wavelength at
mesh_freq. Default0.25. Ignored whenair_pad_mmis set.air_pad_mm (float or tuple, optional) – Air padding around the structure in millimetres, used in place of
air_pad_frac. Either one value for all six faces, three values[x, y, z]padding each axis symmetrically, or three[low, high]pairs padding every face on its own – so an antenna can carry deep air above the patch and little below the ground plane. DefaultNone(pad byair_pad_frac).elems_per_wavelength (float) – Target number of mesh elements per wavelength, applied separately in each material. Default
16.0.mesh_freq (float, optional) – Frequency the mesh is sized at, in Hz. Element size and air padding are both derived from its wavelength, so this is the one number that sets how expensive the mesh is. Default
None, which falls back to the top of the sweep;SimParamsfills it withmain_freq, so a wide plot range no longer refines the mesh.mesh_fine_scale (float) – Multiplier on the element size near conductors. Values above
1coarsen the mesh there. Default1.0.min_layers (int) – Number of element layers through the dielectric thickness. Default
3.num_solve_points (int) – Number of frequencies the sweep solves at, from which the full S-parameter curve is interpolated. Must be
>= 4. Default10.max_solve_points (int, optional) – Ceiling on the solve count when the interpolated curve breaks passivity and the sweep keeps solving to fix it. Must be
>= num_solve_points. DefaultNone, which allows twicenum_solve_points. A passive response costsnum_solve_points.port_mode_modes (int) – Number of eigenpairs each wave port’s mode solve computes. Raise it if a port reports that it found no guided mode. Default
6.port_type (str) – Which port the FEM backend makes of the ports the geometry already carries:
"lumpedport"(default) drives one constant field direction across the port sheet, which is right for a gap feed;"waveport"solves the transverse mode of the port’s cross-section and drives that instead, which is what a transmission line needs. A coplanar waveguide port is always a wave port – its mode is odd, and a single constant vector excites the wrong one.port_mode_eps_eff (float, optional) – Effective permittivity naming which guided mode a wave port runs in: the mode whose own effective permittivity is closest to it is used. This is the robust way to pick a mode on a multi-conductor line, because it names the mode by a property of the line rather than by its position in a spectrum that changes with frequency and mesh density. Takes precedence over
port_mode_index. DefaultNone.port_mode_zc (float, optional) – Characteristic impedance in ohms to reference a wave port’s S-parameters to, overriding the one measured from the solved mode. The measured value is good to a few percent on a single-conductor line such as microstrip, but the power-voltage impedance of a multi-conductor mode depends on which path the voltage is integrated along, so on a coplanar waveguide it is better to state the impedance the line was designed for. Default
None(use the measured value).port_mode_index (int) – Which guided mode a wave port runs in, counting from
0for the one with the largest propagation constant.0(the default) is right for a single-conductor line such as microstrip. A cross-section with more than one conductor above the ground plane – conductor-backed coplanar waveguide is the common case – carries more than one quasi-TEM mode, and the one with the largestbetaneed not be the one the line is meant to run in. Seefem_port_mode.waveport_width_mm (float, optional) – Width of each wave port’s cross-section in millimetres, centred on the line. Default
None:10 * wfor a trace narrower than the substrate is thick,5 * wotherwise, wherewis the port’s width across the line.waveport_height_mm (float, optional) – Height of each wave port’s cross-section in millimetres, measured from the ground side of the substrate. Default
None: six substrate thicknesses.kappa_freq (float, optional) – Frequency at which a CSXCAD material’s
kappawas set, in Hz, which is where it has to be read back as a loss tangent. openEMS models dielectric loss as a conductivity fixed at one frequency –SimParams.substrate_kappaistand*2*pi*main_freq*eps0*eps_r– so inverting it anywhere else scales the loss by the ratio of the two. DefaultNone, which falls back to the sweep’s centre frequency.
Attributes Summary
Return the air padding per face, or
Noneto useair_pad_frac.Attributes Documentation
- air_pad_faces_mm#
Return the air padding per face, or
Noneto useair_pad_frac.- Returns:
((x_lo, x_hi), (y_lo, y_hi), (z_lo, z_hi))in millimetres, orNonewhen no explicit padding is set.- Return type:
tuple[tuple[float, float], …] or None
- air_pad_frac: float = 0.25#
- air_pad_mm: float | tuple | None = None#
- boundary: str = 'silver_muller'#
- elems_per_wavelength: float = 16.0#
- fe_order: int = 1#
- kappa_freq: float | None = None#
- max_solve_points: int | None = None#
- mesh_fine_scale: float = 1.0#
- mesh_freq: float | None = None#
- min_layers: int = 3#
- num_solve_points: int = 10#
- port_mode_eps_eff: float | None = None#
- port_mode_index: int = 0#
- port_mode_modes: int = 6#
- port_mode_zc: float | None = None#
- port_type: str = 'lumpedport'#
- symmetry: tuple | None = None#
- waveport_height_mm: float | None = None#
- waveport_width_mm: float | None = None#