Skip to content

Commit a2c4550

Browse files
authored
Merge pull request #1468 from lkoeglmeier/Adapt-restart-and-output-in-structure_new-to-new-output
Remove write_vector call of old output mechanism in Solid::ModelEvaluator::Structure::output_step_state
2 parents 8556e0a + 17f7987 commit a2c4550

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

src/structure_new/src/4C_structure_new_timint_base.cpp

Lines changed: 7 additions & 1 deletion
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
{
@@ -655,7 +659,8 @@ void Solid::TimeInt::Base::output_restart(bool& datawritten)
655659
output_ptr->write_node_data(dataio_->is_first_output_of_run());
656660
dataio_->set_first_output_of_run(false);
657661

658-
// add velocity and acceleration if necessary
662+
// add displacement, velocity and acceleration
663+
output_ptr->write_vector("displacement", dataglobalstate_->get_dis_n());
659664
output_ptr->write_vector("velocity", dataglobalstate_->get_vel_n());
660665
output_ptr->write_vector("acceleration", dataglobalstate_->get_acc_n());
661666

@@ -679,6 +684,7 @@ void Solid::TimeInt::Base::add_restart_to_output_state()
679684
std::shared_ptr<Core::IO::DiscretizationWriter> output_ptr = dataio_->get_output_ptr();
680685

681686
// output of velocity and acceleration
687+
output_ptr->write_vector("displacement", dataglobalstate_->get_dis_n());
682688
output_ptr->write_vector("velocity", dataglobalstate_->get_vel_n());
683689
output_ptr->write_vector("acceleration", dataglobalstate_->get_acc_n());
684690

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,10 +1378,6 @@ void Solid::ModelEvaluator::Structure::write_restart(
13781378
// write forces
13791379
iowriter.write_vector("fstructure_old", global_state().get_fstructure_old());
13801380
iowriter.write_vector("fint", global_state().get_fint_n());
1381-
1382-
if (forced_writerestart) return;
1383-
1384-
iowriter.write_vector("displacement", global_state().get_dis_n());
13851381
}
13861382

13871383
/*----------------------------------------------------------------------------*
@@ -1705,16 +1701,6 @@ void Solid::ModelEvaluator::Structure::determine_energy(const Core::LinAlg::Vect
17051701
}
17061702
}
17071703

1708-
/*----------------------------------------------------------------------------*
1709-
*----------------------------------------------------------------------------*/
1710-
void Solid::ModelEvaluator::Structure::output_step_state(
1711-
Core::IO::DiscretizationWriter& iowriter) const
1712-
{
1713-
check_init_setup();
1714-
1715-
iowriter.write_vector("displacement", global_state().get_dis_n());
1716-
}
1717-
17181704
/*----------------------------------------------------------------------------*
17191705
*----------------------------------------------------------------------------*/
17201706
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)