scimba_torch.numerical_solvers.preconditioner_projector¶
Preconditioner projectors and their components.
Classes
|
Anagram preconditioner projector. |
Energy natural gradient preconditioner projector. |
|
|
Abstract base class for matrix-based preconditioner projectors. |
- class MatrixPreconditionerProjector(space, pde=None, **kwargs)[source]¶
Bases:
AbstractPreconditionerAbstract base class for matrix-based preconditioner projectors.
This class provides a structure for implementing preconditioners that use a matrix to precondition the gradients in projection problems.
- Parameters:
space (
AbstractApproxSpace) – The approximation space where the projection takes place.**kwargs – Additional keyword arguments for configuring the preconditioner.
- abstract compute_preconditioning_matrix(*args, **kwargs)[source]¶
Computes the preconditioning matrix.
- Parameters:
*args (
LabelTensor) – Input tensors for computing the preconditioning matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The computed preconditioning matrix.
- get_preconditioning_matrix(data, **kwargs)[source]¶
Retrieves the preconditioning matrix based on the input data.
- Parameters:
data (
tuple[LabelTensor,...]) – The input data for computing the preconditioning matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The preconditioning matrix.
- get_preconditioning_matrix_bc(data, **kwargs)[source]¶
Retrieves the BC preconditioning matrix based on the input data.
- Parameters:
data (
tuple) – The input data for computing the boundary condition preconditioning matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The boundary condition preconditioning matrix.
- class EnergyNaturalGradientPreconditionerProjector(space, **kwargs)[source]¶
Bases:
MatrixPreconditionerProjectorEnergy natural gradient preconditioner projector.
This class implements a preconditioner using the energy natural gradient method.
- Parameters:
space (
AbstractApproxSpace) – The approximation space where the projection takes place.**kwargs – Additional keyword arguments for configuring the preconditioner.
- metric_matrix(*args, **kwargs)[source]¶
Computes the metric matrix for the given input tensors.
- Parameters:
*args (
LabelTensor) – Input tensors for computing the metric matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The computed metric matrix.
- compute_preconditioning_matrix(*args, **kwargs)[source]¶
Computes the preconditioning matrix using the metric matrix.
- Parameters:
*args (
LabelTensor) – Input tensors for computing the preconditioning matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The computed preconditioning matrix.
- class AnagramPreconditionerProjector(space, **kwargs)[source]¶
Bases:
MatrixPreconditionerProjectorAnagram preconditioner projector.
This class implements a preconditioner using the Anagram method.
- Parameters:
space (
AbstractApproxSpace) – The approximation space where the projection takes place.**kwargs – Additional keyword arguments for configuring the preconditioner.
- compute_preconditioning_matrix(*args, **kwargs)[source]¶
Computes the preconditioning matrix using the Jacobian of the space.
- Parameters:
*args (
LabelTensor) – Input tensors for computing the preconditioning matrix.**kwargs – Additional keyword arguments.
- Return type:
Tensor- Returns:
The computed preconditioning matrix.
- assemble_right_member(data, res_l, res_r)[source]¶
Assembles the right member for the preconditioning.
- Parameters:
data (
tuple) – The input data for assembling the right member.res_l (
tuple) – The left residuals.res_r (
tuple) – The right residuals.
- Return type:
Tensor- Returns:
The assembled right member.