Skip to content
Snippets Groups Projects
Commit f58ad50e authored by wenqing's avatar wenqing
Browse files

[ProcessLib] Using NumLib::getDOFTables in THM

parent 1072f295
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
#include "MeshLib/Elements/Utils.h"
#include "MeshLib/Utils/getOrCreateMeshProperty.h"
#include "NumLib/DOF/ComputeSparsityPattern.h"
#include "NumLib/DOF/DOFTableUtil.h"
#include "ProcessLib/Deformation/SolidMaterialInternalToSecondaryVariables.h"
#include "ProcessLib/Process.h"
#include "ProcessLib/Utils/CreateLocalAssemblersTaylorHood.h"
......@@ -460,20 +461,17 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
}
DBUG("PostTimestep ThermoHydroMechanicsProcess.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
auto const n_processes = x.size();
dof_tables.reserve(n_processes);
for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
{
dof_tables.push_back(&getDOFTable(process_id));
}
auto get_a_dof_table_func = [this](const int processe_id) -> auto&
{
return getDOFTable(processe_id);
};
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface<DisplacementDim>::postTimestep,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, x, x_prev, t,
dt, process_id);
_local_assemblers, pv.getActiveElementIDs(),
NumLib::getDOFTables(x.size(), get_a_dof_table_func), x, x_prev, t, dt,
process_id);
}
template <int DisplacementDim>
......@@ -489,19 +487,17 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::
}
DBUG("Compute the secondary variables for ThermoHydroMechanicsProcess.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
auto const n_processes = x.size();
dof_tables.reserve(n_processes);
for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
{
dof_tables.push_back(&getDOFTable(process_id));
}
auto get_a_dof_table_func = [this](const int processe_id) -> auto&
{
return getDOFTable(processe_id);
};
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
&LocalAssemblerInterface<DisplacementDim>::computeSecondaryVariable,
_local_assemblers, pv.getActiveElementIDs(), dof_tables, t, dt, x,
x_prev, process_id);
_local_assemblers, pv.getActiveElementIDs(),
NumLib::getDOFTables(x.size(), get_a_dof_table_func), t, dt, x, x_prev,
process_id);
}
template <int DisplacementDim>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment