From 6c31d27d9266f949a030a663ee7785e9b003896d Mon Sep 17 00:00:00 2001 From: heister Date: Fri, 31 Aug 2012 15:21:43 +0000 Subject: [PATCH] step-32: fix sadd with ghosted vectors git-svn-id: https://svn.dealii.org/trunk@26182 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-32/step-32.cc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index a07419dc95..e01eb034f4 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -4343,11 +4343,25 @@ namespace Step32 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); + //Trilinos sadd does not like ghost vectors even as input. Copy into distributed vectors for now: + { + TrilinosWrappers::MPI::BlockVector distr_solution (stokes_rhs); + distr_solution = stokes_solution; + TrilinosWrappers::MPI::BlockVector distr_old_solution (stokes_rhs); + distr_old_solution = old_old_stokes_solution; + distr_solution .sadd (1.+time_step/old_time_step, -time_step/old_time_step, + distr_old_solution); + stokes_solution = distr_solution; + } + { + TrilinosWrappers::MPI::Vector distr_solution (temperature_rhs); + distr_solution = temperature_solution; + TrilinosWrappers::MPI::Vector distr_old_solution (temperature_rhs); + distr_old_solution = old_old_temperature_solution; + distr_solution .sadd (1.+time_step/old_time_step, -time_step/old_time_step, + distr_old_solution); + temperature_solution = distr_solution; + } } if ((timestep_number > 0) && (timestep_number % 100 == 0)) -- 2.39.5