From d18fb68299c6096c15072145ff53780aba41b537 Mon Sep 17 00:00:00 2001 From: Shuaihao-Zhang <1477856817@qq.com> Date: Tue, 10 Sep 2024 08:55:19 +0200 Subject: [PATCH] small changes --- src/shared/materials/general_continuum.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/shared/materials/general_continuum.cpp b/src/shared/materials/general_continuum.cpp index 5a63c4b52f..d728d54b81 100644 --- a/src/shared/materials/general_continuum.cpp +++ b/src/shared/materials/general_continuum.cpp @@ -102,7 +102,6 @@ Matd J2Plasticity::ReturnMappingShearStress(Matd &shear_stress, Real &hardening_ Real f = sqrt(2.0 * stress_tensor_J2) - sqrt_2_over_3_ * (hardening_modulus_ * hardening_factor + yield_stress_); if (f > TinyReal) { - Real r = (sqrt_2_over_3_ * (hardening_modulus_ * hardening_factor + yield_stress_)) / (sqrt(2.0 * stress_tensor_J2) + TinyReal); shear_stress = r * shear_stress; } @@ -116,7 +115,6 @@ Real J2Plasticity::ScalePenaltyForce(Matd &shear_stress, Real &hardening_factor) Real f = sqrt(2.0 * stress_tensor_J2) - sqrt_2_over_3_ * (hardening_modulus_ * hardening_factor + yield_stress_); if (f > TinyReal) { - r = (sqrt_2_over_3_ * (hardening_modulus_ * hardening_factor + yield_stress_)) / (sqrt(2.0 * stress_tensor_J2) + TinyReal); } return r; @@ -126,13 +124,6 @@ Real J2Plasticity::HardeningFactorRate(const Matd &shear_stress, Real &hardening { Real stress_tensor_J2 = 0.5 * (shear_stress.cwiseProduct(shear_stress.transpose())).sum(); Real f = sqrt(2.0 * stress_tensor_J2) - sqrt_2_over_3_ * (hardening_modulus_ * hardening_factor + yield_stress_); - if (f > TinyReal) - { - return 0.5 * f / (G_ + hardening_modulus_ / 3.0); - } - else - { - return 0.0; - } + return (f > TinyReal) ? 0.5 * f / (G_ + hardening_modulus_ / 3.0) : 0.0; } } // namespace SPH \ No newline at end of file