qtcad.device.maxwell_driven module
Driven Maxwell solver.
- class Solver(d: Device, solver_params: SolverParams | None = None, geo_file: str | Path | None = None)
Bases:
SolverFinite element driven Maxwell equation solver.
- Attributes:
d (
Deviceobject) – 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
Solverclass (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
SolverParamsdocstring for details.geo_file – Path to a raw geometry file (recommended format:
.xao) containing the geometry of the problem. Ifgeo_fileisNonethen the solver will be applied to a static mesh. If it is notNone, 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
dand can be retrieved by calling the corresponding field finding methods such asd.get_e_field_maxwell.
- class SolverParams(inp_dict=None)
Bases:
SolverParamsParameters to pass to the driven Maxwell solver (
Solverconstructor).- 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. IfFalse, 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), orNone. IfNone, the criterion is set to scattering parameters ifsplit_excitationsisTrue, and to electromagnetic energy otherwise. Default:None.
- __init__(inp_dict=None)
Instantiate the
SolverParamsobject.- Parameters:
inp_dict (dict, optional) – Dictionary specifying certain solver parameters to be used instead of their default values.