SpECTRE
v2025.03.17
|
Make the iterative linear solve the identity operation on the source vector if no iterations were performed at all. Useful for disabling a preconditioner by setting its number of iterations to zero. More...
#include <MakeIdentityIfSkipped.hpp>
Static Public Member Functions | |
template<typename DbTagsList , typename... InboxTags, typename Metavariables , typename ArrayIndex , typename ActionList , typename ParallelComponent > | |
static Parallel::iterable_action_return_t | apply (db::DataBox< DbTagsList > &box, const tuples::TaggedTuple< InboxTags... > &, const Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const ActionList, const ParallelComponent *const) |
Make the iterative linear solve the identity operation on the source vector if no iterations were performed at all. Useful for disabling a preconditioner by setting its number of iterations to zero.
When the linear solve is skipped, i.e. when it performs no iterations because its number of iterations is set to zero, this action assumes
To use this action, insert it into the action list just after iterating the linear solver, i.e. after its solve
action list:
This action will set the LinearSolverType::fields_tag
to the LinearSolverType::source_tag
whenever the linear solver has converged with the reason Convergence::Reason::NumIterations
or Convergence::Reason::MaxIterations
without actually having performed any iterations.
To run additional actions after this action has triggered, i.e. when the linear solver is skipped, place them after this action and follow them by an Actions::Label<ProceedLabel>
, where ProceedLabel
is a type used for identification. Pass the ProceedLabel
as the second template parameter to this action. Then, the actions between this action and the label will run only when the linear solver is skipped. This is useful to set DataBox tags that are usually updated by the linear solver.