]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Output the velocity as a vector field.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 4 Mar 2008 19:51:39 +0000 (19:51 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 4 Mar 2008 19:51:39 +0000 (19:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@15846 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 136f06ac46c2693434bcfe4c16ebe41fce6d343d..b6557048d8e29da671e4daa39a7a6cb5c6851dd5 100644 (file)
@@ -1589,19 +1589,21 @@ void ConsLaw<dim>::output_results (const unsigned int cycle) const
 
   DataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
-  std::vector<std::string> 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<std::string> solution_names (dim, "velocity");
+  solution_names.push_back ("density");
+  solution_names.push_back ("pressure");
+
+  std::vector<DataComponentInterpretation::DataComponentInterpretation>
+    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<dim>::type_dof_data,
+                           data_component_interpretation);
 
   data_out.add_data_vector (indicator, "error");
   data_out.build_patches ();

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.