From: bangerth Date: Sun, 14 Oct 2007 23:03:53 +0000 (+0000) Subject: Document the new feature of being able to output vector components. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=472e74e13453a181aeda06fd7a2afb9b6ce87520;p=dealii-svn.git Document the new feature of being able to output vector components. git-svn-id: https://svn.dealii.org/trunk@15317 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 5d4b13d83f..9f96cb11ee 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -42,7 +42,8 @@ inconvenience this causes.

  • Changed: FilteredMatrix now can be applied to any matrix having the standard - set of vmult functions. In order to achieve this, its interface had to be overhauled. + set of vmult functions. In order to achieve this, its interface + had to be overhauled. Only the VECTOR 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.

    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.

    The use of this ability is explained in the @ref step_22 "step-22" tutorial program.
    @@ -114,6 +116,24 @@ inconvenience this causes.

      +
    1. 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. +

      + 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". +
      + (WB 2007/10/14) +

    2. +
    3. 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)

    4. -
    5. 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. -
      -(GK 2007/10/03) -

    6. +
    7. 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. +
      + (GK 2007/10/03) +

    8. Improved: In an effort to make names more consistent, second derivatives in FEValuesBase and UpdateFlags have been renamed to diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index a02291d0f2..e91b4df38d 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -798,34 +798,26 @@ void BoussinesqFlowProblem::output_results () const if (timestep_number % 25 != 0) return; - std::vector 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 solution_names (dim, "velocity"); + solution_names.push_back ("p"); + solution_names.push_back ("T"); DataOut 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 + data_component_interpretation + (dim+2, DataComponentInterpretation::component_is_scalar); + for (unsigned int i=0; i::type_dof_data, + data_component_interpretation); + + data_out.build_patches (degree); std::ostringstream filename; filename << "solution-" << timestep_number << ".vtk";