]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Document the new feature of being able to output vector components.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 14 Oct 2007 23:03:53 +0000 (23:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 14 Oct 2007 23:03:53 +0000 (23:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@15317 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/examples/step-22/step-22.cc

index 5d4b13d83f2e396c86c31a9c38a77b82bdf35209..9f96cb11ee5e17d4fa1efc9454154c5bdce960cd 100644 (file)
@@ -42,7 +42,8 @@ inconvenience this causes.
   </p>
 
   <li> <p>Changed: FilteredMatrix now can be applied to any matrix having the standard
-  set of <code>vmult</code> functions. In order to achieve this, its interface had to be overhauled.
+  set of <code>vmult</code> functions. In order to achieve this, its interface
+  had to be overhauled.
   Only the <code>VECTOR</code> template argument remains. Furthermore, instead of
   PreconditionJacobi being applied to FilteredMatrix, FilteredMatrix
   can now be applied to any preconditioner.
@@ -83,7 +84,8 @@ inconvenience this causes.
   them together into a vector.
   <p>
   While all output format writers receive the information necessary to do this, currently
-  only the VTK reader in DataOutBase::write_vtk makes use of it.
+  only the VTK reader in DataOutBase::write_vtk as well as the deal.II
+  intermediate format writer make use of it.
   <p>
   The use of this ability is explained in the @ref step_22 "step-22" tutorial program.
   <br>
@@ -114,6 +116,24 @@ inconvenience this causes.
 
 <ol> 
 
+  <li> <p>New: The DataOut, DataOutRotation, DataOutStack, and DataOutFaces
+  can now deal with vector-valued data if the functions in DataOutBase
+  that write in a particular graphical output format can deal with it.
+  Previously, if a finite element field had more than one component,
+  they were all output as logically independent scalar components;
+  most visualization programs then allowed to display vector fields
+  by composing them of individual scalar fields for each vector component.
+  <p>
+  With the new scheme, the DataOut_DoFData::add_data_vector() functions
+  inherited by the classes listed above take an additional parameter
+  that may be used to indicate that certain components of the data
+  logically form a vector field. The output formats for which this
+  is presently implemented then indicate this fact in the output file. The
+  mechanism is shown in action in @ref step_22 "step-22".
+  <br>
+  (WB 2007/10/14)
+  </p></li>
+
   <li> <p>Improved: UpdateFlags::update_q_points has been renamed to
   UpdateFlags::update_quadrature_points. Additional update flags for support
   points have been added without functionality, yet.
@@ -121,11 +141,11 @@ inconvenience this causes.
   (GK 2007/10/12)
   </p></li>
 
-<li> <p>Improved: The number of blocks of an FESystem was properly defined and the
-constructors changed accordingly. At least non of the test programs noticed the change.
-<br>
-(GK 2007/10/03)
-</p></li>
+  <li> <p>Improved: The number of blocks of an FESystem was properly defined and the
+  constructors changed accordingly. At least non of the test programs noticed the change.
+  <br>
+  (GK 2007/10/03)
+  </p></li>
 
   <li> <p>Improved: In an effort to make names more consistent, second
   derivatives in FEValuesBase and UpdateFlags have been renamed to
index a02291d0f258753526c00f3fa5744291bdeb2559..e91b4df38d00a9a778b557eb9226e6cd03220f3a 100644 (file)
@@ -798,34 +798,26 @@ void BoussinesqFlowProblem<dim>::output_results ()  const
   if (timestep_number % 25 != 0)
     return;
   
-  std::vector<std::string> solution_names;
-  switch (dim)
-    {
-      case 2:
-            solution_names.push_back ("u");
-            solution_names.push_back ("v");
-            solution_names.push_back ("p");
-            solution_names.push_back ("T");
-            break;
-            
-      case 3:
-            solution_names.push_back ("u");
-            solution_names.push_back ("v");
-            solution_names.push_back ("w");
-            solution_names.push_back ("p");
-            solution_names.push_back ("T");
-            break;
-            
-      default:
-            Assert (false, ExcNotImplemented());
-    }
+  std::vector<std::string> solution_names (dim, "velocity");
+  solution_names.push_back ("p");
+  solution_names.push_back ("T");
   
   DataOut<dim> data_out;
 
   data_out.attach_dof_handler (dof_handler);
-  data_out.add_data_vector (solution, solution_names);
 
-  data_out.build_patches (degree+1);
+  std::vector<DataComponentInterpretation::DataComponentInterpretation>
+    data_component_interpretation
+    (dim+2, DataComponentInterpretation::component_is_scalar);
+  for (unsigned int i=0; i<dim; ++i)
+    data_component_interpretation[i]
+      = DataComponentInterpretation::component_is_part_of_vector;
+  
+  data_out.add_data_vector (solution, solution_names,
+                           DataOut<dim>::type_dof_data,
+                           data_component_interpretation);
+
+  data_out.build_patches (degree);
   
   std::ostringstream filename;
   filename << "solution-" << timestep_number << ".vtk";

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.