darsia.CG#

class CG(maxiter=1, tol=None, dim=2, mass_coeff=None, diffusion_coeff=None, verbose=False)[source]#

Bases: Solver

Conjugate gradient solver based on scipy’s cg for the problem: mass_coeff * x - diffusion_coeff * laplace(x) = rhs

Methods

update_params([dim, mass_coeff, diffusion_coeff])

Update parameters of the solver.

Attributes

dim

Spatial dimension of the problem.

maxiter

Maximum number of iterations.

tol

Tolerance for convergence.

mass_coeff

Mass coefficient.

diffusion_coeff

Diffusion coefficient.

verbose

Verbosity.