From ad88cbf13db4ea9166d0204138eb7ba94e2327a1 Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Tue, 17 Dec 2019 23:36:42 +0100 Subject: [PATCH] [PL] Remove local_xs from CoupledSolsForStagg. --- ProcessLib/CoupledSolutionsForStaggeredScheme.h | 8 ++------ ProcessLib/VectorMatrixAssembler.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ProcessLib/CoupledSolutionsForStaggeredScheme.h b/ProcessLib/CoupledSolutionsForStaggeredScheme.h index cfce3363a5e..a799cecacd9 100644 --- a/ProcessLib/CoupledSolutionsForStaggeredScheme.h +++ b/ProcessLib/CoupledSolutionsForStaggeredScheme.h @@ -49,17 +49,13 @@ struct CoupledSolutionsForStaggeredScheme */ struct LocalCoupledSolutions { - LocalCoupledSolutions(std::vector<double>&& local_coupled_xs0_, - std::vector<double>&& local_coupled_xs_) - : local_coupled_xs0(std::move(local_coupled_xs0_)), - local_coupled_xs(std::move(local_coupled_xs_)) + LocalCoupledSolutions(std::vector<double>&& local_coupled_xs0_) + : local_coupled_xs0(std::move(local_coupled_xs0_)) { } /// Local solutions of the previous time step. std::vector<double> const local_coupled_xs0; - /// Local solutions of the current time step. - std::vector<double> const local_coupled_xs; }; /** diff --git a/ProcessLib/VectorMatrixAssembler.cpp b/ProcessLib/VectorMatrixAssembler.cpp index c58d77a181b..eed34a64370 100644 --- a/ProcessLib/VectorMatrixAssembler.cpp +++ b/ProcessLib/VectorMatrixAssembler.cpp @@ -70,12 +70,14 @@ void VectorMatrixAssembler::assemble( { auto local_coupled_xs0 = getCoupledLocalSolutions(cpl_xs->coupled_xs_t0, indices_of_processes); + auto local_coupled_xs = getCoupledLocalSolutions(x, indices_of_processes); auto const local_x = MathLib::toVector(local_coupled_xs); + ProcessLib::LocalCoupledSolutions local_coupled_solutions( - std::move(local_coupled_xs0), std::move(local_coupled_xs)); + std::move(local_coupled_xs0)); local_assembler.assembleForStaggeredScheme( t, dt, local_x, process_id, _local_M_data, _local_K_data, @@ -139,13 +141,14 @@ void VectorMatrixAssembler::assembleWithJacobian( { auto local_coupled_xs0 = getCoupledLocalSolutions(cpl_xs->coupled_xs_t0, indices_of_processes); + auto local_coupled_xs = getCoupledLocalSolutions(x, indices_of_processes); auto const local_x = MathLib::toVector(local_coupled_xs); ProcessLib::LocalCoupledSolutions local_coupled_solutions( - std::move(local_coupled_xs0), std::move(local_coupled_xs)); + std::move(local_coupled_xs0)); _jacobian_assembler->assembleWithJacobianForStaggeredScheme( local_assembler, t, dt, local_x, local_xdot, dxdot_dx, dx_dx, -- GitLab