From a891abd7481239c5dfb018d1f95b448fd11a0c47 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Sun, 27 Oct 2024 03:54:30 +0100 Subject: [PATCH] Update convergence criterion --- Material/Material1D/vonMises/ArmstrongFrederick1D.cpp | 2 +- Material/Material1D/vonMises/NonlinearGurson1D.cpp | 2 +- Material/Material1D/vonMises/NonlinearMises1D.cpp | 2 +- Material/Material1D/vonMises/VAFCRP1D.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Material/Material1D/vonMises/ArmstrongFrederick1D.cpp b/Material/Material1D/vonMises/ArmstrongFrederick1D.cpp index 895c707e5..16e0627fa 100644 --- a/Material/Material1D/vonMises/ArmstrongFrederick1D.cpp +++ b/Material/Material1D/vonMises/ArmstrongFrederick1D.cpp @@ -91,7 +91,7 @@ int ArmstrongFrederick1D::update_trial_status(const vec& t_strain) { const auto error = fabs(incre); if(1u == counter) ref_error = error; suanpan_debug("Local iteration error: {:.5E}.\n", error); - if(error < tolerance * ref_error || ((fabs(yield_func) < tolerance || error < datum::eps) && counter > 5u)) break; + if(error < tolerance * ref_error || ((error < tolerance || fabs(yield_func) < tolerance) && counter > 5u)) break; gamma -= incre; q -= incre; diff --git a/Material/Material1D/vonMises/NonlinearGurson1D.cpp b/Material/Material1D/vonMises/NonlinearGurson1D.cpp index ec96a345e..df0fba799 100644 --- a/Material/Material1D/vonMises/NonlinearGurson1D.cpp +++ b/Material/Material1D/vonMises/NonlinearGurson1D.cpp @@ -100,7 +100,7 @@ int NonlinearGurson1D::update_trial_status(const vec& t_strain) { const auto error = inf_norm(incre); if(1u == counter) ref_error = error; suanpan_debug("Local iteration error: {:.5E}.\n", error); - if(error < tolerance * ref_error || (inf_norm(residual) < tolerance && counter > 5u)) break; + if(error < tolerance * ref_error || ((error < tolerance || inf_norm(residual) < tolerance) && counter > 5u)) break; gamma -= incre(0); pe -= incre(1); diff --git a/Material/Material1D/vonMises/NonlinearMises1D.cpp b/Material/Material1D/vonMises/NonlinearMises1D.cpp index 895db4bbe..952c85534 100644 --- a/Material/Material1D/vonMises/NonlinearMises1D.cpp +++ b/Material/Material1D/vonMises/NonlinearMises1D.cpp @@ -59,7 +59,7 @@ int NonlinearMises1D::update_trial_status(const vec& t_strain) { const auto error = fabs(incre_gamma); if(1u == counter) ref_error = error; suanpan_debug("Local iteration error: {:.5E}.\n", error); - if(error < tolerance * ref_error || (fabs(yield_func) < tolerance && counter > 5u)) break; + if(error < tolerance * ref_error || ((error < tolerance || fabs(yield_func) < tolerance) && counter > 5u)) break; incre_h = compute_h(plastic_strain = current_history(0) + (gamma += incre_gamma)) - current_h; yield_func = norm_shifted_stress - elastic_modulus * gamma - std::max(0., compute_k(plastic_strain)) - incre_h; } diff --git a/Material/Material1D/vonMises/VAFCRP1D.cpp b/Material/Material1D/vonMises/VAFCRP1D.cpp index 544602b77..dca600d85 100644 --- a/Material/Material1D/vonMises/VAFCRP1D.cpp +++ b/Material/Material1D/vonMises/VAFCRP1D.cpp @@ -88,7 +88,7 @@ int VAFCRP1D::update_trial_status(const vec& t_strain) { const auto error = fabs(incre); if(1u == counter) ref_error = error; suanpan_debug("Local iteration error: {:.5E}.\n", error); - if(error < tolerance * ref_error || (fabs(residual) < tolerance && counter > 5u)) break; + if(error < tolerance * ref_error || ((error < tolerance || fabs(residual) < tolerance) && counter > 5u)) break; gamma -= incre; p -= incre;