From d640871f59251ebf867f43b17f2847f7d51b5389 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Camarotti Date: Wed, 18 Sep 2024 16:42:22 +0200 Subject: [PATCH] Correcting a ug in residual_criterion.hpp. Before this change, the initial residual was not changing between coupling iterations (See Issue https://github.com/KratosMultiphysics/Kratos/issues/12394) --- .../convergence_criteria/residual_criterion.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applications/SolidMechanicsApplication/custom_solvers/convergence_criteria/residual_criterion.hpp b/applications/SolidMechanicsApplication/custom_solvers/convergence_criteria/residual_criterion.hpp index 8d0c56314dd8..4032904e4065 100644 --- a/applications/SolidMechanicsApplication/custom_solvers/convergence_criteria/residual_criterion.hpp +++ b/applications/SolidMechanicsApplication/custom_solvers/convergence_criteria/residual_criterion.hpp @@ -136,6 +136,10 @@ class ResidualCriterion : public ConvergenceCriterion< TSparseSpace, TDenseSpac const SystemVectorType& rb ) override { + if (rModelPart.GetProcessInfo()[NL_ITERATION_NUMBER] <= 1) { + this->Set(LocalFlagType::INITIALIZED, false); + } + if (TSparseSpace::Size(rb) != 0) //if we are solving for something {