--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2006 - 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Check that one can output physical units along with output
+// fields. This test is for scalar quantities and checks the
+// pvtu writer.
+
+
+#include <deal.II/base/data_out_base.h>
+
+#include <string>
+#include <vector>
+
+#include "../tests.h"
+
+#include "patches.h"
+
+// Output data on repetitions of the unit hypercube
+
+template <int dim, int spacedim>
+void
+check(DataOutBase::VtkFlags flags, std::ostream &out)
+{
+ std::vector<std::string> names(5);
+ names[0] = "x1";
+ names[1] = "x2";
+ names[2] = "x3";
+ names[3] = "x4";
+ names[4] = "i";
+
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ vectors;
+ DataOutBase::write_pvtu_record(out, {"abc.vtu"}, names, vectors, flags);
+}
+
+
+template <int dim, int spacedim>
+void
+check_all(std::ostream &log)
+{
+ DataOutBase::VtkFlags flags;
+
+ // Set the units of some but not all output quantities
+ flags.physical_units["x1"] = "kg/s";
+ flags.physical_units["x3"] = "N/m";
+ flags.physical_units["i"] = "J/K";
+
+ log << "==============================" << std::endl
+ << dim << spacedim << ".vtu" << std::endl
+ << "==============================" << std::endl;
+ check<dim, spacedim>(flags, log);
+}
+
+int
+main()
+{
+ initlog();
+
+ check_all<1, 1>(deallog.get_file_stream());
+ check_all<1, 2>(deallog.get_file_stream());
+ check_all<2, 2>(deallog.get_file_stream());
+ check_all<2, 3>(deallog.get_file_stream());
+ check_all<3, 3>(deallog.get_file_stream());
+}
--- /dev/null
+
+==============================
+11.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x2" format="ascii"/>
+ <PDataArray type="Float32" Name="x3" format="ascii" units="N/m"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii" units="J/K"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+12.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x2" format="ascii"/>
+ <PDataArray type="Float32" Name="x3" format="ascii" units="N/m"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii" units="J/K"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+22.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x2" format="ascii"/>
+ <PDataArray type="Float32" Name="x3" format="ascii" units="N/m"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii" units="J/K"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+23.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x2" format="ascii"/>
+ <PDataArray type="Float32" Name="x3" format="ascii" units="N/m"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii" units="J/K"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+33.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x2" format="ascii"/>
+ <PDataArray type="Float32" Name="x3" format="ascii" units="N/m"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii" units="J/K"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2006 - 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Check that one can output physical units along with output
+// fields. This test is for vector-valued quantities and checks the
+// pvtu writer.
+
+
+#include <deal.II/base/data_out_base.h>
+
+#include <string>
+#include <vector>
+
+#include "../tests.h"
+
+#include "patches.h"
+
+// Output data on repetitions of the unit hypercube
+
+template <int dim, int spacedim>
+void
+check(DataOutBase::VtkFlags flags, std::ostream &out)
+{
+ std::vector<std::string> names(5);
+ names[0] = "x1";
+ names[1] = "x2";
+ names[2] = "x3";
+ names[3] = "x4";
+ names[4] = "i";
+ for (unsigned int i = 1; i < 1 + dim; ++i)
+ names[i] = "v";
+
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ vectors{{1,
+ 1 + dim - 1,
+ "v",
+ DataComponentInterpretation::component_is_part_of_vector}};
+ DataOutBase::write_pvtu_record(out, {"abc.vtu"}, names, vectors, flags);
+}
+
+
+template <int dim, int spacedim>
+void
+check_all(std::ostream &log)
+{
+ DataOutBase::VtkFlags flags;
+
+ // Set the units of some but not all output quantities
+ flags.physical_units["x1"] = "kg/s";
+ flags.physical_units["v"] = "m/s";
+
+ log << "==============================" << std::endl
+ << dim << spacedim << ".vtu" << std::endl
+ << "==============================" << std::endl;
+ check<dim, spacedim>(flags, log);
+}
+
+int
+main()
+{
+ std::stringstream ss;
+ check_all<1, 1>(ss);
+ check_all<1, 2>(ss);
+ check_all<2, 2>(ss);
+ check_all<2, 3>(ss);
+ check_all<3, 3>(ss);
+
+ std::ofstream logfile("output");
+ filter_out_xml_key(ss, "DataArray", logfile);
+}
--- /dev/null
+==============================
+11.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="v" NumberOfComponents="3" format="ascii" units="m/s"/>
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x3" format="ascii"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+12.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="v" NumberOfComponents="3" format="ascii" units="m/s"/>
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x3" format="ascii"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+22.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="v" NumberOfComponents="3" format="ascii" units="m/s"/>
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+23.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="v" NumberOfComponents="3" format="ascii" units="m/s"/>
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="x4" format="ascii"/>
+ <PDataArray type="Float32" Name="i" format="ascii"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+==============================
+33.vtu
+==============================
+<?xml version="1.0"?>
+<!--
+#This file was generated
+-->
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPointData Scalars="scalars">
+ <PDataArray type="Float32" Name="v" NumberOfComponents="3" format="ascii" units="m/s"/>
+ <PDataArray type="Float32" Name="x1" format="ascii" units="kg/s"/>
+ <PDataArray type="Float32" Name="i" format="ascii"/>
+ </PPointData>
+ <PPoints>
+ <PDataArray type="Float32" NumberOfComponents="3"/>
+ </PPoints>
+ <Piece Source="abc.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2006 - 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Check that one can output physical units along with output fields
+
+
+#include <deal.II/base/data_out_base.h>
+
+#include <string>
+#include <vector>
+
+#include "../tests.h"
+
+#include "patches.h"
+
+// Output data on repetitions of the unit hypercube
+
+template <int dim, int spacedim>
+void
+check(DataOutBase::VtkFlags flags, std::ostream &out)
+{
+ const unsigned int np = 4;
+
+ std::vector<DataOutBase::Patch<dim, spacedim>> patches(np);
+
+ create_patches(patches);
+
+ std::vector<std::string> names(5);
+ names[0] = "x1";
+ names[1] = "x2";
+ names[2] = "x3";
+ names[3] = "x4";
+ names[4] = "i";
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ vectors;
+ DataOutBase::write_vtu(patches, names, vectors, flags, out);
+}
+
+
+template <int dim, int spacedim>
+void
+check_all(std::ostream &log)
+{
+ DataOutBase::VtkFlags flags;
+
+ // Set the units of some but not all output quantities
+ flags.physical_units["x1"] = "kg/s";
+ flags.physical_units["x3"] = "N/m";
+ flags.physical_units["i"] = "J/K";
+
+ log << "==============================" << std::endl
+ << dim << spacedim << ".vtu" << std::endl
+ << "==============================" << std::endl;
+ check<dim, spacedim>(flags, log);
+}
+
+int
+main()
+{
+ std::stringstream ss;
+ check_all<1, 1>(ss);
+ check_all<1, 2>(ss);
+ check_all<2, 2>(ss);
+ check_all<2, 3>(ss);
+ check_all<3, 3>(ss);
+
+ std::ofstream logfile("output");
+ filter_out_xml_key(ss, "DataArray", logfile);
+}
--- /dev/null
+==============================
+11.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="14" NumberOfCells="10" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x2" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary" units="N/m">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary" units="J/K">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+12.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="14" NumberOfCells="10" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x2" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary" units="N/m">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary" units="J/K">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+22.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="54" NumberOfCells="30" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x2" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary" units="N/m">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary" units="J/K">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+23.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="54" NumberOfCells="30" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x2" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary" units="N/m">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary" units="J/K">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+33.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="224" NumberOfCells="100" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x2" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary" units="N/m">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary" units="J/K">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2006 - 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Check that one can output physical units along with output
+// fields. This test is for vector-valued quantities
+
+
+#include <deal.II/base/data_out_base.h>
+
+#include <string>
+#include <vector>
+
+#include "../tests.h"
+
+#include "patches.h"
+
+// Output data on repetitions of the unit hypercube
+
+template <int dim, int spacedim>
+void
+check(DataOutBase::VtkFlags flags, std::ostream &out)
+{
+ const unsigned int np = 4;
+
+ std::vector<DataOutBase::Patch<dim, spacedim>> patches(np);
+
+ create_patches(patches);
+
+ std::vector<std::string> names(5);
+ names[0] = "x1";
+ names[1] = "x2";
+ names[2] = "x3";
+ names[3] = "x4";
+ names[4] = "i";
+ for (unsigned int i = 1; i < 1 + dim; ++i)
+ names[i] = "v";
+
+ std::vector<
+ std::tuple<unsigned int,
+ unsigned int,
+ std::string,
+ DataComponentInterpretation::DataComponentInterpretation>>
+ vectors{{1,
+ 1 + dim - 1,
+ "v",
+ DataComponentInterpretation::component_is_part_of_vector}};
+ DataOutBase::write_vtu(patches, names, vectors, flags, out);
+}
+
+
+template <int dim, int spacedim>
+void
+check_all(std::ostream &log)
+{
+ DataOutBase::VtkFlags flags;
+
+ // Set the units of some but not all output quantities
+ flags.physical_units["x1"] = "kg/s";
+ flags.physical_units["v"] = "m/s";
+
+ log << "==============================" << std::endl
+ << dim << spacedim << ".vtu" << std::endl
+ << "==============================" << std::endl;
+ check<dim, spacedim>(flags, log);
+}
+
+int
+main()
+{
+ std::stringstream ss;
+ check_all<1, 1>(ss);
+ check_all<1, 2>(ss);
+ check_all<2, 2>(ss);
+ check_all<2, 3>(ss);
+ check_all<3, 3>(ss);
+
+ std::ofstream logfile("output");
+ filter_out_xml_key(ss, "DataArray", logfile);
+}
--- /dev/null
+==============================
+11.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="14" NumberOfCells="10" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="v" NumberOfComponents="3" format="binary" units="m/s">
+</DataArray>
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+12.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="14" NumberOfCells="10" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="v" NumberOfComponents="3" format="binary" units="m/s">
+</DataArray>
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x3" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+22.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="54" NumberOfCells="30" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="v" NumberOfComponents="3" format="binary" units="m/s">
+</DataArray>
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+23.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="54" NumberOfCells="30" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="v" NumberOfComponents="3" format="binary" units="m/s">
+</DataArray>
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="x4" format="binary">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+==============================
+33.vtu
+==============================
+<?xml version="1.0" ?>
+<!--
+# vtk DataFile Version 3.0
+#This file was generated
+-->
+<VTKFile type="UnstructuredGrid" version="0.1" compressor="vtkZLibDataCompressor" byte_order="LittleEndian">
+<UnstructuredGrid>
+<Piece NumberOfPoints="224" NumberOfCells="100" >
+ <Points>
+ <DataArray type="Float32" NumberOfComponents="3" format="binary">
+</DataArray>
+ </Points>
+
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="binary">
+</DataArray>
+ <DataArray type="Int32" Name="offsets" format="binary">
+</DataArray>
+ <DataArray type="UInt8" Name="types" format="binary">
+</DataArray>
+ </Cells>
+ <PointData Scalars="scalars">
+ <DataArray type="Float32" Name="v" NumberOfComponents="3" format="binary" units="m/s">
+</DataArray>
+ <DataArray type="Float32" Name="x1" format="binary" units="kg/s">
+</DataArray>
+ <DataArray type="Float32" Name="i" format="binary">
+</DataArray>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>