diff --git a/ProcessLib/LocalAssemblerInterface.cpp b/ProcessLib/LocalAssemblerInterface.cpp index 176abcf59bdf2b91fa4f488ca7b9b279ec512880..2527e34b367e72bf9fbe03252073269acfbd2034 100644 --- a/ProcessLib/LocalAssemblerInterface.cpp +++ b/ProcessLib/LocalAssemblerInterface.cpp @@ -131,11 +131,22 @@ void LocalAssemblerInterface::preTimestep( void LocalAssemblerInterface::postTimestep( std::size_t const mesh_item_id, - NumLib::LocalToGlobalIndexMap const& dof_table, GlobalVector const& x, - double const t, double const dt) + std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables, + std::vector<GlobalVector*> const& x, double const t, double const dt) { - auto const indices = NumLib::getIndices(mesh_item_id, dof_table); - auto const local_x = x.get(indices); + std::vector<double> local_x_vec; + + auto const n_processes = x.size(); + for (std::size_t process_id = 0; process_id < n_processes; ++process_id) + { + auto const indices = + NumLib::getIndices(mesh_item_id, *dof_tables[process_id]); + assert(!indices.empty()); + auto const local_solution = x[process_id]->get(indices); + local_x_vec.insert(std::end(local_x_vec), std::begin(local_solution), + std::end(local_solution)); + } + auto const local_x = MathLib::toVector(local_x_vec); postTimestepConcrete(local_x, t, dt); } diff --git a/ProcessLib/LocalAssemblerInterface.h b/ProcessLib/LocalAssemblerInterface.h index ced1e4d39c58833b9c88461abf5eab8e232ae5fe..9b2753b463aea776e83b7653955387c5cb960470 100644 --- a/ProcessLib/LocalAssemblerInterface.h +++ b/ProcessLib/LocalAssemblerInterface.h @@ -89,10 +89,10 @@ public: GlobalVector const& x, double const t, double const delta_t); - virtual void postTimestep(std::size_t const mesh_item_id, - NumLib::LocalToGlobalIndexMap const& dof_table, - GlobalVector const& x, double const t, - double const dt); + virtual void postTimestep( + std::size_t const mesh_item_id, + std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables, + std::vector<GlobalVector*> const& x, double const t, double const dt); void postNonLinearSolver(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const& dof_table,