From b4eb80c9854240b9f03955ae9c63ff556bb59bda Mon Sep 17 00:00:00 2001 From: Michael Tupek Date: Mon, 5 Aug 2024 13:01:45 -0700 Subject: [PATCH] Always reassemble J for warm start for now. This can be optimized away later. --- src/serac/physics/solid_mechanics.hpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/serac/physics/solid_mechanics.hpp b/src/serac/physics/solid_mechanics.hpp index 293b44a79..5ac7c1663 100644 --- a/src/serac/physics/solid_mechanics.hpp +++ b/src/serac/physics/solid_mechanics.hpp @@ -210,9 +210,7 @@ class SolidMechanics, std::integer_se } adjoints_.push_back(&adjoint_displacement_); - duals_.push_back(&reactions_); - dual_adjoints_.push_back(&reactions_adjoint_load_); // Create a pack of the primal field and parameter finite element spaces @@ -259,7 +257,6 @@ class SolidMechanics, std::integer_se u_.SetSize(true_size); v_.SetSize(true_size); - du_.SetSize(true_size); predicted_displacement_.SetSize(true_size); @@ -389,9 +386,6 @@ class SolidMechanics, std::integer_se du_ = 0.0; predicted_displacement_ = 0.0; - J_.reset(); - J_e_.reset(); - if (checkpoint_to_disk_) { outputStateToDisk(); } else { @@ -1775,12 +1769,10 @@ class SolidMechanics, std::integer_se *parameters_[parameter_indices].state...); // use the most recently evaluated Jacobian - if (!J_ || !J_e_) { - auto [_, drdu] = (*residual_)(time_, shape_displacement_, differentiate_wrt(displacement_), acceleration_, - *parameters_[parameter_indices].previous_state...); - J_ = assemble(drdu); - J_e_ = bcs_.eliminateAllEssentialDofsFromMatrix(*J_); - } + auto [_, drdu] = (*residual_)(time_, shape_displacement_, differentiate_wrt(displacement_), acceleration_, + *parameters_[parameter_indices].previous_state...); + J_ = assemble(drdu); + J_e_ = bcs_.eliminateAllEssentialDofsFromMatrix(*J_); r *= -1.0;