From: bangerth Date: Thu, 11 Sep 2008 01:01:37 +0000 (+0000) Subject: Check in some code that doesn't currently work, but should -- we just have to make... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc664f935eeae9bb62f83b3484d7794fa5041b0b;p=dealii-svn.git Check in some code that doesn't currently work, but should -- we just have to make it work. git-svn-id: https://svn.dealii.org/trunk@16804 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 a708b800d5..5038e3ffd2 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -1116,9 +1116,9 @@ void BoussinesqFlowProblem::assemble_temperature_system () global_T_range = get_extrapolated_temperature_range(); const double global_Omega_diameter = GridTools::diameter (triangulation); - Vector old_temperature_vector (old_temperature_solution); - Vector old_old_temperature_vector (old_old_temperature_solution); - BlockVector stokes_vector (stokes_solution); + const Vector old_temperature_vector (old_temperature_solution); + const Vector old_old_temperature_vector (old_old_temperature_solution); + const BlockVector stokes_vector (stokes_solution); typename DoFHandler::active_cell_iterator cell = temperature_dof_handler.begin_active(), @@ -1276,7 +1276,9 @@ void BoussinesqFlowProblem::solve () << " GMRES iterations for Stokes subsystem." << std::endl; - stokes_constraints.distribute (stokes_solution); + const BlockVector localized_stokes_solution (stokes_solution); + stokes_constraints.distribute (localized_stokes_solution); + stokes_solution = localized_stokes_solution; } old_time_step = time_step; @@ -1301,27 +1303,28 @@ void BoussinesqFlowProblem::solve () temperature_rhs, preconditioner); - temperature_constraints.distribute (temperature_solution); + const Vector localized_temperature_solution (temperature_solution); + temperature_constraints.distribute (localized_temperature_solution); + temperature_solution = localized_temperature_solution; pcout << " " << solver_control.last_step() << " CG iterations for temperature." << std::endl; -// the following code doesn't work in parallel, of course -// double min_temperature = temperature_solution(0), -// max_temperature = temperature_solution(0); -// for (unsigned int i=0; i (min_temperature, -// temperature_solution(i)); -// max_temperature = std::max (max_temperature, -// temperature_solution(i)); -// } + double min_temperature = localized_temperature_solution(0), + max_temperature = localized_temperature_solution(0); + for (unsigned int i=0; i (min_temperature, + localized_temperature_solution(i)); + max_temperature = std::max (max_temperature, + localized_temperature_solution(i)); + } -// pcout << " Temperature range: " -// << min_temperature << ' ' << max_temperature -// << std::endl; + pcout << " Temperature range: " + << min_temperature << ' ' << max_temperature + << std::endl; } }