From: Timo Heister Date: Fri, 31 Aug 2012 15:21:43 +0000 (+0000) Subject: step-32: fix sadd with ghosted vectors X-Git-Tag: v8.0.0~2206 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=196c54589eb8a9b0d6ed59f57d169910d2e20911;p=dealii.git step-32: fix sadd with ghosted vectors git-svn-id: https://svn.dealii.org/trunk@26182 0785d39b-7218-0410-832d-ea1e28bc413d --- 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))