From 66e0d568650938cfc0deab61b0e60f4fa1df19cf Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 13 Feb 2011 16:28:29 +0000 Subject: [PATCH] step-32: fix extrapolation. It triggered an exception in debug mode about sadd() with ghosted vectors. git-svn-id: https://svn.dealii.org/trunk@23348 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-32/step-32.cc | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index e67975e84f..0aa794f39b 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -3542,18 +3542,34 @@ void BoussinesqFlowProblem::run (const std::string parameter_filename) time += time_step; ++timestep_number; - TrilinosWrappers::MPI::BlockVector old_old_stokes_solution; - old_old_stokes_solution = old_stokes_solution; + TrilinosWrappers::MPI::BlockVector old_old_stokes_solution (stokes_rhs); + old_old_stokes_solution.block(0).reinit(old_stokes_solution.block(0),false,true); + old_old_stokes_solution.block(1).reinit(old_stokes_solution.block(1),false,true); old_stokes_solution = stokes_solution; old_old_temperature_solution = old_temperature_solution; old_temperature_solution = temperature_solution; if (old_time_step > 0) { - stokes_solution.sadd (1.+time_step/old_time_step, -time_step/old_time_step, - old_old_stokes_solution); - temperature_solution.sadd (1.+time_step/old_time_step, - -time_step/old_time_step, - old_old_temperature_solution); + TrilinosWrappers::MPI::BlockVector distributed_stokes_solution (stokes_rhs); + distributed_stokes_solution.block(0).reinit(stokes_solution.block(0),false,true); + distributed_stokes_solution.block(1).reinit(stokes_solution.block(1),false,true); + distributed_stokes_solution.sadd (1.+time_step/old_time_step, -time_step/old_time_step, + old_old_stokes_solution); + stokes_solution.block(0).reinit(distributed_stokes_solution.block(0), false, true); + stokes_solution.block(1).reinit(distributed_stokes_solution.block(1), false, true); + + TrilinosWrappers::MPI::Vector + distributed_temperature_solution (temperature_rhs); + distributed_temperature_solution.reinit(temperature_solution, false, true); + TrilinosWrappers::MPI::Vector + distributed_old_old_temperature_solution (temperature_rhs); + distributed_old_old_temperature_solution.reinit(old_old_temperature_solution, false, true); + + + distributed_temperature_solution.sadd (1.+time_step/old_time_step, + -time_step/old_time_step, + distributed_old_old_temperature_solution); + temperature_solution.reinit(distributed_temperature_solution, false, true); } } while (time <= parameters.end_time * EquationData::year_in_seconds); -- 2.39.5