1515#include " 4C_global_data.hpp"
1616#include " 4C_linalg_fevector.hpp"
1717#include " 4C_linalg_utils_sparse_algebra_manipulation.hpp"
18+ #include " 4C_mat_so3_material.hpp"
1819
1920#include < Teuchos_Time.hpp>
2021
@@ -98,7 +99,11 @@ void CONTACT::NitscheStrategy::do_read_restart(Core::IO::DiscretizationReader& r
9899 store_to_old (Mortar::StrategyBase::n_old);
99100 }
100101
101- if (params ().get <bool >(" NITSCHE_PENALTY_ADAPTIVE" )) update_trace_ineq_etimates ();
102+
103+ save_time_step_size_and_total_time (cparams_ptr->get_delta_time (), cparams_ptr->get_total_time ());
104+
105+
106+ if (params ().get <bool >(" NITSCHE_PENALTY_ADAPTIVE" )) update_trace_ineq_estimates ();
102107}
103108
104109void CONTACT::NitscheStrategy::set_state (
@@ -221,10 +226,13 @@ void CONTACT::NitscheStrategy::integrate(const CONTACT::ParamsInterface& cparams
221226 // time measurement (on each processor)
222227 const double t_start = Teuchos::Time::wallTime ();
223228
229+ // set time step size and total time
230+ save_time_step_size_and_total_time (cparams.get_delta_time (), cparams.get_total_time ());
231+
224232 // Evaluation for all interfaces
225233 for (const auto & interface : interface_)
226234 {
227- interface->interface_params ().set <double >(" TIMESTEP" , cparams. get_delta_time () );
235+ interface->interface_params ().set <double >(" TIMESTEP" , time_step_size_ );
228236 interface->initialize ();
229237 interface->evaluate (0 , step_, iter_);
230238
@@ -384,9 +392,17 @@ void CONTACT::NitscheStrategy::setup(bool redistributed, bool init)
384392 curr_state_eval_ = false ;
385393}
386394
387- void CONTACT::NitscheStrategy::update_trace_ineq_etimates ()
395+ void CONTACT::NitscheStrategy::update_trace_ineq_estimates ()
388396{
389397 auto NitWgt = Teuchos::getIntegralValue<CONTACT::NitscheWeighting>(params (), " NITSCHE_WEIGHTING" );
398+
399+ // create material evaluation context
400+ Mat::EvaluationContext mat_eval_context{.total_time = &total_time_,
401+ .time_step_size = &time_step_size_,
402+ .xi = nullptr ,
403+ .ref_coords = nullptr };
404+
405+
390406 for (const auto & interface : interface_)
391407 {
392408 for (int e = 0 ; e < interface->discret ().element_col_map ()->num_my_elements (); ++e)
@@ -395,14 +411,14 @@ void CONTACT::NitscheStrategy::update_trace_ineq_etimates()
395411 interface->discret ().g_element (interface->discret ().element_col_map ()->gid (e)));
396412 if (NitWgt == CONTACT::NitscheWeighting::slave && !mele->is_slave ()) continue ;
397413 if (NitWgt == CONTACT::NitscheWeighting::master && mele->is_slave ()) continue ;
398- mele->estimate_nitsche_trace_max_eigenvalue ();
414+ mele->estimate_nitsche_trace_max_eigenvalue (mat_eval_context );
399415 }
400416 }
401417}
402418
403419void CONTACT::NitscheStrategy::update (std::shared_ptr<const Core::LinAlg::Vector<double >> dis)
404420{
405- if (params ().get <bool >(" NITSCHE_PENALTY_ADAPTIVE" )) update_trace_ineq_etimates ();
421+ if (params ().get <bool >(" NITSCHE_PENALTY_ADAPTIVE" )) update_trace_ineq_estimates ();
406422 if (friction_)
407423 {
408424 store_to_old (Mortar::StrategyBase::n_old);
@@ -422,7 +438,8 @@ void CONTACT::NitscheStrategy::evaluate_reference_state()
422438 store_to_old (Mortar::StrategyBase::n_old);
423439 }
424440
425- update_trace_ineq_etimates ();
441+
442+ update_trace_ineq_estimates ();
426443}
427444
428445
@@ -461,4 +478,13 @@ void CONTACT::NitscheStrategy::reconnect_parent_elements()
461478 }
462479}
463480
481+ void CONTACT::NitscheStrategy::save_time_step_size_and_total_time (
482+ const double time_step_size, const double total_time)
483+ {
484+ // save time step size and total time
485+ time_step_size_ = time_step_size;
486+ total_time_ = total_time;
487+ }
488+
489+
464490FOUR_C_NAMESPACE_CLOSE
0 commit comments