SpECTRE
v2025.03.17
|
A conjugate gradient solver for linear systems of equations
#include <ConjugateGradient.hpp>
Public Types | |
using | fields_tag = FieldsTag |
using | options_group = OptionsGroup |
using | source_tag = SourceTag |
using | operand_tag = db::add_tag_prefix< LinearSolver::Tags::Operand, fields_tag > |
Apply the linear operator to this tag in each iteration. | |
using | component_list = implementation defined |
The parallel components used by the conjugate gradient linear solver. | |
using | initialize_element = implementation defined |
using | register_element = implementation defined |
template<typename ApplyOperatorActions , typename Label = OptionsGroup> | |
using | solve = implementation defined |
A conjugate gradient solver for linear systems of equations
The only operation we need to supply to the algorithm is the result of the operation solve
action list to an array parallel component. Pass the actions that compute solve
. If you add the solve
action list multiple times, use the second template parameter to label each solve with a different type.
Note that the operand db::add_tag_prefix<LinearSolver::Tags::Operand, FieldsTag>
. This field is initially set to the residual FieldsTag
.
When the algorithm step is performed after the operator action ResidualMonitor
singleton parallel component, processed, and then broadcast back to all elements. The actions are implemented in the cg::detail
namespace and constitute the full algorithm in the following order:
PerformStep
(on elements): Compute the inner product ComputeAlpha
(on ResidualMonitor
): Compute UpdateFieldValues
(on elements): Update UpdateResidual
(on ResidualMonitor
): Store the new Convergence::Tags::Criteria
are met.UpdateOperand
(on elements): Update