DriftDiffusion2D
----------------

.. xml:tag:: <electrical solver="DriftDiffusion2D"> [DriftDiffusion2D]

   Corresponding Python class: :py:class:`electrical.ddm2d.DriftDiffusion2D`.

   Finite element drift-diffusion electrical solver for 2D Cartesian geometry using finite-element method.

   :attr required name: Solver name.

   .. xml:contents::

      .. xml:tag:: <geometry> [in electrical.DriftDiffusion2D]

         Geometry for use by this solver.

         :attr required ref: Name of a Cartesian2D geometry defined in the :xml:tag:`<geometry>` section.

      .. xml:tag:: <mesh> [in electrical.DriftDiffusion2D]

         Rectangular2D mesh used by this solver.

         :attr required ref: Name of a Rectangular2D mesh defined in the :xml:tag:`<grids>` section.

      .. xml:tag:: <voltage> [in electrical.DriftDiffusion2D]

         Voltage boundary conditions. See subsection :ref:`sec-xpl-Boundary-conditions`.

      .. xml:tag:: <loop> [in electrical.DriftDiffusion2D]

         Configuration of the self-consistent loop.

         :attr stat: Statistics assumed in drift-diffusion equations. (\ ``Maxwell-Boltzmann``\  or \ ``Fermi-Dirac``\ , default is \ ``Maxwell-Boltzmann``\ )
         :attr conttype: Type of contacts. (\ ``ohmic``\  or \ ``Schottky``\ , default is \ ``ohmic``\ )
         :attr SchottkyP: Schottky barrier for p-type contact. (float, default 0.0)
         :attr SchottkyN: Schottky barrier for n-type contact. (float, default 0.0)
         :attr Rsrh: Consider Shockley-Read-Hall recombination. (bool, default is \ ``no``\ )
         :attr Rrad: Consider radiative recombination. (bool, default is \ ``no``\ )
         :attr Raug: Consider Auger recombination. (bool, default is \ ``no``\ )
         :attr Pol: Polarization effects. (bool, default is \ ``no``\ )
         :attr FullIon: Complete ionization of dopants. (bool, default is \ ``yes``\ )
         :attr maxerrVi: Limit for the initial potential estimate updates. (float (V), default 1e-06 V)
         :attr maxerrV0: Limit for the built-in potential updates. (float (V), default 1e-06 V)
         :attr maxerrV: Limit for the potential updates. (float (V), default 1e-06 V)
         :attr maxerrFn: Limit for the electrons quasi-Fermi level updates. (float (eV), default 0.0001 eV)
         :attr maxerrFp: Limit for the holes quasi-Fermi level updates. (float (eV), default 0.0001 eV)
         :attr loopsVi: Loops limit for the initial potential estimate. (int, default 10000)
         :attr loopsV0: Loops limit for the built-in potential. (int, default 200)
         :attr loopsV: Loops limit for the potential. (int, default 3)
         :attr loopsFn: Loops limit for the electrons quasi-Fermi level. (int, default 3)
         :attr loopsFp: Loops limit for the holes quasi-Fermi level. (int, default 3)

      .. xml:tag:: <matrix> [in electrical.DriftDiffusion2D]

         Matrix solver configuration.

         :attr algorithm: Algorithm used for solving set of linear positive-definite equations. (\ ``cholesky``\ , \ ``gauss``\ , or \ ``iterative``\ , default is \ ``cholesky``\ )

         .. xml:tag:: <iterative> [in electrical.DriftDiffusion2D]

            Parameters for iterative matrix solver. PLaSK uses `NSPCG`_ package for performing iterations. Please refer to its documentation for explanation of most of the settings.

            .. _NSPCG: https://web.ma.utexas.edu/CNA/NSPCG/

            :attr maxit: Maximum number of iterations. (int, default 1000)
            :attr maxerr: Maximum iteration error. (float, default 1e-6)
            :attr noconv: Desired behavior if the iterative solver does not converge. (\ ``error``\ , \ ``warning``\ , or \ ``continue``\ , default is \ ``warning``\ )
            :attr accelerator: Accelerator used for iterative matrix solver. (\ ``cg``\ , \ ``si``\ , \ ``sor``\ , \ ``srcg``\ , \ ``srsi``\ , \ ``basic``\ , \ ``me``\ , \ ``cgnr``\ , \ ``lsqr``\ , \ ``odir``\ , \ ``omin``\ , \ ``ores``\ , \ ``iom``\ , \ ``gmres``\ , \ ``usymlq``\ , \ ``usymqr``\ , \ ``landir``\ , \ ``lanmin``\ , \ ``lanres``\ , \ ``cgcr``\ , or \ ``bcgs``\ , default is \ ``cg``\ )
            :attr preconditioner: Preconditioner used for iterative matrix solver. (\ ``rich``\ , \ ``jac``\ , \ ``ljac``\ , \ ``ljacx``\ , \ ``sor``\ , \ ``ssor``\ , \ ``ic``\ , \ ``mic``\ , \ ``lsp``\ , \ ``neu``\ , \ ``lsor``\ , \ ``lssor``\ , \ ``llsp``\ , \ ``lneu``\ , \ ``bic``\ , \ ``bicx``\ , \ ``mbic``\ , or \ ``mbicx``\ , default is \ ``ic``\ )
            :attr nfact: This number initializes the frequency of partial factorizations. It specifies the number of linear system evaluations between factorizations. The default value is 1, which means that a factorization is performed at every iteration. (int, default 10)
            :attr ndeg: Degree of the polynomial to be used for the polynomial preconditioners. (int, default 1)
            :attr lvfill: Level of fill-in for incomplete Cholesky preconditioners. Increasing this value will result in more accurate factorizations at the expense of increased memory usage and factorization time. (int, default 0)
            :attr ltrunc: Truncation bandwidth to be used when approximating the inverses of matrices with dense banded matrices. An increase in this value means a more accurate factorization at the expense of increased storage. (int, default 0)
            :attr omega: Relaxation parameter. (float, default 1.0)
            :attr nsave: The number of old vectors to be saved for the truncated acceleration methods. (int, default 5)
            :attr nrestart: The number of iterations between restarts for the restarted acceleration methods. (int, default 100000)

            .. list-table:: Preconditioner choices:

             * - ``rich``

               - Richardson's method

             * - ``jac``

               - Jacobi method

             * - ``ljac``

               - Line Jacobi method

             * - ``ljacx``

               - Line Jacobi method (approx. inverse)

             * - ``sor``

               - Successive Overrelaxation

             * - ``ssor``

               - Symmetric SOR (can be used only with SOR accelerator)

             * - ``ic``

               - Incomplete Cholesky (default)

             * - ``mic``

               - Modified Incomplete Cholesky

             * - ``lsp``

               - Least Squares Polynomial

             * - ``neu``

               - Neumann Polynomial

             * - ``lsor``

               - Line SOR

             * - ``lssor``

               - Line SSOR

             * - ``llsp``

               - Line Least Squares Polynomial

             * - ``lneu``

               - Line Neumann Polynomial

             * - ``bic``

               - Block Incomplete Cholesky (ver. 1)

             * - ``bicx``

               - Block Incomplete Cholesky (ver. 2)

             * - ``mbic``

               - Modified Block Incomplete Cholesky (ver. 1)

             * - ``mbicx``

               - Modified Block Incomplete Cholesky (ver. 2)

            

            .. list-table:: Accelerator choices:

             * - ``cg``

               - Conjugate Gradient acceleration (default)

             * - ``si``

               - Chebyshev acceleration or Semi-Iteration

             * - ``sor``

               - Successive Overrelaxation (can use only SOR preconditioner)

             * - ``srcg``

               - Symmetric Successive Overrelaxation Conjugate Gradient Algorithm (can use only SSOR preconditioner)

             * - ``srsi``

               - Symmetric Successive Overrelaxation Semi-Iteration Algorithm (can use only SSOR preconditioner)

             * - ``basic``

               - Basic Iterative Method

             * - ``me``

               - Minimal Error Algorithm

             * - ``cgnr``

               - Conjugate Gradient applied to the Normal Equations

             * - ``lsqr``

               - Least Squares Algorithm

             * - ``odir``

               - ORTHODIR, a truncated/restarted method useful for nonsymmetric systems of equations

             * - ``omin``

               - ORTHOMIN, a common truncated/restarted method used for nonsymmetric systems

             * - ``ores``

               - ORTHORES, another truncated/restarted method for nonsymmetric systems

             * - ``iom``

               - Incomplete Orthogonalization Method

             * - ``gmres``

               - Generalized Minimal Residual Method

             * - ``usymlq``

               - Unsymmetric LQ

             * - ``usymqr``

               - Unsymmetric QR

             * - ``landir``

               - Lanczos/ORTHODIR

             * - ``lanmin``

               - Lanczos/ORTHOMIN or Biconjugate Gradient Method

             * - ``lanres``

               - Lanczos/ORTHORES or “two-sided” Lanczos Method

             * - ``cgcr``

               - Constrained Generalized Conjugate Residual Method

             * - ``bcgs``

               - Biconjugate Gradient Squared Method

      .. xml:tag:: <config> [in electrical.DriftDiffusion2D]

         Some important gain parameters.

         :attr strained: Boolean attribute indicating if the solver should consider strain in the active region. If set to \ *yes*\  then there must a layer with the role "\ *substrate*\ " in the geometry. The strain is computed by comparing the atomic lattice constants of the substrate and the quantum wells. (bool, default is \ ``no``\ )
         :attr T0: Reference temperature. This is the temperature used for initial computation of the energy levels. (float (K), default 300 K)
