diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h index 7d6f68728dfceb250ee0f81d55160def8e8fdef3..a0d421313203f8d0c0956870b9b80f397f8460fb 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h @@ -220,9 +220,19 @@ public: std::vector<double>& local_b_data, std::vector<double>& local_Jac_data, LocalCoupledSolutions const& local_coupled_solutions) override; - void preTimestepConcrete(std::vector<double> const& /*local_x*/, - double const /*t*/, - double const /*delta_t*/) override + void initializeConcrete() override + { + unsigned const n_integration_points = + _integration_method.getNumberOfPoints(); + + for (unsigned ip = 0; ip < n_integration_points; ip++) + { + _ip_data[ip].pushBackState(); + } + } + + void postTimestepConcrete(std::vector<double> const& /*local_x*/ + ) override { unsigned const n_integration_points = _integration_method.getNumberOfPoints(); diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp index 69be04191079022ccfab7e0964ad25b637764ce2..bb006dc5c263638827e4006525cbabe18344b0f4 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp @@ -161,6 +161,14 @@ void ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: _local_assemblers, &ThermoMechanicalPhaseFieldLocalAssemblerInterface:: getIntPtHeatFlux)); + + // Initialize local assemblers after all variables have been set. + const int process_id = 0; + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + GlobalExecutor::executeSelectedMemberOnDereferenced( + &LocalAssemblerInterface::initialize, _local_assemblers, + pv.getActiveElementIDs(), *_local_to_global_index_map); } template <int DisplacementDim>