diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess-impl.h b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess-impl.h deleted file mode 100644 index 70bb459ec379b9e94e4c9ae7b51720a02bae6ce4..0000000000000000000000000000000000000000 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess-impl.h +++ /dev/null @@ -1,341 +0,0 @@ -/** - * \copyright - * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#pragma once - -#include "ThermoMechanicalPhaseFieldFEM.h" -#include "ThermoMechanicalPhaseFieldProcess.h" -#include "ThermoMechanicalPhaseFieldProcessData.h" - -#include <cassert> - -#include "NumLib/DOF/ComputeSparsityPattern.h" -#include "ProcessLib/Process.h" -#include "ProcessLib/SmallDeformation/CreateLocalAssemblers.h" - -namespace ProcessLib -{ -namespace ThermoMechanicalPhaseField -{ -template <int DisplacementDim> -ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: - ThermoMechanicalPhaseFieldProcess( - std::string name, - MeshLib::Mesh& mesh, - std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& - jacobian_assembler, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& - parameters, - unsigned const integration_order, - std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&& - process_variables, - ThermoMechanicalPhaseFieldProcessData<DisplacementDim>&& process_data, - SecondaryVariableCollection&& secondary_variables, - NumLib::NamedFunctionCaller&& named_function_caller, - int const mechanics_related_process_id, - int const phase_field_process_id, - int const heat_conduction_process_id) - : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters, - integration_order, std::move(process_variables), - std::move(secondary_variables), std::move(named_function_caller), - false), - _process_data(std::move(process_data)), - _mechanics_related_process_id(mechanics_related_process_id), - _phase_field_process_id(phase_field_process_id), - _heat_conduction_process_id(heat_conduction_process_id) -{ -} - -template <int DisplacementDim> -bool ThermoMechanicalPhaseFieldProcess<DisplacementDim>::isLinear() const -{ - return false; -} - -template <int DisplacementDim> -MathLib::MatrixSpecifications -ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getMatrixSpecifications( - const int process_id) const -{ - if (process_id == _mechanics_related_process_id) - { - auto const& l = *_local_to_global_index_map; - return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(), - &l.getGhostIndices(), &this->_sparsity_pattern}; - } - - // For staggered scheme and phase field process or heat conduction. - auto const& l = *_local_to_global_index_map_single_component; - return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(), - &l.getGhostIndices(), &_sparsity_pattern_with_single_component}; -} - -template <int DisplacementDim> -NumLib::LocalToGlobalIndexMap const& -ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getDOFTable( - const int process_id) const -{ - if (process_id == _mechanics_related_process_id) - { - return *_local_to_global_index_map; - } - - // For the equation of phasefield or heat conduction. - return *_local_to_global_index_map_single_component; -} - -template <int DisplacementDim> -NumLib::LocalToGlobalIndexMap& -ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getDOFTableByProcessID( - const int process_id) const -{ - if (process_id == _mechanics_related_process_id) - { - return *_local_to_global_index_map; - } - - // For the equation of phasefield or heat conduction. - return *_local_to_global_index_map_single_component; -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess<DisplacementDim>::constructDofTable() -{ - // Create single component dof in every of the mesh's nodes. - _mesh_subset_all_nodes = - std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes()); - - // TODO move the two data members somewhere else. - // for extrapolation of secondary variables of stress or strain - std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{ - *_mesh_subset_all_nodes}; - _local_to_global_index_map_single_component = - std::make_unique<NumLib::LocalToGlobalIndexMap>( - std::move(all_mesh_subsets_single_component), - // by location order is needed for output - NumLib::ComponentOrder::BY_LOCATION); - - assert(_local_to_global_index_map_single_component); - - // For displacement equation. - std::vector<MeshLib::MeshSubset> all_mesh_subsets; - std::generate_n(std::back_inserter(all_mesh_subsets), - getProcessVariables(_mechanics_related_process_id)[0] - .get() - .getNumberOfComponents(), - [&]() { return *_mesh_subset_all_nodes; }); - - std::vector<int> const vec_n_components{DisplacementDim}; - _local_to_global_index_map = - std::make_unique<NumLib::LocalToGlobalIndexMap>( - std::move(all_mesh_subsets), vec_n_components, - NumLib::ComponentOrder::BY_LOCATION); - - // For phase field equation or the heat conduction. - _sparsity_pattern_with_single_component = NumLib::computeSparsityPattern( - *_local_to_global_index_map_single_component, _mesh); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: - initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const& dof_table, - MeshLib::Mesh const& mesh, - unsigned const integration_order) -{ - ProcessLib::SmallDeformation::createLocalAssemblers< - DisplacementDim, ThermoMechanicalPhaseFieldLocalAssembler>( - mesh.getElements(), dof_table, _local_assemblers, - mesh.isAxiallySymmetric(), integration_order, _process_data, - _mechanics_related_process_id, _phase_field_process_id, - _heat_conduction_process_id); - - _secondary_variables.addSecondaryVariable( - "sigma", - makeExtrapolator( - MathLib::KelvinVector::KelvinVectorType< - DisplacementDim>::RowsAtCompileTime, - getExtrapolator(), _local_assemblers, - &ThermoMechanicalPhaseFieldLocalAssemblerInterface::getIntPtSigma)); - - _secondary_variables.addSecondaryVariable( - "epsilon", - makeExtrapolator(MathLib::KelvinVector::KelvinVectorType< - DisplacementDim>::RowsAtCompileTime, - getExtrapolator(), _local_assemblers, - &ThermoMechanicalPhaseFieldLocalAssemblerInterface:: - getIntPtEpsilon)); - - _secondary_variables.addSecondaryVariable( - "heat_flux", - makeExtrapolator(mesh.getDimension(), getExtrapolator(), - _local_assemblers, - &ThermoMechanicalPhaseFieldLocalAssemblerInterface:: - getIntPtHeatFlux)); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess< - DisplacementDim>::initializeBoundaryConditions() -{ - // Staggered scheme: - // for the equations of temperature-deformation. - initializeProcessBoundaryConditionsAndSourceTerms( - getDOFTableByProcessID(_mechanics_related_process_id), - _mechanics_related_process_id); - // for the phase field - initializeProcessBoundaryConditionsAndSourceTerms( - getDOFTableByProcessID(_phase_field_process_id), - _phase_field_process_id); - // for heat conduction - initializeProcessBoundaryConditionsAndSourceTerms( - getDOFTableByProcessID(_heat_conduction_process_id), - _heat_conduction_process_id); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess< - DisplacementDim>::assembleConcreteProcess(const double t, - GlobalVector const& x, - GlobalMatrix& M, GlobalMatrix& K, - GlobalVector& b) -{ - DBUG("Assemble the equations for ThermoMechanicalPhaseFieldProcess."); - - std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> - dof_table = {std::ref(*_local_to_global_index_map)}; - const int process_id = - _use_monolithic_scheme ? 0 : _coupled_solutions->process_id; - ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; - - // Call global assembler for each local assembly item. - GlobalExecutor::executeSelectedMemberDereferenced( - _global_assembler, &VectorMatrixAssembler::assemble, _local_assemblers, - pv.getActiveElementIDs(), dof_table, t, x, M, K, b, - _coupled_solutions); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: - assembleWithJacobianConcreteProcess(const double t, GlobalVector const& x, - GlobalVector const& xdot, - const double dxdot_dx, - const double dx_dx, GlobalMatrix& M, - GlobalMatrix& K, GlobalVector& b, - GlobalMatrix& Jac) -{ - std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> - dof_tables; - // For the staggered scheme - if (_coupled_solutions->process_id == _mechanics_related_process_id) - { - DBUG( - "Assemble the Jacobian equations of " - "temperature-deformation in " - "ThermoMechanicalPhaseFieldProcess for " - "the staggered scheme."); - } - - if (_coupled_solutions->process_id == _phase_field_process_id) - { - DBUG( - "Assemble the Jacobian equations of" - "phase field in " - "ThermoMechanicalPhaseFieldProcess for " - "the staggered scheme."); - } - else - { - DBUG( - "Assemble the Jacobian equations of " - "heat conduction in " - "ThermoMechanicalPhaseFieldProcess for " - "the staggered scheme."); - } - dof_tables.emplace_back( - getDOFTableByProcessID(_heat_conduction_process_id)); - dof_tables.emplace_back( - getDOFTableByProcessID(_mechanics_related_process_id)); - dof_tables.emplace_back(getDOFTableByProcessID(_phase_field_process_id)); - - const int process_id = - _use_monolithic_scheme ? 0 : _coupled_solutions->process_id; - ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; - - GlobalExecutor::executeSelectedMemberDereferenced( - _global_assembler, &VectorMatrixAssembler::assembleWithJacobian, - _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, x, - xdot, dxdot_dx, dx_dx, M, K, b, Jac, _coupled_solutions); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess< - DisplacementDim>::preTimestepConcreteProcess(GlobalVector const& x, - double const t, - double const dt, - const int process_id) -{ - DBUG("PreTimestep ThermoMechanicalPhaseFieldProcess."); - - _process_data.dt = dt; - _process_data.t = t; - - if (process_id != _mechanics_related_process_id) - { - return; - } - - ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; - - GlobalExecutor::executeSelectedMemberOnDereferenced( - &ThermoMechanicalPhaseFieldLocalAssemblerInterface::preTimestep, - _local_assemblers, pv.getActiveElementIDs(), - getDOFTable(process_id), x, t, dt); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess< - DisplacementDim>::postTimestepConcreteProcess(GlobalVector const& x, - double const /*t*/, - double const /*dt*/, - int const process_id) -{ - DBUG("PostTimestep ThermoMechanicalPhaseFieldProcess."); - - ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; - - GlobalExecutor::executeSelectedMemberOnDereferenced( - &ThermoMechanicalPhaseFieldLocalAssemblerInterface::postTimestep, - _local_assemblers, pv.getActiveElementIDs(), - getDOFTable(process_id), x); -} - -template <int DisplacementDim> -void ThermoMechanicalPhaseFieldProcess< - DisplacementDim>::postNonLinearSolverConcreteProcess(GlobalVector const& x, - const double t, - const int process_id) -{ - if (process_id != _mechanics_related_process_id) - { - return; - } - - DBUG("PostNonLinearSolver ThermoMechanicalPhaseFieldProcess."); - // Calculate strain, stress or other internal variables of mechanics. - const bool use_monolithic_scheme = false; - ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; - - GlobalExecutor::executeSelectedMemberOnDereferenced( - &LocalAssemblerInterface::postNonLinearSolver, _local_assemblers, - pv.getActiveElementIDs(), getDOFTable(process_id), x, t, - use_monolithic_scheme); -} - -} // namespace ThermoMechanicalPhaseField -} // namespace ProcessLib diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp index 05bdb14efebfb49ae2cfaa673456bcb8dd72c1ab..825f0dabd20ce0099ac2d946a97198edf20ce1eb 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp @@ -1,19 +1,340 @@ /** * \copyright - * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ +#include "ThermoMechanicalPhaseFieldFEM.h" #include "ThermoMechanicalPhaseFieldProcess.h" -#include "ThermoMechanicalPhaseFieldProcess-impl.h" +#include "ThermoMechanicalPhaseFieldProcessData.h" + +#include <cassert> + +#include "NumLib/DOF/ComputeSparsityPattern.h" +#include "ProcessLib/Process.h" +#include "ProcessLib/SmallDeformation/CreateLocalAssemblers.h" namespace ProcessLib { namespace ThermoMechanicalPhaseField { +template <int DisplacementDim> +ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: + ThermoMechanicalPhaseFieldProcess( + std::string name, + MeshLib::Mesh& mesh, + std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& + jacobian_assembler, + std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& + parameters, + unsigned const integration_order, + std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&& + process_variables, + ThermoMechanicalPhaseFieldProcessData<DisplacementDim>&& process_data, + SecondaryVariableCollection&& secondary_variables, + NumLib::NamedFunctionCaller&& named_function_caller, + int const mechanics_related_process_id, + int const phase_field_process_id, + int const heat_conduction_process_id) + : Process(std::move(name), mesh, std::move(jacobian_assembler), parameters, + integration_order, std::move(process_variables), + std::move(secondary_variables), std::move(named_function_caller), + false), + _process_data(std::move(process_data)), + _mechanics_related_process_id(mechanics_related_process_id), + _phase_field_process_id(phase_field_process_id), + _heat_conduction_process_id(heat_conduction_process_id) +{ +} + +template <int DisplacementDim> +bool ThermoMechanicalPhaseFieldProcess<DisplacementDim>::isLinear() const +{ + return false; +} + +template <int DisplacementDim> +MathLib::MatrixSpecifications +ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getMatrixSpecifications( + const int process_id) const +{ + if (process_id == _mechanics_related_process_id) + { + auto const& l = *_local_to_global_index_map; + return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(), + &l.getGhostIndices(), &this->_sparsity_pattern}; + } + + // For staggered scheme and phase field process or heat conduction. + auto const& l = *_local_to_global_index_map_single_component; + return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(), + &l.getGhostIndices(), &_sparsity_pattern_with_single_component}; +} + +template <int DisplacementDim> +NumLib::LocalToGlobalIndexMap const& +ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getDOFTable( + const int process_id) const +{ + if (process_id == _mechanics_related_process_id) + { + return *_local_to_global_index_map; + } + + // For the equation of phasefield or heat conduction. + return *_local_to_global_index_map_single_component; +} + +template <int DisplacementDim> +NumLib::LocalToGlobalIndexMap& +ThermoMechanicalPhaseFieldProcess<DisplacementDim>::getDOFTableByProcessID( + const int process_id) const +{ + if (process_id == _mechanics_related_process_id) + { + return *_local_to_global_index_map; + } + + // For the equation of phasefield or heat conduction. + return *_local_to_global_index_map_single_component; +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess<DisplacementDim>::constructDofTable() +{ + // Create single component dof in every of the mesh's nodes. + _mesh_subset_all_nodes = + std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes()); + + // TODO move the two data members somewhere else. + // for extrapolation of secondary variables of stress or strain + std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{ + *_mesh_subset_all_nodes}; + _local_to_global_index_map_single_component = + std::make_unique<NumLib::LocalToGlobalIndexMap>( + std::move(all_mesh_subsets_single_component), + // by location order is needed for output + NumLib::ComponentOrder::BY_LOCATION); + + assert(_local_to_global_index_map_single_component); + + // For displacement equation. + std::vector<MeshLib::MeshSubset> all_mesh_subsets; + std::generate_n(std::back_inserter(all_mesh_subsets), + getProcessVariables(_mechanics_related_process_id)[0] + .get() + .getNumberOfComponents(), + [&]() { return *_mesh_subset_all_nodes; }); + + std::vector<int> const vec_n_components{DisplacementDim}; + _local_to_global_index_map = + std::make_unique<NumLib::LocalToGlobalIndexMap>( + std::move(all_mesh_subsets), vec_n_components, + NumLib::ComponentOrder::BY_LOCATION); + + // For phase field equation or the heat conduction. + _sparsity_pattern_with_single_component = NumLib::computeSparsityPattern( + *_local_to_global_index_map_single_component, _mesh); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: + initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const& dof_table, + MeshLib::Mesh const& mesh, + unsigned const integration_order) +{ + ProcessLib::SmallDeformation::createLocalAssemblers< + DisplacementDim, ThermoMechanicalPhaseFieldLocalAssembler>( + mesh.getElements(), dof_table, _local_assemblers, + mesh.isAxiallySymmetric(), integration_order, _process_data, + _mechanics_related_process_id, _phase_field_process_id, + _heat_conduction_process_id); + + _secondary_variables.addSecondaryVariable( + "sigma", + makeExtrapolator( + MathLib::KelvinVector::KelvinVectorType< + DisplacementDim>::RowsAtCompileTime, + getExtrapolator(), _local_assemblers, + &ThermoMechanicalPhaseFieldLocalAssemblerInterface::getIntPtSigma)); + + _secondary_variables.addSecondaryVariable( + "epsilon", + makeExtrapolator(MathLib::KelvinVector::KelvinVectorType< + DisplacementDim>::RowsAtCompileTime, + getExtrapolator(), _local_assemblers, + &ThermoMechanicalPhaseFieldLocalAssemblerInterface:: + getIntPtEpsilon)); + + _secondary_variables.addSecondaryVariable( + "heat_flux", + makeExtrapolator(mesh.getDimension(), getExtrapolator(), + _local_assemblers, + &ThermoMechanicalPhaseFieldLocalAssemblerInterface:: + getIntPtHeatFlux)); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess< + DisplacementDim>::initializeBoundaryConditions() +{ + // Staggered scheme: + // for the equations of temperature-deformation. + initializeProcessBoundaryConditionsAndSourceTerms( + getDOFTableByProcessID(_mechanics_related_process_id), + _mechanics_related_process_id); + // for the phase field + initializeProcessBoundaryConditionsAndSourceTerms( + getDOFTableByProcessID(_phase_field_process_id), + _phase_field_process_id); + // for heat conduction + initializeProcessBoundaryConditionsAndSourceTerms( + getDOFTableByProcessID(_heat_conduction_process_id), + _heat_conduction_process_id); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess< + DisplacementDim>::assembleConcreteProcess(const double t, + GlobalVector const& x, + GlobalMatrix& M, GlobalMatrix& K, + GlobalVector& b) +{ + DBUG("Assemble the equations for ThermoMechanicalPhaseFieldProcess."); + + std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> + dof_table = {std::ref(*_local_to_global_index_map)}; + const int process_id = + _use_monolithic_scheme ? 0 : _coupled_solutions->process_id; + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + // Call global assembler for each local assembly item. + GlobalExecutor::executeSelectedMemberDereferenced( + _global_assembler, &VectorMatrixAssembler::assemble, _local_assemblers, + pv.getActiveElementIDs(), dof_table, t, x, M, K, b, + _coupled_solutions); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess<DisplacementDim>:: + assembleWithJacobianConcreteProcess(const double t, GlobalVector const& x, + GlobalVector const& xdot, + const double dxdot_dx, + const double dx_dx, GlobalMatrix& M, + GlobalMatrix& K, GlobalVector& b, + GlobalMatrix& Jac) +{ + std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>> + dof_tables; + // For the staggered scheme + if (_coupled_solutions->process_id == _mechanics_related_process_id) + { + DBUG( + "Assemble the Jacobian equations of " + "temperature-deformation in " + "ThermoMechanicalPhaseFieldProcess for " + "the staggered scheme."); + } + + if (_coupled_solutions->process_id == _phase_field_process_id) + { + DBUG( + "Assemble the Jacobian equations of" + "phase field in " + "ThermoMechanicalPhaseFieldProcess for " + "the staggered scheme."); + } + else + { + DBUG( + "Assemble the Jacobian equations of " + "heat conduction in " + "ThermoMechanicalPhaseFieldProcess for " + "the staggered scheme."); + } + dof_tables.emplace_back( + getDOFTableByProcessID(_heat_conduction_process_id)); + dof_tables.emplace_back( + getDOFTableByProcessID(_mechanics_related_process_id)); + dof_tables.emplace_back(getDOFTableByProcessID(_phase_field_process_id)); + + const int process_id = + _use_monolithic_scheme ? 0 : _coupled_solutions->process_id; + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + GlobalExecutor::executeSelectedMemberDereferenced( + _global_assembler, &VectorMatrixAssembler::assembleWithJacobian, + _local_assemblers, pv.getActiveElementIDs(), dof_tables, t, x, + xdot, dxdot_dx, dx_dx, M, K, b, Jac, _coupled_solutions); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess< + DisplacementDim>::preTimestepConcreteProcess(GlobalVector const& x, + double const t, + double const dt, + const int process_id) +{ + DBUG("PreTimestep ThermoMechanicalPhaseFieldProcess."); + + _process_data.dt = dt; + _process_data.t = t; + + if (process_id != _mechanics_related_process_id) + { + return; + } + + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + GlobalExecutor::executeSelectedMemberOnDereferenced( + &ThermoMechanicalPhaseFieldLocalAssemblerInterface::preTimestep, + _local_assemblers, pv.getActiveElementIDs(), + getDOFTable(process_id), x, t, dt); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess< + DisplacementDim>::postTimestepConcreteProcess(GlobalVector const& x, + double const /*t*/, + double const /*dt*/, + int const process_id) +{ + DBUG("PostTimestep ThermoMechanicalPhaseFieldProcess."); + + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + GlobalExecutor::executeSelectedMemberOnDereferenced( + &ThermoMechanicalPhaseFieldLocalAssemblerInterface::postTimestep, + _local_assemblers, pv.getActiveElementIDs(), + getDOFTable(process_id), x); +} + +template <int DisplacementDim> +void ThermoMechanicalPhaseFieldProcess< + DisplacementDim>::postNonLinearSolverConcreteProcess(GlobalVector const& x, + const double t, + const int process_id) +{ + if (process_id != _mechanics_related_process_id) + { + return; + } + + DBUG("PostNonLinearSolver ThermoMechanicalPhaseFieldProcess."); + // Calculate strain, stress or other internal variables of mechanics. + const bool use_monolithic_scheme = false; + ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0]; + + GlobalExecutor::executeSelectedMemberOnDereferenced( + &LocalAssemblerInterface::postNonLinearSolver, _local_assemblers, + pv.getActiveElementIDs(), getDOFTable(process_id), x, t, + use_monolithic_scheme); +} + template class ThermoMechanicalPhaseFieldProcess<2>; template class ThermoMechanicalPhaseFieldProcess<3>;