13#include <range/v3/view/filter.hpp>
32 std::vector<GlobalVector*>
const& process_solutions)
34 for (
auto const*
const x : process_solutions)
46 std::vector<CouplingNodeVariant>
const& coupling_nodes)
49 {
return std::holds_alternative<CouplingNode>(node); };
51 for (
auto const& coupling_node :
52 coupling_nodes | ranges::views::filter(is_regular_node))
54 std::get<CouplingNode>(coupling_node)
55 .convergence_criterion->preFirstIteration();
60 std::vector<CouplingNodeVariant>
const& coupling_nodes)
63 {
return std::holds_alternative<CouplingNode>(node); };
65 for (
auto& coupling_node :
66 coupling_nodes | ranges::views::filter(is_regular_node))
68 std::get<CouplingNode>(coupling_node).convergence_criterion->reset();
73 const bool convergence_of_last_process,
77 bool is_coupling_iteration_converged = convergence_of_last_process;
84 "------- Checking convergence criterion for coupled "
85 "solution of process {:s} with ID {:d} -------",
90 is_coupling_iteration_converged =
91 is_coupling_iteration_converged &&
94 return is_coupling_iteration_converged;
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the RunTime class.
Global vector based on Eigen vector.
void initializeCoupledSolutions(std::vector< GlobalVector * > const &process_solutions)
void resetCouplingConvergenceCriteria(std::vector< CouplingNodeVariant > const &coupling_nodes)
std::vector< GlobalVector * > solutions_of_last_cpl_iteration_
void setFirstIterationIndicator(std::vector< CouplingNodeVariant > const &coupling_nodes)
Set the indicator of the first staggered coupling iteration be true.
bool checkCouplingConvergence(const bool convergence_of_last_process, CouplingNode const &coupling_node, GlobalVector const &x) const
void updatePreviousSolution(int const process_id, GlobalVector const &x)
std::variant< CouplingNode, RootCouplingNode > CouplingNodeVariant
virtual GlobalVector & getVector(std::size_t &id)=0
Get an uninitialized vector with the given id.
virtual void releaseVector(GlobalVector const &x)=0
void copy(PETScVector const &x, PETScVector &y)
void axpy(PETScVector &y, PetscScalar const a, PETScVector const &x)
Information of a coupling node.
std::unique_ptr< NumLib::ConvergenceCriterion > convergence_criterion
static NUMLIB_EXPORT VectorProvider & provider