From fab8d0907d021227020fd4976545da3032797bfb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 4 Mar 2008 19:51:39 +0000 Subject: [PATCH] Output the velocity as a vector field. git-svn-id: https://svn.dealii.org/trunk@15846 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-33/step-33.cc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index 136f06ac46..b6557048d8 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -1589,19 +1589,21 @@ void ConsLaw::output_results (const unsigned int cycle) const DataOut data_out; data_out.attach_dof_handler (dof_handler); - std::vector solution_names; - - // Rename the output with the physical variable - // names. Send the post-processed values. - solution_names.clear(); - for (int i = 0; i < dim; i++) { - char buf[512]; - std::sprintf(buf, "v_%d", i); - solution_names.push_back (buf); - } - solution_names.push_back("density"); - solution_names.push_back("pressure"); - data_out.add_data_vector (ppsolution, solution_names); + std::vector solution_names (dim, "velocity"); + solution_names.push_back ("density"); + solution_names.push_back ("pressure"); + + std::vector + data_component_interpretation + (dim, DataComponentInterpretation::component_is_part_of_vector); + data_component_interpretation + .push_back (DataComponentInterpretation::component_is_scalar); + data_component_interpretation + .push_back (DataComponentInterpretation::component_is_scalar); + + data_out.add_data_vector (ppsolution, solution_names, + DataOut::type_dof_data, + data_component_interpretation); data_out.add_data_vector (indicator, "error"); data_out.build_patches (); -- 2.39.5