Skip to content

Commit 17f7987

Browse files
committed
Remove write_vector call in old output
in Solid::ModelEvaluator::Structure::output_step_state and add displacement data to restart after output was already written. We can remove the function "add_restart_to_output_state()" once we removed the old output in Solid::ModelEvaluator::Contact.
1 parent 6a98ddd commit 17f7987

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/structure_new/src/4C_structure_new_timint_base.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ void Solid::TimeInt::Base::output_step(bool forced_writerestart)
501501
if (dataio_->should_write_restart_for_step(dataglobalstate_->get_step_n()) or
502502
dataglobalstate_->get_step_n() == Global::Problem::instance()->restart())
503503
return;
504+
// TODO: This if statement can be removed once Solid::ModelEvaluator::Contact::output_step_state
505+
// is removed
504506
// if state already exists, add restart information
505507
if (dataio_->write_results_for_this_step(dataglobalstate_->get_step_n()))
506508
{
@@ -524,6 +526,8 @@ void Solid::TimeInt::Base::output_step(bool forced_writerestart)
524526
}
525527

526528
// output results (not necessary if restart in same step)
529+
// TODO: This if statement can be removed once Solid::ModelEvaluator::Contact::output_step_state
530+
// is removed
527531
if (dataio_->is_write_state() and
528532
dataio_->write_results_for_this_step(dataglobalstate_->get_step_n()) and (not datawritten))
529533
{
@@ -680,6 +684,7 @@ void Solid::TimeInt::Base::add_restart_to_output_state()
680684
std::shared_ptr<Core::IO::DiscretizationWriter> output_ptr = dataio_->get_output_ptr();
681685

682686
// output of velocity and acceleration
687+
output_ptr->write_vector("displacement", dataglobalstate_->get_dis_n());
683688
output_ptr->write_vector("velocity", dataglobalstate_->get_vel_n());
684689
output_ptr->write_vector("acceleration", dataglobalstate_->get_acc_n());
685690

src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_structure.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,16 +1701,6 @@ void Solid::ModelEvaluator::Structure::determine_energy(const Core::LinAlg::Vect
17011701
}
17021702
}
17031703

1704-
/*----------------------------------------------------------------------------*
1705-
*----------------------------------------------------------------------------*/
1706-
void Solid::ModelEvaluator::Structure::output_step_state(
1707-
Core::IO::DiscretizationWriter& iowriter) const
1708-
{
1709-
check_init_setup();
1710-
1711-
iowriter.write_vector("displacement", global_state().get_dis_n());
1712-
}
1713-
17141704
/*----------------------------------------------------------------------------*
17151705
*----------------------------------------------------------------------------*/
17161706
void Solid::ModelEvaluator::Structure::runtime_pre_output_step_state()

src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_structure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ namespace Solid
148148
void reset_step_state() override;
149149

150150
//! derived
151-
void output_step_state(Core::IO::DiscretizationWriter& iowriter) const override;
151+
void output_step_state(Core::IO::DiscretizationWriter& iowriter) const override {};
152152

153153
//! derived
154154
void runtime_pre_output_step_state() override;

0 commit comments

Comments
 (0)