From: bangerth Date: Thu, 18 Nov 2010 16:23:24 +0000 (+0000) Subject: In output_results, we were using a ghosted vector to assemble a solution vector that... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc2ff62cd579705600fd3a133c8126c111b858a4;p=dealii-svn.git In output_results, we were using a ghosted vector to assemble a solution vector that contained the Boussinesq solution plus all sorts of other stuff. But we've since disallowed writing into ghosted vectors, so this didn't work any more. Instead now write into a non-ghosted vector and later created a ghosted version of it for output through DataOut. git-svn-id: https://svn.dealii.org/trunk@22804 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 d5a6be2a7c..f3cea6a5d1 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -3175,10 +3175,8 @@ void BoussinesqFlowProblem::output_results () ExcInternalError()); TrilinosWrappers::MPI::Vector joint_solution; - IndexSet locally_relevant_dofs(joint_dof_handler.n_dofs()); - DoFTools::extract_locally_relevant_dofs (joint_dof_handler, locally_relevant_dofs); - joint_solution.reinit (locally_relevant_dofs, MPI_COMM_WORLD); - + joint_solution.reinit (joint_dof_handler.locally_owned_dofs(), MPI_COMM_WORLD); + { //double minimal_pressure = stokes_solution.block(1)(0); //for (unsigned int i=0; i::output_results () data_component_interpretation[i] = DataComponentInterpretation::component_is_part_of_vector; - data_out.add_data_vector (joint_solution, joint_solution_names, + IndexSet locally_relevant_dofs(joint_dof_handler.n_dofs()); + DoFTools::extract_locally_relevant_dofs (joint_dof_handler, locally_relevant_dofs); + TrilinosWrappers::MPI::Vector locally_relevant_joint_solution; + locally_relevant_joint_solution.reinit (locally_relevant_dofs, MPI_COMM_WORLD); + locally_relevant_joint_solution = joint_solution; + + data_out.add_data_vector (locally_relevant_joint_solution, joint_solution_names, DataOut::type_dof_data, data_component_interpretation); data_out.build_patches (1+std::min(stokes_degree, temperature_degree)); - const std::string filename = ("out/solution-" + + const std::string filename = ("solution-" + Utilities::int_to_string (out_index, 5) + "." + Utilities::int_to_string @@ -3324,7 +3328,7 @@ void BoussinesqFlowProblem::output_results () Utilities::int_to_string(i, 4) + ".vtu"); const std::string - master_filename = ("out/solution-" + + master_filename = ("solution-" + Utilities::int_to_string (out_index, 5) + ".pvtu"); std::ofstream master (master_filename.c_str());