linear_solver{ }#

Calling sequence

currents{ linear_solver{ } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • items: maximum 1

Functionality

This group allows modifying parameters impacting algorithm of linear equation solver in current equation.

Examples

currents{
    recombination_model{}
    linear_solver{}
}
currents{
    recombination_model{}
    linear_solver{
        method = cscg
    }
}

global{
    simulate1D{}
}

Nested keywords


iterations#

Calling sequence

currents{ linear_solver{ iterations } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: integer

  • unit: \(\mathrm{-}\)

  • values: \(z \in \{1, 2, \dots\}\)

  • default: \(z=10000\)

Functionality

Maximum number of iterations allowed in this solver.

Example

currents{
    recombination_model{}
    linear_solver{
        iterations = 50000
    }
}

abs_accuracy#

Calling sequence

currents{ linear_solver{ abs_accuracy } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: real number

  • unit: \(\mathrm{-}\)

  • values: [0.0, ...)

  • default: \(r=1e-30\)

Functionality

—

Example

currents{
    recombination_model{}
    linear_solver{
        abs_accuracy = 1e-32
    }
}

rel_accuracy#

Calling sequence

currents{ linear_solver{ rel_accuracy } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: real number

  • unit: \(\mathrm{-}\)

  • values: \(0.0 \leq r \leq 10^{-6}\)

  • default: \(r=1e-13\)

Functionality

—

Example

currents{
    recombination_model{}
    linear_solver{
        rel_accuracy = 1e-15
    }
}

method#

Added in version 3.0.0.

Calling sequence

currents{ linear_solver{ method = "..." } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: choice

  • values: cg or cscg or bicgstab

  • default: cg (LAPACK for non-perioic 1D simulations)

Functionality

Selects linear solver to be used:

cg: Conjugate Gradient
csgs: Composite Step Conjugate Gradient
bicgstab: Biconjugate Gradient Stabilized Method

Example

currents{
    recombination_model{}
    linear_solver{
        method = bicgstab
    }
}

preconditioner#

Added in version 4.0.0.

Calling sequence

currents{ linear_solver{ preconditioner = ... } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: choice

  • values: none; diag; incfact; modincfact; ssor

  • default: infact

Functionality

A preconditioner transforms a linear system \(Ax=b\) into an equivalent system with improved numerical properties, allowing iterative solvers to converge faster and potentially more reliably.

Preconditioning aims to improve the spectral properties of the system matrix, typically by reducing its condition number or clustering its eigenvalues. The effectiveness depends on the matrix structure and the iterative solver being used.

This keyword selects the preconditioning method:

none — No preconditioning is applied. The iterative solver operates directly on the original linear system.

diag — Diagonal (Jacobi) preconditioning. Uses the diagonal elements of the system matrix to construct a simple preconditioner. Computationally inexpensive, but generally less effective for strongly coupled or ill-conditioned systems. Different from the other preconditioners, the diagonal preconditioning parallelizes and thus can become competitive on many-core CPUs. It also may be more robust than the other ones.

incfact — Incomplete factorization preconditioning. Approximates the factorization of the system matrix while limiting fill-in to preserve sparsity. Generally provides stronger preconditioning than the diagonal method, at the expense of additional computational effort and memory.

modincfact — Modified incomplete factorization preconditioning. A variation of incomplete factorization that modifies the treatment of discarded matrix entries to improve the approximation and potentially enhance convergence.

ssor — Symmetric Successive Over-Relaxation preconditioning. Uses forward and backward relaxation sweeps based on the matrix splitting into diagonal, lower-triangular, and upper-triangular parts. Its effectiveness depends on the matrix properties and the relaxation parameter.

Note

The optimal preconditioner depends on the properties of the linear system. More sophisticated preconditioners may reduce the number of solver iterations but require additional computational time and memory for their construction and application.

The ssor method can be configured using the keyword ssor_val.


ssor_val#

Added in version 4.0.0.

Calling sequence

currents{ linear_solver{ ssor_val = ... } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: real number

  • values: \(10^{-6} \leq r \leq 1.0\)

  • default: \(r=0.1\)

  • unit: \(\mathrm{-}\)

Functionality

This keyword specifies the relaxation parameter \(\omega\) used by the Symmetric Successive Over-Relaxation (SSOR) preconditioner, when preconditioner is set to ssor.

The SSOR preconditioner is constructed from the diagonal, lower-triangular, and upper-triangular parts of the system matrix. The relaxation parameter determines the resulting preconditioning matrix and influences the convergence of the iterative linear solver.

The optimal value depends on the spectral properties of the system matrix. An appropriate choice can significantly reduce the number of iterations required for convergence, but determining the optimal value is generally computationally expensive.


modincfact_val#

Added in version 4.0.0.

Calling sequence

currents{ linear_solver{ modincfact_val = ... } }

Properties

  • usage: \(\mathrm{\textcolor{ForestGreen}{optional}}\)

  • type: real number

  • values: \(0.0 \leq r \leq 0.5\)

  • default: \(r=0.0\)

  • unit: \(\mathrm{-}\)

Functionality

This keyword is relevant only when preconditioner is set to modincfact.

It specifies a numerical parameter controlling the modified incomplete factorization preconditioner. Modified incomplete factorization approximates the factorization of the system matrix while preserving its sparse structure. The modification aims to improve the quality of the preconditioner and accelerate convergence of the iterative linear solver. The parameter modincfact_val controls the preconditioning algorithm and may influence convergence speed and numerical stability.

It is set to zero by default, as the optimal value is unknown and highly depends on the solved system.

Hint

Users solving looking for optimizing the solver performance (especially for large systems) are suggested to try setting this attribute to small positive values, such as 1e-5, 1e-4, 1e-3, 1e-2, etc.