diff --git a/Material/Material1D/vonMises/Subloading1D.cpp b/Material/Material1D/vonMises/Subloading1D.cpp index 7e307451..ac7c4a1d 100644 --- a/Material/Material1D/vonMises/Subloading1D.cpp +++ b/Material/Material1D/vonMises/Subloading1D.cpp @@ -32,7 +32,7 @@ Subloading1D::Subloading1D(const unsigned T, DataSubloading1D&& D, const double int Subloading1D::initialize(const shared_ptr&) { trial_stiffness = current_stiffness = initial_stiffness = elastic; - initialize_history(4); + initialize_history(5); return SUANPAN_SUCCESS; } @@ -55,6 +55,7 @@ int Subloading1D::update_trial_status(const vec& t_strain) { auto& d = trial_history(1); auto& q = trial_history(2); auto& z = trial_history(3); + auto& iteration = trial_history(4); auto gamma = 0., ref_error = 0.; auto start_z = current_z; @@ -123,6 +124,7 @@ int Subloading1D::update_trial_status(const vec& t_strain) { suanpan_error("Somehow the plastic multiplier is negative, likely a bug.\n"); return SUANPAN_FAIL; } + iteration = counter; trial_stress -= elastic * gamma * n; trial_stiffness += elastic / det(jacobian) * elastic * jacobian(1, 1); return SUANPAN_SUCCESS; diff --git a/Material/Material3D/vonMises/SubloadingMetal.cpp b/Material/Material3D/vonMises/SubloadingMetal.cpp index 4f18ef34..19c1a7aa 100644 --- a/Material/Material3D/vonMises/SubloadingMetal.cpp +++ b/Material/Material3D/vonMises/SubloadingMetal.cpp @@ -35,7 +35,7 @@ SubloadingMetal::SubloadingMetal(const unsigned T, DataSubloadingMetal&& D, cons int SubloadingMetal::initialize(const shared_ptr&) { trial_stiffness = current_stiffness = initial_stiffness = tensor::isotropic_stiffness(elastic, poissons_ratio); - initialize_history(14); + initialize_history(15); return SUANPAN_SUCCESS; } @@ -52,12 +52,13 @@ int SubloadingMetal::update_trial_status(const vec& t_strain) { trial_history = current_history; const auto& current_q = current_history(0); const auto& current_z = current_history(1); - const vec current_alpha(¤t_history(2), 6, false, true); - const vec current_d(¤t_history(8), 6, false, true); + const vec current_alpha(¤t_history(3), 6, false, true); + const vec current_d(¤t_history(9), 6, false, true); auto& q = trial_history(0); auto& z = trial_history(1); - vec alpha(&trial_history(2), 6, false, true); - vec d(&trial_history(8), 6, false, true); + auto& iteration = trial_history(2); + vec alpha(&trial_history(3), 6, false, true); + vec d(&trial_history(9), 6, false, true); const vec trial_s = tensor::dev(trial_stress); @@ -176,6 +177,7 @@ int SubloadingMetal::update_trial_status(const vec& t_strain) { suanpan_error("Somehow the plastic multiplier is negative, likely a bug.\n"); return SUANPAN_FAIL; } + iteration = counter; trial_stress -= gamma * double_shear * n; trial_stiffness -= double_shear * double_shear * gamma / norm_zeta * unit_dev_tensor - double_shear * double_shear * (gamma / norm_zeta + jacobian(1, 1) / det(jacobian)) * n * n.t(); return SUANPAN_SUCCESS;