]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
In output_results, we were using a ghosted vector to assemble a solution vector that...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Nov 2010 16:23:24 +0000 (16:23 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Nov 2010 16:23:24 +0000 (16:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@22804 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-32/step-32.cc

index d5a6be2a7c7786e34eeffd9bbb35f5c6e2bdc0e9..f3cea6a5d17d4930b5fdaa75b35e436096b91c69 100644 (file)
@@ -3175,10 +3175,8 @@ void BoussinesqFlowProblem<dim>::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<stokes_solution.block(1).size(); ++i)
@@ -3300,12 +3298,18 @@ void BoussinesqFlowProblem<dim>::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<dim>::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<dim>::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());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.