diff --git a/ProcessLib/AssemblyMixin.cpp b/ProcessLib/AssemblyMixin.cpp index 0cb49b8b2c10cded8d4df6c533921543b370181b..2b955a2364459b3e3e100eacb14fdb2a77d4232d 100644 --- a/ProcessLib/AssemblyMixin.cpp +++ b/ProcessLib/AssemblyMixin.cpp @@ -14,6 +14,7 @@ #include "MeshLib/Utils/getOrCreateMeshProperty.h" #include "NumLib/DOF/DOFTableUtil.h" +#include "Process.h" namespace { @@ -88,19 +89,18 @@ void AssemblyMixinBase::initializeAssemblyOnSubmeshes( createResiduumVectors(bulk_mesh, residuum_names, pvs); } -void AssemblyMixinBase::updateActiveElements( - ProcessLib::ProcessVariable const& pv) +void AssemblyMixinBase::updateActiveElements(Process const& process) { - DBUG("AssemblyMixinBase updateActiveElements()."); + DBUG("AssemblyMixin updateActiveElements()."); if (ids_state_ == ActiveElementIDsState::UNINITIALIZED) { - updateActiveElementsImpl(pv); + updateActiveElementsImpl(process); return; } ActiveElementIDsState const new_state = - pv.getActiveElementIDs().empty() + process.getActiveElementIDs().empty() ? ActiveElementIDsState::NO_DEACTIVATED_SUBDOMAINS : ActiveElementIDsState::HAS_DEACTIVATED_SUBDOMAINS; @@ -117,15 +117,14 @@ void AssemblyMixinBase::updateActiveElements( // * no -> yes - now there are deactivated subdomains // * yes -> no - no deactivated subdomains anymore // * yes -> yes - deactivated subdomains might have changed - updateActiveElementsImpl(pv); + updateActiveElementsImpl(process); } -void AssemblyMixinBase::updateActiveElementsImpl( - ProcessLib::ProcessVariable const& pv) +void AssemblyMixinBase::updateActiveElementsImpl(Process const& process) { DBUG("AssemblyMixinBase updateActiveElementsImpl()."); - auto const& active_element_ids = pv.getActiveElementIDs(); + auto const& active_element_ids = process.getActiveElementIDs(); ActiveElementIDsState const new_state = active_element_ids.empty() diff --git a/ProcessLib/AssemblyMixin.h b/ProcessLib/AssemblyMixin.h index 58dab3d248842152aafb640f13edcca09b1c4116..2d00a31f7dfc7c710736f0f8530b6ffb17288a9a 100644 --- a/ProcessLib/AssemblyMixin.h +++ b/ProcessLib/AssemblyMixin.h @@ -56,7 +56,7 @@ protected: std::vector<std::string> const& residuum_names, std::vector<std::reference_wrapper<ProcessVariable>> const& pvs); - void updateActiveElements(ProcessLib::ProcessVariable const& pv); + void updateActiveElements(ProcessLib::Process const& process); static void copyResiduumVectorsToBulkMesh( GlobalVector const& rhs, @@ -70,7 +70,7 @@ protected: SubmeshAssemblyData const& sad); private: - void updateActiveElementsImpl(ProcessLib::ProcessVariable const& pv); + void updateActiveElementsImpl(Process const& process); protected: std::vector<SubmeshAssemblyData> submesh_assembly_data_; @@ -131,14 +131,9 @@ public: derived().getProcessVariables(process_id)); } - void updateActiveElements(const int process_id) + void updateActiveElements() { - // convention: process variable 0 governs where assembly takes place - // (active element IDs) - ProcessLib::ProcessVariable const& pv = - derived().getProcessVariables(process_id)[0]; - - AssemblyMixinBase::updateActiveElements(pv); + AssemblyMixinBase::updateActiveElements(derived()); } // cppcheck-suppress functionStatic diff --git a/ProcessLib/TH2M/TH2MProcess.cpp b/ProcessLib/TH2M/TH2MProcess.cpp index 416699bedc5acd42dc36963cdd6027f516817905..3162a1876a4a49b6cb207d3697d1ba905f1fdad5 100644 --- a/ProcessLib/TH2M/TH2MProcess.cpp +++ b/ProcessLib/TH2M/TH2MProcess.cpp @@ -278,8 +278,7 @@ void TH2MProcess<DisplacementDim>::preTimestepConcreteProcess( *_local_to_global_index_map, *x[process_id], t, dt); } - AssemblyMixin<TH2MProcess<DisplacementDim>>::updateActiveElements( - process_id); + AssemblyMixin<TH2MProcess<DisplacementDim>>::updateActiveElements(); } template <int DisplacementDim> diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp index 8d337a1f47861c5dcc8d7745be5707a26cd74187..3232236c0772e3406aa4ec7be32e91edd94e01f9 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsProcess.cpp @@ -233,10 +233,10 @@ void ThermoRichardsMechanicsProcess<DisplacementDim, ConstitutiveTraits>:: preTimestepConcreteProcess(std::vector<GlobalVector*> const& /*x*/, const double /*t*/, const double /*dt*/, - const int process_id) + const int /*process_id*/) { AssemblyMixin<ThermoRichardsMechanicsProcess< - DisplacementDim, ConstitutiveTraits>>::updateActiveElements(process_id); + DisplacementDim, ConstitutiveTraits>>::updateActiveElements(); } template <int DisplacementDim, typename ConstitutiveTraits>