Commit fd4d2186 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

[PL/RM] Extract common getDOFTables() function.

parent e54164cb
......@@ -551,11 +551,7 @@ void RichardsMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
if (hasMechanicalProcess(process_id))
{
DBUG("PostTimestep RichardsMechanicsProcess.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
auto const n_processes = x.size();
dof_tables.reserve(n_processes);
std::generate_n(std::back_inserter(dof_tables), n_processes,
[&]() { return &getDOFTable(dof_tables.size()); });
auto const dof_tables = getDOFTables(x.size());
ProcessLib::ProcessVariable const& pv =
getProcessVariables(process_id)[0];
......@@ -578,11 +574,7 @@ void RichardsMechanicsProcess<DisplacementDim>::
}
DBUG("Compute the secondary variables for RichardsMechanicsProcess.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
auto const n_processes = x.size();
dof_tables.reserve(n_processes);
std::generate_n(std::back_inserter(dof_tables), n_processes,
[&]() { return &getDOFTable(dof_tables.size()); });
auto const dof_tables = getDOFTables(x.size());
ProcessLib::ProcessVariable const& pv = getProcessVariables(process_id)[0];
GlobalExecutor::executeSelectedMemberOnDereferenced(
......@@ -613,6 +605,18 @@ RichardsMechanicsProcess<DisplacementDim>::getDOFTable(
return *_local_to_global_index_map_with_base_nodes;
}
template <int DisplacementDim>
std::vector<NumLib::LocalToGlobalIndexMap const*>
RichardsMechanicsProcess<DisplacementDim>::getDOFTables(
int const number_of_processes) const
{
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
dof_tables.reserve(number_of_processes);
std::generate_n(std::back_inserter(dof_tables), number_of_processes,
[&]() { return &getDOFTable(dof_tables.size()); });
return dof_tables;
}
template class RichardsMechanicsProcess<2>;
template class RichardsMechanicsProcess<3>;
......
......@@ -96,6 +96,9 @@ private:
NumLib::LocalToGlobalIndexMap const& getDOFTable(
const int process_id) const override;
std::vector<NumLib::LocalToGlobalIndexMap const*> getDOFTables(
const int number_of_processes) const;
private:
std::vector<MeshLib::Node*> _base_nodes;
std::unique_ptr<MeshLib::MeshSubset const> _mesh_subset_base_nodes;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment