qtcad.device.poisson_linear module

Linear Poisson solver.

class qtcad.device.poisson_linear.Solver(d, solver_params=None, geo_file: str | None = None)

Bases: Solver

Finite element solver for linear Poisson’s equation, given a charge density stored in the ‘rho’ attribute of the input device.

Attributes:
  • d (device object) – The device for which to solve Poisson’s equation

  • tol (float) – Tolerance on the potential to use in a calculation if method is iterative.

  • maxiter (int) – Maximum number of iterations in a self-consistent loop if method is iterative.

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

Constructor of the solver class.

Parameters:
  • d (device object) – Device for which Poisson’s equation must be solved.

  • solver_params (SolverParams obj or None, optional) – The parameters of the solver.

  • geo_file (str, optional) – Path to file containing the geometry of the problem. Available formats are .geo_unrolled (recommended when using the built-in Gmsh geometry kernel) and .xao (recommended when using the OpenCASCADE Gmsh geometry kernel). If geo_file is None then Poisson’s equation is solved over the mesh saved in d, and the mesh is static. If geo_file is not None, adaptive meshing will be used.

solve()

Solves the linear Poisson equation.

class qtcad.device.poisson_linear.SolverParams(inp_dict=None)

Bases: SolverParams

Parameters to pass to a linear Poisson solver.

Attributes:
  • tol (float) – Tolerance to use in an iterative solution, in volts. Default: 1e-6.

  • maxiter (int) – Maximum number of iterations in an iterative solution. Default: None (eventually None is passed to the linear system solver, unless the solver does not accept None as input).

  • method (str) – The method to use to solve the linear problem: “direct” or “iterative”. Default: “iterative”.

  • eta0 (float) – Tolerance on the potential to use in an adaptive calculation.

  • refined_mesh_filename (str) – Path to the file containing the refined mesh.

  • h_max (float, optional) – Maximum characteristic length of the mesh. Default: None.

  • print_gmsh_outputs (bool, optional) – If True, print the outputs of gmsh. Default: False.

__init__(inp_dict=None)

Constructor of the SolverParams class.

Parameters:

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