qtcad.device.maxwell_driven module

Driven Maxwell solver.

class Solver(d: Device, solver_params: SolverParams | None = None, geo_file: str | Path | None = None)

Bases: Solver

Finite element driven Maxwell equation solver.

Attributes:

d (Device object) – the device for which Maxwell equations are to be solved. Results are assigned to the corresponding attributes.

__init__(d: Device, solver_params: SolverParams | None = None, geo_file: str | Path | None = None)

Constructor of the Solver class (driven Maxwell solver).

Parameters:
  • d – the device for which the Maxwell equations are to be solved. Results are assigned to the corresponding attributes.

  • solver_params – The parameters of the solver. See SolverParams docstring for details.

  • geo_file – Path to a raw geometry file (recommended format: .xao) containing the geometry of the problem. If geo_file is None then the solver will be applied to a static mesh. If it is not None, the adaptive solver will be used.

solve()

Solve the Maxwell equations in the frequency domain for a device excited by a current source.

Note

  • The fields are stored in an attribute of d and can be retrieved by calling the corresponding field finding methods such as d.get_e_field_maxwell.

class SolverParams(inp_dict=None)

Bases: SolverParams

Parameters to pass to the driven Maxwell solver (Solver constructor).

Attributes:
  • max_cpus (int) – the largest number of CPUs to use during the solution. Default: the number of logical CPUs available (CPU count on the machine or len(os.sched_getaffinity(0)), if available and has a lower value).

  • freq (float) – the frequency in hertz for which the problem is solved.

  • tol – The relative adaptive meshing tolerance on energy or the absolute tolerance on the S parameters. Default: 0.05.

  • field_results_fmts (str) – list containing “pos”, “vtu”, or both, specifying which file formats to save the results in. Default: [“vtu”].

  • field_results_pos (list[str]) – list that can include any of the following: "e-magn", "b-magn", "ex", "ey", "ez", "bx-imag", "by-imag", "bz-imag". The list specifies which field results to save as .pos files. Default: ["e-magn"].

  • split_excitations (bool) – if True, the problem is solved for each current source individually. If False, the problem is solved for the total excitation resulting from all current sources combined. Default: False.

  • converg_criterion (str or None) – criterion to use for convergence in adaptive meshing. Available values are "S" (scattering parameters), "energy" (electromagnetic energy), or None. If None, the criterion is set to scattering parameters if split_excitations is True, and to electromagnetic energy otherwise. Default: None.

__init__(inp_dict=None)

Instantiate the SolverParams object.

Parameters:

inp_dict (dict, optional) – Dictionary specifying certain solver parameters to be used instead of their default values.