41#ifdef DEAL_II_WITH_ZLIB
45#ifdef DEAL_II_WITH_HDF5
49#include <boost/iostreams/copy.hpp>
50#include <boost/iostreams/device/back_inserter.hpp>
51#include <boost/iostreams/filtering_stream.hpp>
52#ifdef DEAL_II_WITH_ZLIB
53# include <boost/iostreams/filter/zlib.hpp>
68 <<
"Unexpected input: expected line\n <" <<
arg1
69 <<
">\nbut got\n <" <<
arg2 <<
">");
71# ifdef DEAL_II_WITH_ZLIB
78# ifdef DEAL_II_WITH_ZLIB
102# ifdef DEAL_II_WITH_MPI
113 return boost::iostreams::zlib::no_compression;
115 return boost::iostreams::zlib::best_speed;
117 return boost::iostreams::zlib::best_compression;
119 return boost::iostreams::zlib::default_compression;
122 return boost::iostreams::zlib::no_compression;
132 template <
typename T>
137# ifdef DEAL_II_WITH_ZLIB
138 if (
data.size() != 0)
148 std::numeric_limits<std::uint32_t>::max(),
154 std::numeric_limits<std::uint32_t>::max(),
161 reinterpret_cast<const Bytef *
>(
data.data()),
174 static_cast<std::uint32_t
>(
176 static_cast<std::uint32_t
>(
190 (
void)compression_level;
192 ExcMessage(
"This function can only be called if cmake found "
193 "a working libz installation."));
208 template <
typename T>
222 std::ostringstream stream;
223 stream.precision(precision);
224 for (
const T &el :
data)
245 std::uint64_t space_dimension;
297 SvgCell::operator<(
const SvgCell &e)
const
338 EpsCell2d::operator<(
const EpsCell2d &e)
const
357 template <
int dim,
int spacedim,
typename Number =
double>
358 std::unique_ptr<Table<2, Number>>
363 return std::make_unique<Table<2, Number>>();
372 const unsigned int n_data_sets = patches[0].points_are_available ?
373 (patches[0].data.n_rows() - spacedim) :
376 std::accumulate(patches.begin(),
379 [](
const unsigned int count,
381 return count + patch.data.n_cols();
385 std::make_unique<Table<2, Number>>(n_data_sets,
n_data_points);
389 for (
const auto &
patch : patches)
391 const unsigned int n_subdivisions =
patch.n_subdivisions;
392 (
void)n_subdivisions;
395 !
patch.points_are_available) ||
396 (
patch.data.n_rows() == n_data_sets + spacedim &&
397 patch.points_are_available),
399 (n_data_sets + spacedim) :
402 Assert(
patch.reference_cell != ReferenceCells::get_hypercube<dim>() ||
403 (n_data_sets == 0) ||
404 (
patch.data.n_cols() ==
405 Utilities::fixed_power<dim>(n_subdivisions + 1)),
407 n_subdivisions + 1));
426 , node_dim(
numbers::invalid_unsigned_int)
434 , node_dim(
numbers::invalid_unsigned_int)
447 for (
unsigned int d = 0; d < dim; ++d)
490 for (
unsigned int d = 0; d <
node_dim; ++d)
500 std::vector<unsigned int> &cell_data)
const
576 const unsigned int start,
577 const std::array<unsigned int, dim> &
offsets)
639 const unsigned int start,
640 const unsigned int n_points,
645 const unsigned int base_entry = index * n_points;
647 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
649 for (
unsigned int i = 0; i < n_points; ++i)
660 const unsigned int dimension,
683 for (
unsigned int d = 0; d <
new_dim; ++d)
702 const char *
gmv_cell_type[4] = {
"",
"line 2",
"quad 4",
"hex 8"};
704 const char *
ucd_cell_type[4] = {
"pt",
"line",
"quad",
"hex"};
721 template <
int dim,
int spacedim>
722 std::array<unsigned int, 3>
724 const bool write_higher_order_cells)
730 patch.reference_cell.n_vertices()}};
732 if (write_higher_order_cells)
737 else if (
patch.data.n_cols() ==
patch.reference_cell.n_vertices())
741 patch.data.n_cols() == 6)
748 patch.data.n_cols() == 10)
754 else if (
patch.reference_cell.is_hyper_cube())
760 else if (
patch.reference_cell.is_simplex())
782 template <
int dim,
int spacedim>
787 const unsigned int n_subdivisions)
800 if (
patch.points_are_available)
809 point_no += (n_subdivisions + 1) * (n_subdivisions + 1) *
zstep;
827 for (
unsigned int d = 0;
d < spacedim; ++
d)
836 return patch.vertices[0];
840 const double stepsize = 1. / n_subdivisions;
873 template <
int dim,
int spacedim>
886 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
892 if (
patch.points_are_available)
895 for (
unsigned int d = 0;
d < spacedim; ++
d)
921 template <
int dim,
int spacedim>
922 std::tuple<unsigned int, unsigned int>
926 unsigned int n_nodes = 0;
928 for (
const auto &
patch : patches)
932 "The reference cell for this patch is set to 'Invalid', "
933 "but that is clearly not a valid choice. Did you forget "
934 "to set the reference cell for the patch?"));
936 if (
patch.reference_cell.is_hyper_cube())
938 n_nodes += Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
939 n_cells += Utilities::fixed_power<dim>(
patch.n_subdivisions);
944 n_nodes +=
patch.reference_cell.n_vertices();
949 return std::make_tuple(n_nodes, n_cells);
959 template <
int dim,
int spacedim>
960 std::tuple<unsigned int, unsigned int, unsigned int>
963 const bool write_higher_order_cells)
965 unsigned int n_nodes = 0;
969 for (
const auto &
patch : patches)
971 if (
patch.reference_cell.is_hyper_cube())
973 n_nodes += Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
975 if (write_higher_order_cells)
982 1 + Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
991 Utilities::fixed_power<dim>(
patch.n_subdivisions);
999 n_nodes +=
patch.data.n_cols();
1013 template <
typename FlagsType>
1020 StreamBase(std::ostream &stream,
const FlagsType &flags)
1032 write_point(
const unsigned int,
const Point<dim> &)
1035 ExcMessage(
"The derived class you are using needs to "
1036 "reimplement this function if you want to call "
1056 write_cell(
const unsigned int ,
1057 const unsigned int ,
1058 std::array<unsigned int, dim> & )
1061 ExcMessage(
"The derived class you are using needs to "
1062 "reimplement this function if you want to call "
1073 write_cell_single(
const unsigned int index,
1074 const unsigned int start,
1075 const unsigned int n_points,
1081 (
void)reference_cell;
1084 ExcMessage(
"The derived class you are using needs to "
1085 "reimplement this function if you want to call "
1103 template <
typename T>
1117 unsigned int selected_component;
1124 std::ostream &stream;
1135 class DXStream :
public StreamBase<DataOutBase::DXFlags>
1142 write_point(
const unsigned int index,
const Point<dim> &);
1154 write_cell(
const unsigned int index,
1155 const unsigned int start,
1156 const std::array<unsigned int, dim> &
offsets);
1164 template <
typename data>
1166 write_dataset(
const unsigned int index,
const std::vector<data> &values);
1172 class GmvStream :
public StreamBase<DataOutBase::GmvFlags>
1179 write_point(
const unsigned int index,
const Point<dim> &);
1191 write_cell(
const unsigned int index,
1192 const unsigned int start,
1193 const std::array<unsigned int, dim> &
offsets);
1199 class TecplotStream :
public StreamBase<DataOutBase::TecplotFlags>
1206 write_point(
const unsigned int index,
const Point<dim> &);
1218 write_cell(
const unsigned int index,
1219 const unsigned int start,
1220 const std::array<unsigned int, dim> &
offsets);
1226 class UcdStream :
public StreamBase<DataOutBase::UcdFlags>
1233 write_point(
const unsigned int index,
const Point<dim> &);
1247 write_cell(
const unsigned int index,
1248 const unsigned int start,
1249 const std::array<unsigned int, dim> &
offsets);
1257 template <
typename data>
1259 write_dataset(
const unsigned int index,
const std::vector<data> &values);
1265 class VtkStream :
public StreamBase<DataOutBase::VtkFlags>
1272 write_point(
const unsigned int index,
const Point<dim> &);
1284 write_cell(
const unsigned int index,
1285 const unsigned int start,
1286 const std::array<unsigned int, dim> &
offsets);
1292 write_cell_single(
const unsigned int index,
1293 const unsigned int start,
1294 const unsigned int n_points,
1307 const std::vector<unsigned> &connectivity);
1320 DXStream::write_point(
const unsigned int,
const Point<dim> &p)
1322 if (flags.coordinates_binary)
1325 for (
unsigned int d = 0;
d < dim; ++
d)
1327 stream.write(
reinterpret_cast<const char *
>(
data), dim *
sizeof(*
data));
1331 for (
unsigned int d = 0;
d < dim; ++
d)
1332 stream << p[d] <<
'\t';
1346 std::array<unsigned int, GeometryInfo<0>::vertices_per_cell>
1348 const std::array<unsigned int, 0> & )
1356 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell>
1358 const std::array<unsigned int, 1> &
offsets)
1360 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell>
nodes;
1368 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>
1370 const std::array<unsigned int, 2> &
offsets)
1376 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>
nodes;
1386 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell>
1388 const std::array<unsigned int, 3> &
offsets)
1394 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell>
nodes;
1411 DXStream::write_cell(
const unsigned int,
1412 const unsigned int start,
1413 const std::array<unsigned int, dim> &
offsets)
1416 DataOutBaseImplementation::set_node_numbers(start,
offsets);
1418 if (flags.int_binary)
1420 std::array<unsigned int, GeometryInfo<dim>::vertices_per_cell>
temp;
1421 for (
unsigned int i = 0; i <
nodes.size(); ++i)
1423 stream.write(
reinterpret_cast<const char *
>(
temp.data()),
1428 for (
unsigned int i = 0; i <
nodes.size() - 1; ++i)
1437 template <
typename data>
1439 DXStream::write_dataset(
const unsigned int,
const std::vector<data> &values)
1441 if (flags.data_binary)
1443 stream.write(
reinterpret_cast<const char *
>(
values.data()),
1448 for (
unsigned int i = 0; i <
values.size(); ++i)
1449 stream <<
'\t' << values[i];
1465 GmvStream::write_point(
const unsigned int,
const Point<dim> &p)
1469 stream << p[selected_component] <<
' ';
1476 GmvStream::write_cell(
const unsigned int,
1477 const unsigned int s,
1478 const std::array<unsigned int, dim> &
offsets)
1481 const unsigned int start = s + 1;
1496 stream <<
'\t' << start +
d1;
1505 stream <<
'\t' << start +
d1;
1506 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1516 stream <<
'\t' << start +
d1;
1517 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1518 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1519 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1531 TecplotStream::TecplotStream(std::ostream &out,
1539 TecplotStream::write_point(
const unsigned int,
const Point<dim> &p)
1543 stream << p[selected_component] <<
'\n';
1550 TecplotStream::write_cell(
const unsigned int,
1551 const unsigned int s,
1552 const std::array<unsigned int, dim> &
offsets)
1554 const unsigned int start = s + 1;
1568 stream <<
'\t' << start +
d1;
1577 stream <<
'\t' << start +
d1;
1578 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1588 stream <<
'\t' << start +
d1;
1589 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1590 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1591 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1610 UcdStream::write_point(
const unsigned int index,
const Point<dim> &p)
1612 stream <<
index + 1 <<
" ";
1614 for (
unsigned int i = 0; i < dim; ++i)
1615 stream << p[i] <<
' ';
1617 for (
unsigned int i = dim; i < 3; ++i)
1626 UcdStream::write_cell(
const unsigned int index,
1627 const unsigned int start,
1628 const std::array<unsigned int, dim> &
offsets)
1631 DataOutBaseImplementation::set_node_numbers(start,
offsets);
1635 for (
unsigned int i = 0; i <
nodes.size(); ++i)
1642 template <
typename data>
1644 UcdStream::write_dataset(
const unsigned int index,
1645 const std::vector<data> &values)
1647 stream <<
index + 1;
1648 for (
unsigned int i = 0; i <
values.size(); ++i)
1649 stream <<
'\t' << values[i];
1664 VtkStream::write_point(
const unsigned int,
const Point<dim> &p)
1669 for (
unsigned int i = dim; i < 3; ++i)
1678 VtkStream::write_cell(
const unsigned int,
1679 const unsigned int start,
1680 const std::array<unsigned int, dim> &
offsets)
1696 stream <<
'\t' << start +
d1;
1705 stream <<
'\t' << start +
d1;
1706 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1716 stream <<
'\t' << start +
d1;
1717 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1718 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1719 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1732 VtkStream::write_cell_single(
const unsigned int index,
1733 const unsigned int start,
1734 const unsigned int n_points,
1739 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
1741 stream <<
'\t' << n_points;
1742 for (
unsigned int i = 0; i < n_points; ++i)
1751 VtkStream::write_high_order_cell(
const unsigned int start,
1752 const std::vector<unsigned> &connectivity)
1754 stream << connectivity.size();
1755 for (
const auto &c : connectivity)
1756 stream <<
'\t' << start + c;
1768 template <
int dim,
int spacedim>
1772 template <
int dim,
int spacedim>
1776 template <
int dim,
int spacedim>
1778 : patch_index(no_neighbor)
1780 , points_are_available(
false)
1794 template <
int dim,
int spacedim>
1798 if (reference_cell !=
patch.reference_cell)
1802 const double epsilon = 3e-16;
1804 if (vertices[i].distance(
patch.vertices[i]) > epsilon)
1808 if (neighbors[i] !=
patch.neighbors[i])
1811 if (patch_index !=
patch.patch_index)
1814 if (n_subdivisions !=
patch.n_subdivisions)
1817 if (points_are_available !=
patch.points_are_available)
1820 if (
data.n_rows() !=
patch.data.n_rows())
1823 if (
data.n_cols() !=
patch.data.n_cols())
1826 for (
unsigned int i = 0; i <
data.n_rows(); ++i)
1827 for (
unsigned int j = 0;
j <
data.n_cols(); ++
j)
1836 template <
int dim,
int spacedim>
1840 return (
sizeof(vertices) /
sizeof(vertices[0]) *
1842 sizeof(neighbors) /
sizeof(neighbors[0]) *
1848 sizeof(reference_cell));
1853 template <
int dim,
int spacedim>
1860 std::swap(n_subdivisions,
other_patch.n_subdivisions);
1862 std::swap(points_are_available,
other_patch.points_are_available);
1863 std::swap(reference_cell,
other_patch.reference_cell);
1868 template <
int spacedim>
1872 template <
int spacedim>
1876 template <
int spacedim>
1880 template <
int spacedim>
1883 template <
int spacedim>
1887 template <
int spacedim>
1889 : patch_index(no_neighbor)
1890 , points_are_available(
false)
1897 template <
int spacedim>
1901 const unsigned int dim = 0;
1904 const double epsilon = 3e-16;
1906 if (vertices[i].distance(
patch.vertices[i]) > epsilon)
1909 if (patch_index !=
patch.patch_index)
1912 if (points_are_available !=
patch.points_are_available)
1915 if (
data.n_rows() !=
patch.data.n_rows())
1918 if (
data.n_cols() !=
patch.data.n_cols())
1921 for (
unsigned int i = 0; i <
data.n_rows(); ++i)
1922 for (
unsigned int j = 0;
j <
data.n_cols(); ++
j)
1931 template <
int spacedim>
1935 return (
sizeof(vertices) /
sizeof(vertices[0]) *
1943 template <
int spacedim>
1950 std::swap(points_are_available,
other_patch.points_are_available);
1956 : write_preamble(write_preamble)
1971 : space_dimension_labels(
labels)
1985 const bool bicubic_patch,
1986 const bool external_data)
1988 , bicubic_patch(bicubic_patch)
1989 , external_data(external_data)
1994 const bool xdmf_hdf5_output)
1995 : filter_duplicate_vertices(filter_duplicate_vertices)
1996 , xdmf_hdf5_output(xdmf_hdf5_output)
2004 "Filter duplicate vertices",
2007 "Whether to remove duplicate vertex values. deal.II duplicates "
2008 "vertices once for each adjacent cell so that it can output "
2009 "discontinuous quantities for which there may be more than one "
2010 "value for each vertex position. Setting this flag to "
2011 "'true' will merge all of these values by selecting a "
2012 "random one and outputting this as 'the' value for the vertex. "
2013 "As long as the data to be output corresponds to continuous "
2014 "fields, merging vertices has no effect. On the other hand, "
2015 "if the data to be output corresponds to discontinuous fields "
2016 "(either because you are using a discontinuous finite element, "
2017 "or because you are using a DataPostprocessor that yields "
2018 "discontinuous data, or because the data to be output has been "
2019 "produced by entirely different means), then the data in the "
2020 "output file no longer faithfully represents the underlying data "
2021 "because the discontinuous field has been replaced by a "
2022 "continuous one. Note also that the filtering can not occur "
2023 "on processor boundaries. Thus, a filtered discontinuous field "
2024 "looks like a continuous field inside of a subdomain, "
2025 "but like a discontinuous field at the subdomain boundary."
2027 "In any case, filtering results in drastically smaller output "
2028 "files (smaller by about a factor of 2^dim).");
2033 "Whether the data will be used in an XDMF/HDF5 combination.");
2048 const bool int_binary,
2049 const bool coordinates_binary,
2050 const bool data_binary)
2051 : write_neighbors(write_neighbors)
2052 , int_binary(int_binary)
2053 , coordinates_binary(coordinates_binary)
2054 , data_binary(data_binary)
2055 , data_double(
false)
2065 "A boolean field indicating whether neighborship "
2066 "information between cells is to be written to the "
2067 "OpenDX output file");
2071 "Output format of integer numbers, which is "
2072 "either a text representation (ascii) or binary integer "
2073 "values of 32 or 64 bits length");
2077 "Output format of vertex coordinates, which is "
2078 "either a text representation (ascii) or binary "
2079 "floating point values of 32 or 64 bits length");
2083 "Output format of data values, which is "
2084 "either a text representation (ascii) or binary "
2085 "floating point values of 32 or 64 bits length");
2105 "A flag indicating whether a comment should be "
2106 "written to the beginning of the output file "
2107 "indicating date and time of creation as well "
2108 "as the creating program");
2122 const int azimuth_angle,
2123 const int polar_angle,
2124 const unsigned int line_thickness,
2126 const bool draw_colorbar)
2129 , height_vector(height_vector)
2130 , azimuth_angle(azimuth_angle)
2131 , polar_angle(polar_angle)
2132 , line_thickness(line_thickness)
2134 , draw_colorbar(draw_colorbar)
2145 "A flag indicating whether POVRAY should use smoothed "
2146 "triangles instead of the usual ones");
2150 "Whether POVRAY should use bicubic patches");
2154 "Whether camera and lighting information should "
2155 "be put into an external file \"data.inc\" or into "
2156 "the POVRAY input file");
2172 const unsigned int color_vector,
2174 const unsigned int size,
2175 const double line_width,
2176 const double azimut_angle,
2177 const double turn_angle,
2178 const double z_scaling,
2179 const bool draw_mesh,
2180 const bool draw_cells,
2181 const bool shade_cells,
2183 : height_vector(height_vector)
2184 , color_vector(color_vector)
2185 , size_type(size_type)
2187 , line_width(line_width)
2188 , azimut_angle(azimut_angle)
2189 , turn_angle(turn_angle)
2190 , z_scaling(z_scaling)
2191 , draw_mesh(draw_mesh)
2192 , draw_cells(draw_cells)
2193 , shade_cells(shade_cells)
2194 , color_function(color_function)
2244 else if (
x < (
sum22) / 4)
2246 else if (
x < (
sum13) / 4)
2319 "Number of the input vector that is to be used to "
2320 "generate height information");
2324 "Number of the input vector that is to be used to "
2325 "generate color information");
2329 "Whether width or height should be scaled to match "
2334 "The size (width or height) to which the eps output "
2335 "file is to be scaled");
2339 "The width in which the postscript renderer is to "
2344 "Angle of the viewing position against the vertical "
2349 "Angle of the viewing direction against the y-axis");
2353 "Scaling for the z-direction relative to the scaling "
2354 "used in x- and y-directions");
2358 "Whether the mesh lines, or only the surface should be "
2363 "Whether only the mesh lines, or also the interior of "
2364 "cells should be plotted. If this flag is false, then "
2365 "one can see through the mesh");
2369 "Whether the interior of cells shall be shaded");
2373 "default|grey scale|reverse grey scale"),
2374 "Name of a color function used to colorize mesh lines "
2375 "and/or cell interiors");
2385 if (prm.
get(
"Scale to width or height") ==
"width")
2397 if (prm.
get(
"Color function") ==
"default")
2399 else if (prm.
get(
"Color function") ==
"grey scale")
2401 else if (prm.
get(
"Color function") ==
"reverse grey scale")
2411 : compression_level(compression_level)
2416 : zone_name(zone_name)
2417 , solution_time(solution_time)
2431 const unsigned int cycle,
2432 const bool print_date_and_time,
2434 const bool write_higher_order_cells,
2435 const std::map<std::string, std::string> &physical_units)
2438 , print_date_and_time(print_date_and_time)
2439 , compression_level(compression_level)
2440 , write_higher_order_cells(write_higher_order_cells)
2441 , physical_units(physical_units)
2486 ExcMessage(
"The given file format name is not recognized: <" +
2498 return "none|dx|ucd|gnuplot|povray|eps|gmv|tecplot|vtk|vtu|hdf5|svg|deal.II intermediate";
2548 template <
int dim,
int spacedim>
2549 std::vector<Point<spacedim>>
2553 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
2556 for (
const auto &
patch : patches)
2559 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2571 const unsigned int n_subdivisions =
patch.n_subdivisions;
2572 const unsigned int n = n_subdivisions + 1;
2581 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2586 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
2587 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2592 for (
unsigned int i3 = 0;
i3 < n; ++
i3)
2593 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
2594 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2609 template <
int dim,
int spacedim,
typename StreamType>
2626 template <
int dim,
int spacedim,
typename StreamType>
2631 unsigned int count = 0;
2633 for (
const auto &
patch : patches)
2636 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2638 out.write_cell_single(
count++,
2640 patch.data.n_cols(),
2641 patch.reference_cell);
2646 const unsigned int n_subdivisions =
patch.n_subdivisions;
2647 const unsigned int n = n_subdivisions + 1;
2660 constexpr unsigned int d1 = 1;
2662 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2664 const unsigned int offset =
2674 constexpr unsigned int d1 = 1;
2675 const unsigned int d2 = n;
2677 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
2678 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2680 const unsigned int offset =
2692 constexpr unsigned int d1 = 1;
2693 const unsigned int d2 = n;
2694 const unsigned int d3 = n * n;
2696 for (
unsigned int i3 = 0;
i3 < n_subdivisions; ++
i3)
2697 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
2698 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2716 Utilities::fixed_power<dim>(n_subdivisions + 1);
2725 template <
int dim,
int spacedim,
typename StreamType>
2734 std::vector<unsigned> connectivity;
2736 for (
const auto &
patch : patches)
2738 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2740 connectivity.resize(
patch.data.n_cols());
2742 for (
unsigned int i = 0; i <
patch.data.n_cols(); ++i)
2743 connectivity[i] = i;
2752 const unsigned int n_subdivisions =
patch.n_subdivisions;
2753 const unsigned int n = n_subdivisions + 1;
2755 connectivity.resize(Utilities::fixed_power<dim>(n));
2762 ExcMessage(
"Point-like cells should not be possible "
2763 "when writing higher-order cells."));
2768 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2772 patch.reference_cell
2782 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1; ++
i2)
2783 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2787 patch.reference_cell
2790 {{n_subdivisions, n_subdivisions}},
2799 for (
unsigned int i3 = 0;
i3 < n_subdivisions + 1; ++
i3)
2800 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1; ++
i2)
2801 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2804 i3 * n * n +
i2 * n +
i1;
2806 patch.reference_cell
2836 template <
int dim,
int spacedim,
typename StreamType>
2839 unsigned int n_data_sets,
2844 unsigned int count = 0;
2846 for (
const auto &
patch : patches)
2848 const unsigned int n_subdivisions =
patch.n_subdivisions;
2849 const unsigned int n = n_subdivisions + 1;
2852 !
patch.points_are_available) ||
2853 (
patch.data.n_rows() == n_data_sets + spacedim &&
2854 patch.points_are_available),
2856 (n_data_sets + spacedim) :
2859 Assert(
patch.data.n_cols() == Utilities::fixed_power<dim>(n),
2862 std::vector<float>
floats(n_data_sets);
2863 std::vector<double>
doubles(n_data_sets);
2962 for (
int i = 0; i < 2; ++i)
2964 for (
int j = 0;
j < 2 - i; ++
j)
2966 if (points[
j][2] > points[
j + 1][2])
2969 points[
j] = points[
j + 1];
2970 points[
j + 1] =
temp;
3002 double temp = A[1][0];
3007 for (
unsigned int k = 0;
k < 1; ++
k)
3009 for (
unsigned int i =
k + 1; i < 2; ++i)
3011 x = A[i][
k] / A[
k][
k];
3013 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3014 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3016 b[i] = b[i] - b[
k] *
x;
3020 b[1] =
b[1] /
A[1][1];
3022 for (
int i = 0; i >= 0; i--)
3026 for (
unsigned int j = i + 1;
j < 2; ++
j)
3027 sum = sum - A[i][
j] * b[
j];
3029 b[i] = sum / A[i][i];
3048 b[0] = 1.0 -
v_min[0];
3060 double temp = A[1][0];
3065 for (
unsigned int k = 0;
k < 1; ++
k)
3067 for (
unsigned int i =
k + 1; i < 2; ++i)
3069 x = A[i][
k] / A[
k][
k];
3071 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3072 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3074 b[i] = b[i] - b[
k] *
x;
3078 b[1] =
b[1] /
A[1][1];
3080 for (
int i = 0; i >= 0; i--)
3084 for (
unsigned int j = i + 1;
j < 2; ++
j)
3085 sum = sum - A[i][
j] * b[
j];
3087 b[i] = sum / A[i][i];
3107 b[1] = 1.0 -
v_min[1];
3118 double temp = A[1][0];
3123 for (
unsigned int k = 0;
k < 1; ++
k)
3125 for (
unsigned int i =
k + 1; i < 2; ++i)
3129 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3130 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3132 b[i] =
b[i] -
b[
k] *
x;
3136 b[1] =
b[1] /
A[1][1];
3138 for (
int i = 0; i >= 0; i--)
3142 for (
unsigned int j = i + 1;
j < 2; ++
j)
3143 sum = sum - A[i][
j] * b[
j];
3145 b[i] =
sum /
A[i][i];
3181 template <
int dim,
int spacedim>
3187 std::tuple<
unsigned int,
3200#ifndef DEAL_II_WITH_MPI
3209 if (patches.empty())
3213 const unsigned int n_data_sets =
data_names.size();
3215 UcdStream
ucd_out(out, flags);
3218 unsigned int n_nodes;
3219 unsigned int n_cells;
3226 <<
"# This file was generated by the deal.II library." <<
'\n'
3230 <<
"# For a description of the UCD format see the AVS Developer's guide."
3236 out << n_nodes <<
' ' << n_cells <<
' ' << n_data_sets <<
' ' << 0
3249 if (n_data_sets != 0)
3251 out << n_data_sets <<
" ";
3252 for (
unsigned int i = 0; i < n_data_sets; ++i)
3272 template <
int dim,
int spacedim>
3278 std::tuple<
unsigned int,
3290#ifndef DEAL_II_WITH_MPI
3299 if (patches.empty())
3303 DXStream
dx_out(out, flags);
3306 unsigned int offset = 0;
3308 const unsigned int n_data_sets =
data_names.size();
3311 unsigned int n_nodes;
3312 unsigned int n_cells;
3316 out <<
"object \"vertices\" class array type float rank 1 shape "
3317 << spacedim <<
" items " << n_nodes;
3321 out <<
" lsb ieee data 0" <<
'\n';
3322 offset += n_nodes * spacedim *
sizeof(float);
3326 out <<
" data follows" <<
'\n';
3335 out <<
"object \"cells\" class array type int rank 1 shape "
3340 out <<
" lsb binary data " << offset <<
'\n';
3341 offset += n_cells *
sizeof(
int);
3345 out <<
" data follows" <<
'\n';
3351 out <<
"attribute \"element type\" string \"";
3358 out <<
"\"" <<
'\n' <<
"attribute \"ref\" string \"positions\"" <<
'\n';
3365 out <<
"object \"neighbors\" class array type int rank 1 shape "
3369 for (
const auto &
patch : patches)
3371 const unsigned int n =
patch.n_subdivisions;
3372 const unsigned int n1 = (dim > 0) ? n : 1;
3373 const unsigned int n2 = (dim > 1) ? n : 1;
3374 const unsigned int n3 = (dim > 2) ? n : 1;
3375 const unsigned int x_minus = (dim > 0) ? 0 : 0;
3376 const unsigned int x_plus = (dim > 0) ? 1 : 0;
3377 const unsigned int y_minus = (dim > 1) ? 2 : 0;
3378 const unsigned int y_plus = (dim > 1) ? 3 : 0;
3379 const unsigned int z_minus = (dim > 2) ? 4 : 0;
3380 const unsigned int z_plus = (dim > 2) ? 5 : 0;
3382 unsigned int dx = 1;
3383 unsigned int dy = n;
3384 unsigned int dz = n * n;
3389 for (
unsigned int i3 = 0;
i3 <
n3; ++
i3)
3390 for (
unsigned int i2 = 0;
i2 <
n2; ++
i2)
3391 for (
unsigned int i1 = 0;
i1 <
n1; ++
i1)
3393 const unsigned int nx =
i1 *
dx;
3394 const unsigned int ny =
i2 * dy;
3395 const unsigned int nz =
i3 *
dz;
3502 if (n_data_sets != 0)
3504 out <<
"object \"data\" class array type float rank 1 shape "
3505 << n_data_sets <<
" items " << n_nodes;
3509 out <<
" lsb ieee data " << offset <<
'\n';
3510 offset += n_data_sets * n_nodes *
3511 ((flags.
data_double) ?
sizeof(
double) :
sizeof(float));
3515 out <<
" data follows" <<
'\n';
3520 out <<
"attribute \"dep\" string \"positions\"" <<
'\n';
3524 out <<
"object \"data\" class constantarray type float rank 0 items "
3525 << n_nodes <<
" data follows" <<
'\n'
3531 out <<
"object \"deal data\" class field" <<
'\n'
3532 <<
"component \"positions\" value \"vertices\"" <<
'\n'
3533 <<
"component \"connections\" value \"cells\"" <<
'\n'
3534 <<
"component \"data\" value \"data\"" <<
'\n';
3537 out <<
"component \"neighbors\" value \"neighbors\"" <<
'\n';
3544 out <<
"end" <<
'\n';
3562 template <
int dim,
int spacedim>
3568 std::tuple<
unsigned int,
3577#ifndef DEAL_II_WITH_MPI
3587 if (patches.empty())
3591 const unsigned int n_data_sets =
data_names.size();
3595 out <<
"# This file was generated by the deal.II library." <<
'\n'
3599 <<
"# For a description of the GNUPLOT format see the GNUPLOT manual."
3618 for (
const auto &
patch : patches)
3620 const unsigned int n_subdivisions =
patch.n_subdivisions;
3624 !
patch.points_are_available) ||
3625 (
patch.data.n_rows() == n_data_sets + spacedim &&
3626 patch.points_are_available),
3628 (n_data_sets + spacedim) :
3630 patch.data.n_rows()));
3646 n_subdivisions + 1));
3665 n_subdivisions + 1));
3686 Assert(
patch.data.n_cols() == Utilities::fixed_power<dim>(
3689 n_subdivisions + 1));
3761 Assert(
patch.data.n_cols() == Utilities::fixed_power<dim>(
3764 n_subdivisions + 1));
3781 if (
i1 < n_subdivisions)
3804 out <<
'\n' <<
'\n';
3808 if (
i2 < n_subdivisions)
3831 out <<
'\n' <<
'\n';
3835 if (
i3 < n_subdivisions)
3857 out <<
'\n' <<
'\n';
3866 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
3874 for (
const unsigned int v : {3, 1})
3887 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
3895 for (
const unsigned int v : {2, 4, 3})
3912 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
3920 for (
const unsigned int v : {1, 4})
3928 for (
const unsigned int v : {2, 5})
3956 template <
int dim,
int spacedim>
3959 const std::vector<std::string> &,
3960 const PovrayFlags &,
3964 ExcMessage(
"Writing files in POVRAY format is only supported "
3965 "for two-dimensional meshes."));
3973 const PovrayFlags &flags,
3978#ifndef DEAL_II_WITH_MPI
3987 if (patches.empty())
3990 constexpr int dim = 2;
3992 constexpr int spacedim = 2;
3994 const unsigned int n_data_sets =
data_names.size();
4000 <<
"/* This file was generated by the deal.II library." <<
'\n'
4004 <<
" For a description of the POVRAY format see the POVRAY manual."
4009 out <<
"#include \"colors.inc\" " <<
'\n'
4010 <<
"#include \"textures.inc\" " <<
'\n';
4014 if (flags.external_data)
4015 out <<
"#include \"data.inc\" " <<
'\n';
4021 <<
"camera {" <<
'\n'
4022 <<
" location <1,4,-7>" <<
'\n'
4023 <<
" look_at <0,0,0>" <<
'\n'
4024 <<
" angle 30" <<
'\n'
4029 <<
"light_source {" <<
'\n'
4030 <<
" <1,4,-7>" <<
'\n'
4031 <<
" color Grey" <<
'\n'
4034 <<
"light_source {" <<
'\n'
4035 <<
" <0,20,0>" <<
'\n'
4036 <<
" color White" <<
'\n'
4043 double hmin = patches[0].data(0, 0);
4044 double hmax = patches[0].data(0, 0);
4046 for (
const auto &
patch : patches)
4048 const unsigned int n_subdivisions =
patch.n_subdivisions;
4051 !
patch.points_are_available) ||
4052 (
patch.data.n_rows() == n_data_sets + spacedim &&
4053 patch.points_are_available),
4055 (n_data_sets + spacedim) :
4059 Utilities::fixed_power<dim>(n_subdivisions + 1),
4061 n_subdivisions + 1));
4063 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
4064 for (
unsigned int j = 0;
j < n_subdivisions + 1; ++
j)
4066 const int dl = i * (n_subdivisions + 1) +
j;
4074 out <<
"#declare HMIN=" <<
hmin <<
";" <<
'\n'
4075 <<
"#declare HMAX=" <<
hmax <<
";" <<
'\n'
4078 if (!flags.external_data)
4081 out <<
"#declare Tex=texture{" <<
'\n'
4082 <<
" pigment {" <<
'\n'
4083 <<
" gradient y" <<
'\n'
4084 <<
" scale y*(HMAX-HMIN)*" << 0.1 <<
'\n'
4085 <<
" color_map {" <<
'\n'
4086 <<
" [0.00 color Light_Purple] " <<
'\n'
4087 <<
" [0.95 color Light_Purple] " <<
'\n'
4088 <<
" [1.00 color White] " <<
'\n'
4093 if (!flags.bicubic_patch)
4096 out <<
'\n' <<
"mesh {" <<
'\n';
4100 for (
const auto &
patch : patches)
4102 const unsigned int n_subdivisions =
patch.n_subdivisions;
4103 const unsigned int n = n_subdivisions + 1;
4104 const unsigned int d1 = 1;
4105 const unsigned int d2 = n;
4108 !
patch.points_are_available) ||
4109 (
patch.data.n_rows() == n_data_sets + spacedim &&
4110 patch.points_are_available),
4112 (n_data_sets + spacedim) :
4115 Assert(
patch.data.n_cols() == Utilities::fixed_power<dim>(n),
4117 n_subdivisions + 1));
4120 std::vector<Point<spacedim>>
ver(n * n);
4122 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
4123 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
4131 if (!flags.bicubic_patch)
4134 std::vector<Point<3>>
nrml;
4144 for (
unsigned int i = 0; i < n; ++i)
4145 for (
unsigned int j = 0;
j < n; ++
j)
4147 const unsigned int il = (i == 0) ? i : (i - 1);
4148 const unsigned int ir =
4149 (i == n_subdivisions) ? i : (i + 1);
4150 const unsigned int jl = (
j == 0) ?
j : (
j - 1);
4151 const unsigned int jr =
4152 (
j == n_subdivisions) ?
j : (
j + 1);
4183 for (
unsigned int k = 0;
k < 3; ++
k)
4189 for (
unsigned int i = 0; i < n_subdivisions; ++i)
4190 for (
unsigned int j = 0;
j < n_subdivisions; ++
j)
4193 const int dl = i *
d1 +
j *
d2;
4199 out <<
"smooth_triangle {" <<
'\n'
4204 out <<
" \t<" <<
ver[
dl +
d1][0] <<
","
4206 <<
">, <" <<
nrml[
dl +
d1][0] <<
", "
4209 out <<
"\t<" <<
ver[
dl +
d1 +
d2][0] <<
","
4217 out <<
"smooth_triangle {" <<
'\n'
4222 out <<
"\t<" <<
ver[
dl +
d1 +
d2][0] <<
","
4228 out <<
"\t<" <<
ver[
dl +
d2][0] <<
","
4230 <<
">, <" <<
nrml[
dl +
d2][0] <<
", "
4237 out <<
"triangle {" <<
'\n'
4239 <<
"," <<
ver[
dl][1] <<
">," <<
'\n';
4240 out <<
"\t<" <<
ver[
dl +
d1][0] <<
","
4243 out <<
"\t<" <<
ver[
dl +
d1 +
d2][0] <<
","
4245 <<
ver[
dl +
d1 +
d2][1] <<
">}" <<
'\n';
4248 out <<
"triangle {" <<
'\n'
4250 <<
"," <<
ver[
dl][1] <<
">," <<
'\n';
4251 out <<
"\t<" <<
ver[
dl +
d1 +
d2][0] <<
","
4253 <<
ver[
dl +
d1 +
d2][1] <<
">," <<
'\n';
4254 out <<
"\t<" <<
ver[
dl +
d2][0] <<
","
4263 Assert(n_subdivisions == 3,
4266 <<
"bicubic_patch {" <<
'\n'
4267 <<
" type 0" <<
'\n'
4268 <<
" flatness 0" <<
'\n'
4269 <<
" u_steps 0" <<
'\n'
4270 <<
" v_steps 0" <<
'\n';
4271 for (
int i = 0; i < 16; ++i)
4273 out <<
"\t<" <<
ver[i][0] <<
"," <<
patch.data(0, i) <<
","
4274 <<
ver[i][1] <<
">";
4279 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n';
4283 if (!flags.bicubic_patch)
4286 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n' <<
'\n';
4298 template <
int dim,
int spacedim>
4304 std::tuple<
unsigned int,
4316 template <
int dim,
int spacedim>
4320 const std::vector<std::string> & ,
4322 std::tuple<
unsigned int,
4334 template <
int spacedim>
4338 const std::vector<std::string> & ,
4340 std::tuple<
unsigned int,
4349#ifndef DEAL_II_WITH_MPI
4358 if (patches.empty())
4368 std::multiset<EpsCell2d> cells;
4377 double heights[4] = {0, 0, 0, 0};
4381 for (
const auto &
patch : patches)
4383 const unsigned int n_subdivisions =
patch.n_subdivisions;
4384 const unsigned int n = n_subdivisions + 1;
4385 const unsigned int d1 = 1;
4386 const unsigned int d2 = n;
4388 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
4389 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
4406 patch.data.n_rows() == 0,
4409 patch.data.n_rows()));
4411 patch.data.n_rows() != 0 ?
4434 for (
unsigned int i = 0; i < 4; ++i)
4460 for (
unsigned int vertex = 0; vertex < 4; ++vertex)
4462 const double x = points[vertex][0],
y = points[vertex][1],
4491 (points[0] + points[1] + points[2] + points[3]) / 4;
4502 patch.data.n_rows() == 0,
4505 patch.data.n_rows()));
4507 patch.data.n_rows() != 0 ?
4511 patch.data.n_rows() != 0 ?
4515 patch.data.n_rows() != 0 ?
4519 patch.data.n_rows() != 0 ?
4543 double x_min = cells.begin()->vertices[0][0];
4545 double y_min = cells.begin()->vertices[0][1];
4548 for (
const auto &cell : cells)
4549 for (
const auto &vertex : cell.vertices)
4559 const double scale =
4568 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4569 <<
"%%Title: deal.II Output" <<
'\n'
4570 <<
"%%Creator: the deal.II library" <<
'\n'
4573 <<
"%%BoundingBox: "
4577 <<
static_cast<unsigned int>((
x_max -
x_min) * scale + 0.5) <<
' '
4578 <<
static_cast<unsigned int>((
y_max -
y_min) * scale + 0.5) <<
'\n';
4587 out <<
"/m {moveto} bind def" <<
'\n'
4588 <<
"/l {lineto} bind def" <<
'\n'
4589 <<
"/s {setrgbcolor} bind def" <<
'\n'
4590 <<
"/sg {setgray} bind def" <<
'\n'
4591 <<
"/lx {lineto closepath stroke} bind def" <<
'\n'
4592 <<
"/lf {lineto closepath fill} bind def" <<
'\n';
4594 out <<
"%%EndProlog" <<
'\n' <<
'\n';
4596 out << flags.
line_width <<
" setlinewidth" <<
'\n';
4609 for (
const auto &cell : cells)
4630 out << (cell.vertices[0] - offset) * scale <<
" m "
4631 << (cell.vertices[1] - offset) * scale <<
" l "
4632 << (cell.vertices[3] - offset) * scale <<
" l "
4633 << (cell.vertices[2] - offset) * scale <<
" lf" <<
'\n';
4638 << (cell.vertices[0] - offset) * scale <<
" m "
4639 << (cell.vertices[1] - offset) * scale <<
" l "
4640 << (cell.vertices[3] - offset) * scale <<
" l "
4641 << (cell.vertices[2] - offset) * scale <<
" lx" <<
'\n';
4643 out <<
"showpage" <<
'\n';
4652 template <
int dim,
int spacedim>
4658 std::tuple<
unsigned int,
4674#ifndef DEAL_II_WITH_MPI
4683 if (patches.empty())
4687 GmvStream
gmv_out(out, flags);
4688 const unsigned int n_data_sets =
data_names.size();
4691 Assert((patches[0].
data.n_rows() == n_data_sets &&
4692 !patches[0].points_are_available) ||
4693 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4694 patches[0].points_are_available),
4696 (n_data_sets + spacedim) :
4698 patches[0].data.n_rows()));
4702 out <<
"gmvinput ascii" <<
'\n' <<
'\n';
4705 unsigned int n_nodes;
4706 unsigned int n_cells;
4728 out <<
"nodes " << n_nodes <<
'\n';
4729 for (
unsigned int d = 0; d < spacedim; ++d)
4731 gmv_out.selected_component = d;
4737 for (
unsigned int d = spacedim; d < 3; ++d)
4739 for (
unsigned int i = 0; i < n_nodes; ++i)
4746 out <<
"cells " << n_cells <<
'\n';
4751 out <<
"variable" <<
'\n';
4764 std::ostream_iterator<double>(out,
" "));
4765 out <<
'\n' <<
'\n';
4771 out <<
"endvars" <<
'\n';
4774 out <<
"endgmv" <<
'\n';
4785 template <
int dim,
int spacedim>
4791 std::tuple<
unsigned int,
4805#ifndef DEAL_II_WITH_MPI
4814 if (patches.empty())
4820 const unsigned int n_data_sets =
data_names.size();
4823 Assert((patches[0].
data.n_rows() == n_data_sets &&
4824 !patches[0].points_are_available) ||
4825 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4826 patches[0].points_are_available),
4828 (n_data_sets + spacedim) :
4830 patches[0].data.n_rows()));
4833 unsigned int n_nodes;
4834 unsigned int n_cells;
4841 <<
"# This file was generated by the deal.II library." <<
'\n'
4845 <<
"# For a description of the Tecplot format see the Tecplot documentation."
4850 out <<
"Variables=";
4858 out <<
"\"x\", \"y\"";
4861 out <<
"\"x\", \"y\", \"z\"";
4874 out <<
"t=\"" << flags.
zone_name <<
"\" ";
4877 out <<
"strandid=1, solutiontime=" << flags.
solution_time <<
", ";
4879 out <<
"f=feblock, n=" << n_nodes <<
", e=" << n_cells
4903 for (
unsigned int d = 0; d < spacedim; ++d)
4923 std::ostream_iterator<double>(out,
"\n"));
4938 template <
int dim,
int spacedim>
4944 std::tuple<
unsigned int,
4948 &nonscalar_data_ranges,
4954#ifndef DEAL_II_WITH_MPI
4963 if (patches.empty())
4967 VtkStream
vtk_out(out, flags);
4969 const unsigned int n_data_sets =
data_names.size();
4971 if (patches[0].points_are_available)
4983 out <<
"# vtk DataFile Version 3.0" <<
'\n'
4984 <<
"#This file was generated by the deal.II library";
4992 out <<
'\n' <<
"ASCII" <<
'\n';
4994 out <<
"DATASET UNSTRUCTURED_GRID\n" <<
'\n';
5002 ((flags.
cycle != std::numeric_limits<unsigned int>::min() ? 1 : 0) +
5003 (flags.
time != std::numeric_limits<double>::min() ? 1 : 0));
5006 out <<
"FIELD FieldData " <<
n_metadata <<
'\n';
5008 if (flags.
cycle != std::numeric_limits<unsigned int>::min())
5010 out <<
"CYCLE 1 1 int\n" << flags.
cycle <<
'\n';
5012 if (flags.
time != std::numeric_limits<double>::min())
5014 out <<
"TIME 1 1 double\n" << flags.
time <<
'\n';
5020 unsigned int n_nodes;
5021 unsigned int n_cells;
5045 out <<
"POINTS " << n_nodes <<
" double" <<
'\n';
5058 out <<
"CELL_TYPES " << n_cells <<
'\n';
5062 for (
const auto &
patch : patches)
5082 out <<
"POINT_DATA " << n_nodes <<
'\n';
5092 "The VTK writer does not currently support outputting "
5093 "tensor data. Use the VTU writer instead."));
5107 "Can't declare a vector with more than 3 components "
5131 out <<
" double" <<
'\n';
5134 for (
unsigned int n = 0; n < n_nodes; ++n)
5172 <<
"LOOKUP_TABLE default" <<
'\n';
5175 std::ostream_iterator<double>(out,
" "));
5191 out <<
"<?xml version=\"1.0\" ?> \n";
5193 out <<
"# vtk DataFile Version 3.0" <<
'\n'
5194 <<
"#This file was generated by the deal.II library";
5205 out <<
"<VTKFile type=\"UnstructuredGrid\" version=\"2.2\"";
5207 out <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\"";
5210 out <<
" compressor=\"vtkZLibDataCompressor\"";
5211#ifdef DEAL_II_WORDS_BIGENDIAN
5212 out <<
" byte_order=\"BigEndian\"";
5214 out <<
" byte_order=\"LittleEndian\"";
5218 out <<
"<UnstructuredGrid>";
5228 out <<
" </UnstructuredGrid>\n";
5229 out <<
"</VTKFile>\n";
5234 template <
int dim,
int spacedim>
5240 std::tuple<
unsigned int,
5244 &nonscalar_data_ranges,
5256 template <
int dim,
int spacedim>
5262 std::tuple<
unsigned int,
5266 &nonscalar_data_ranges,
5280 unit.second.find(
'\"') == std::string::npos,
5282 "A physical unit you provided, <" +
unit.second +
5283 ">, contained a quotation mark character. This is not allowed."));
5286#ifndef DEAL_II_WITH_MPI
5295 if (patches.empty())
5300 out <<
"<Piece NumberOfPoints=\"0\" NumberOfCells=\"0\" >\n"
5302 <<
"<DataArray type=\"UInt8\" Name=\"types\"></DataArray>\n"
5304 <<
" <PointData Scalars=\"scalars\">\n";
5316 out <<
" <DataArray type=\"Float32\" Name=\"";
5329 out <<
"\" NumberOfComponents=\"3\"></DataArray>\n";
5336 out <<
" <DataArray type=\"Float32\" Name=\""
5340 out <<
" </PointData>\n";
5341 out <<
"</Piece>\n";
5356 ((flags.
cycle != std::numeric_limits<unsigned int>::min() ? 1 : 0) +
5357 (flags.
time != std::numeric_limits<double>::min() ? 1 : 0));
5359 out <<
"<FieldData>\n";
5361 if (flags.
cycle != std::numeric_limits<unsigned int>::min())
5364 <<
"<DataArray type=\"Float32\" Name=\"CYCLE\" NumberOfTuples=\"1\" format=\"ascii\">"
5365 << flags.
cycle <<
"</DataArray>\n";
5367 if (flags.
time != std::numeric_limits<double>::min())
5370 <<
"<DataArray type=\"Float32\" Name=\"TIME\" NumberOfTuples=\"1\" format=\"ascii\">"
5371 << flags.
time <<
"</DataArray>\n";
5375 out <<
"</FieldData>\n";
5379 const unsigned int n_data_sets =
data_names.size();
5382 if (patches[0].points_are_available)
5399 unsigned int n_nodes;
5400 unsigned int n_cells;
5401 std::tie(n_nodes, n_cells, std::ignore) =
5414 std::ostringstream
o;
5416 o <<
" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\""
5427 for (
unsigned int d = 0; d < 3; ++d)
5437 o <<
" </DataArray>\n";
5438 o <<
" </Points>\n\n";
5451 out.precision()]() {
5452 std::ostringstream
o;
5455 o <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\""
5458 std::vector<int32_t> cells;
5463 for (
const auto &
patch : patches)
5472 (
patch.reference_cell == ReferenceCells::get_simplex<dim>()) &&
5473 (
patch.n_subdivisions == 2))
5475 const unsigned int n_points =
patch.data.n_cols();
5476 Assert((dim == 2 && n_points == 6) ||
5477 (dim == 3 && n_points == 10),
5484 for (
unsigned int i = 0; i < n_points; ++i)
5489 for (
unsigned int i = 0; i < n_points; ++i)
5499 else if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
5503 const unsigned int n_points =
patch.data.n_cols();
5509 for (
unsigned int i = 0; i < n_points; ++i)
5512 patch.reference_cell.vtk_vertex_to_deal_vertex(i));
5516 for (
unsigned int i = 0; i < n_points; ++i)
5519 patch.reference_cell.vtk_vertex_to_deal_vertex(i));
5527 const unsigned int n_subdivisions =
patch.n_subdivisions;
5571 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
5584 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
5585 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
5604 for (
unsigned int i3 = 0;
i3 < n_subdivisions; ++
i3)
5605 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
5606 for (
unsigned int i1 = 0;
i1 < n_subdivisions;
5660 "Point-like cells should not be possible "
5661 "when writing higher-order cells."));
5666 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5671 patch.reference_cell
5685 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1;
5687 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5693 patch.reference_cell
5694 .template vtk_lexicographic_to_node_index<
5696 {{n_subdivisions, n_subdivisions}},
5707 for (
unsigned int i3 = 0;
i3 < n_subdivisions + 1;
5709 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1;
5711 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5719 patch.reference_cell
5720 .template vtk_lexicographic_to_node_index<
5741 Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
5754 o <<
" </DataArray>\n";
5780 std::ostringstream
o;
5782 o <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\""
5790 std::vector<unsigned int> cell_types;
5791 cell_types.reserve(n_cells);
5795 for (
const auto &
patch : patches)
5812 o <<
" </DataArray>\n";
5814 o <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\""
5821 for (
unsigned int i = 0; i < cell_types.size(); ++i)
5836 o <<
" </DataArray>\n";
5853 const auto &
range) {
5854 std::ostringstream
o;
5856 const auto first_component = std::get<0>(
range);
5858 const auto &name = std::get<2>(
range);
5860 (std::get<3>(
range) ==
5862 const unsigned int n_components = (
is_tensor ? 9 : 3);
5871 "Can't declare a tensor with more than 9 components "
5872 "in VTK/VTU format."));
5878 "Can't declare a vector with more than 3 components "
5879 "in VTK/VTU format."));
5884 o <<
" <DataArray type=\"Float32\" Name=\"";
5895 o <<
"\" NumberOfComponents=\"" << n_components <<
"\" format=\""
5915 std::vector<float>
data;
5916 data.reserve(n_nodes * n_components);
5918 for (
unsigned int n = 0; n < n_nodes; ++n)
5961 for (
unsigned int c = 0; c <
size; ++c)
5972 for (
unsigned int c = 0; c <
size; ++c)
5988 for (
unsigned int i = 0; i < 3; ++i)
5989 for (
unsigned int j = 0;
j < 3; ++
j)
5998 o <<
" </DataArray>\n";
6009 std::ostringstream
o;
6027 o <<
" </DataArray>\n";
6067 for (
const auto &
range : nonscalar_data_ranges)
6070 const auto first_component = std::get<0>(
range);
6091 out <<
"<Piece NumberOfPoints=\"" << n_nodes <<
"\" NumberOfCells=\""
6092 << n_cells <<
"\" >\n";
6093 for (
const auto &s :
mesh_tasks.return_values())
6095 out <<
" <PointData Scalars=\"scalars\">\n";
6096 for (
const auto &s :
data_tasks.return_values())
6098 out <<
" </PointData>\n";
6099 out <<
" </Piece>\n";
6116 std::tuple<
unsigned int,
6120 &nonscalar_data_ranges,
6133 unit.second.find(
'\"') == std::string::npos,
6135 "A physical unit you provided, <" +
unit.second +
6136 ">, contained a quotation mark character. This is not allowed."));
6139 const unsigned int n_data_sets =
data_names.size();
6141 out <<
"<?xml version=\"1.0\"?>\n";
6144 out <<
"#This file was generated by the deal.II library"
6149 <<
"<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
6150 out <<
" <PUnstructuredGrid GhostLevel=\"0\">\n";
6151 out <<
" <PPointData Scalars=\"scalars\">\n";
6162 const unsigned int n_components = (
is_tensor ? 9 : 3);
6171 "Can't declare a tensor with more than 9 components "
6178 "Can't declare a vector with more than 3 components "
6190 out <<
" <PDataArray type=\"Float32\" Name=\"";
6204 out <<
"\" NumberOfComponents=\"" << n_components
6205 <<
"\" format=\"ascii\"";
6232 out <<
" <PDataArray type=\"Float32\" Name=\""
6243 out <<
" </PPointData>\n";
6245 out <<
" <PPoints>\n";
6246 out <<
" <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
6247 out <<
" </PPoints>\n";
6250 out <<
" <Piece Source=\"" <<
piece_name <<
"\"/>\n";
6252 out <<
" </PUnstructuredGrid>\n";
6253 out <<
"</VTKFile>\n";
6270 out <<
"<?xml version=\"1.0\"?>\n";
6273 out <<
"#This file was generated by the deal.II library"
6278 <<
"<VTKFile type=\"Collection\" version=\"0.1\" ByteOrder=\"LittleEndian\">\n";
6279 out <<
" <Collection>\n";
6281 std::streamsize
ss = out.precision();
6286 <<
"\" group=\"\" part=\"0\" file=\"" <<
time_and_name.second
6289 out <<
" </Collection>\n";
6290 out <<
"</VTKFile>\n";
6315 const std::vector<std::vector<std::string>> &
piece_names)
6324 ExcMessage(
"piece_names should be a vector of nonempty vectors."));
6326 out <<
"!NBLOCKS " <<
nblocks <<
'\n';
6331 "piece_names should be a vector of equal sized vectors."));
6344 const std::vector<std::pair<
double, std::vector<std::string>>>
6356 "time_and_piece_names should contain nonempty vectors of filenames for every timestep."));
6359 out <<
"!TIME " <<
domain.first <<
'\n';
6361 out <<
"!NBLOCKS " <<
nblocks <<
'\n';
6366 "piece_names should be a vector of equal sized vectors."));
6376 template <
int dim,
int spacedim>
6380 const std::vector<std::string> &,
6382 std::tuple<
unsigned int,
6392 template <
int spacedim>
6396 const std::vector<std::string> & ,
6398 std::tuple<
unsigned int,
6406 const unsigned int height = flags.
height;
6407 unsigned int width = flags.
width;
6420 unsigned int n_subdivisions =
first_patch.n_subdivisions;
6421 unsigned int n = n_subdivisions + 1;
6422 const unsigned int d1 = 1;
6423 const unsigned int d2 = n;
6449 for (
const auto &
patch : patches)
6451 n_subdivisions =
patch.n_subdivisions;
6452 n = n_subdivisions + 1;
6454 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6456 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6489 patch.data.n_rows() == 0,
6492 patch.data.n_rows()));
6504 std::min<double>(
z_min,
6518 std::max<double>(
z_max,
6637 n = n_subdivisions + 1;
6667 for (
const auto &
patch : patches)
6669 n_subdivisions =
patch.n_subdivisions;
6670 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6672 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6683 patch.data.n_rows() == 0,
6686 patch.data.n_rows()));
6688 const std::array<Point<3>, 4> vertices = {
6691 patch.data.n_rows() != 0 ?
6696 patch.data.n_rows() != 0 ?
6701 patch.data.n_rows() != 0 ?
6706 patch.data.n_rows() != 0 ?
6734 static_cast<double>(
6738 static_cast<double>(
6742 static_cast<double>(
6746 static_cast<double>(
6751 static_cast<double>(
6755 static_cast<double>(
6759 static_cast<double>(
6763 static_cast<double>(
6768 static_cast<double>(
6772 static_cast<double>(
6776 static_cast<double>(
6780 static_cast<double>(
6785 static_cast<double>(
6789 static_cast<double>(
6793 static_cast<double>(
6797 static_cast<double>(
6806 std::multiset<SvgCell> cells;
6809 for (
const auto &
patch : patches)
6811 n_subdivisions =
patch.n_subdivisions;
6813 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6815 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6826 patch.data.n_rows() == 0,
6829 patch.data.n_rows()));
6835 cell.vertices[0][2] =
patch.data.n_rows() != 0 ?
6841 cell.vertices[1][2] =
patch.data.n_rows() != 0 ?
6847 cell.vertices[2][2] =
patch.data.n_rows() != 0 ?
6853 cell.vertices[3][2] =
6854 patch.data.n_rows() != 0 ?
6858 cell.projected_vertices[0] =
6864 cell.projected_vertices[1] =
6870 cell.projected_vertices[2] =
6876 cell.projected_vertices[3] =
6883 cell.center = .25 * (cell.vertices[0] + cell.vertices[1] +
6884 cell.vertices[2] + cell.vertices[3]);
6901 width =
static_cast<unsigned int>(
6911 << height <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">"
6914 << height <<
"\" style=\"fill:white\"/>" <<
'\n'
6920 for (
const auto &cell : cells)
6970 unsigned int stop_i =
static_cast<unsigned int>(
stop_h * 6.);
7012 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7015 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7020 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7023 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7027 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_f),
7032 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_q);
7063 <<
"\" gradientUnits=\"userSpaceOnUse\" "
7065 <<
static_cast<unsigned int>(
7073 <<
static_cast<unsigned int>(
7080 <<
static_cast<unsigned int>(
7088 <<
static_cast<unsigned int>(
7095 <<
" <stop offset=\"0\" style=\"stop-color:rgb(" <<
start_r
7097 <<
" <stop offset=\"1\" style=\"stop-color:rgb(" <<
stop_r
7099 <<
" </linearGradient>" <<
'\n';
7102 double x1 = 0,
y1 = 0,
x2 = 0,
y2 = 0;
7103 double x3 = cell.projected_center[0];
7104 double y3 = cell.projected_center[1];
7109 x1 = cell.projected_vertices[0][0],
7110 y1 = cell.projected_vertices[0][1],
7111 x2 = cell.projected_vertices[1][0],
7112 y2 = cell.projected_vertices[1][1];
7115 x1 = cell.projected_vertices[1][0],
7116 y1 = cell.projected_vertices[1][1],
7117 x2 = cell.projected_vertices[3][0],
7118 y2 = cell.projected_vertices[3][1];
7121 x1 = cell.projected_vertices[3][0],
7122 y1 = cell.projected_vertices[3][1],
7123 x2 = cell.projected_vertices[2][0],
7124 y2 = cell.projected_vertices[2][1];
7127 x1 = cell.projected_vertices[2][0],
7128 y1 = cell.projected_vertices[2][1],
7129 x2 = cell.projected_vertices[0][0],
7130 y2 = cell.projected_vertices[0][1];
7136 out <<
" <path d=\"M "
7137 <<
static_cast<unsigned int>(
7143 <<
static_cast<unsigned int>(
7148 <<
static_cast<unsigned int>(
7154 <<
static_cast<unsigned int>(
7159 <<
static_cast<unsigned int>(
7165 <<
static_cast<unsigned int>(
7170 <<
static_cast<unsigned int>(
7176 <<
static_cast<unsigned int>(
7191 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
7196 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
7201 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
7203 for (
unsigned int index = 0; index < 4; ++index)
7205 double start_h = .667 - ((index + 1) / 4.) * .667;
7206 double stop_h = .667 - (index / 4.) * .667;
7217 unsigned int stop_i =
static_cast<unsigned int>(
stop_h * 6.);
7259 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7262 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7267 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7270 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7274 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_f),
7279 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_q);
7286 out <<
" <linearGradient id=\"colorbar_" << index
7287 <<
"\" gradientUnits=\"userSpaceOnUse\" "
7290 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7296 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7301 <<
" <stop offset=\"0\" style=\"stop-color:rgb(" <<
start_r
7303 <<
" <stop offset=\"1\" style=\"stop-color:rgb(" <<
stop_r
7305 <<
" </linearGradient>" <<
'\n';
7311 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7316 <<
"\" style=\"stroke:black; stroke-width:2; fill:url(#colorbar_"
7317 << index <<
")\"/>" <<
'\n';
7320 for (
unsigned int index = 0; index < 5; ++index)
7327 <<
static_cast<unsigned int>(
7331 <<
" style=\"text-anchor:start; font-size:80; font-family:Helvetica";
7333 if (index == 0 || index == 4)
7334 out <<
"; font-weight:bold";
7337 <<
static_cast<float>(
7347 out <<
"</text>" <<
'\n';
7352 out <<
'\n' <<
"</svg>";
7358 template <
int dim,
int spacedim>
7364 std::tuple<
unsigned int,
7368 &nonscalar_data_ranges,
7377 out << dim <<
' ' << spacedim <<
'\n';
7380 out <<
"[deal.II intermediate format graphics data]" <<
'\n'
7390 out << patches.size() <<
'\n';
7391 for (
unsigned int i = 0; i < patches.size(); ++i)
7392 out << patches[i] <<
'\n';
7394 out << nonscalar_data_ranges.size() <<
'\n';
7406 template <
int dim,
int spacedim>
7412 std::tuple<
unsigned int,
7416 &nonscalar_data_ranges,
7422#ifndef DEAL_II_WITH_MPI
7425 (
void)nonscalar_data_ranges;
7432 ExcMessage(
"This functionality requires MPI to be enabled."));
7453 boost::iostreams::filtering_ostream f;
7459# ifdef DEAL_II_WITH_ZLIB
7460 f.push(boost::iostreams::zlib_compressor(
7466 "Compression requires deal.II to be configured with ZLIB support."));
7469 boost::iostreams::back_insert_device<std::vector<char>>
inserter(
7474 patches,
data_names, nonscalar_data_ranges, flags, f);
7571 std::pair<unsigned int, unsigned int>
7576 unsigned int dim, spacedim;
7577 input >> dim >> spacedim;
7579 return std::make_pair(dim, spacedim);
7588template <
int dim,
int spacedim>
7590 : default_subdivisions(1)
7596template <
int dim,
int spacedim>
7601 get_dataset_names(),
7602 get_nonscalar_data_ranges(),
7609template <
int dim,
int spacedim>
7614 get_dataset_names(),
7615 get_nonscalar_data_ranges(),
7622template <
int dim,
int spacedim>
7627 get_dataset_names(),
7628 get_nonscalar_data_ranges(),
7635template <
int dim,
int spacedim>
7640 get_dataset_names(),
7641 get_nonscalar_data_ranges(),
7648template <
int dim,
int spacedim>
7653 get_dataset_names(),
7654 get_nonscalar_data_ranges(),
7661template <
int dim,
int spacedim>
7666 get_dataset_names(),
7667 get_nonscalar_data_ranges(),
7674template <
int dim,
int spacedim>
7679 get_dataset_names(),
7680 get_nonscalar_data_ranges(),
7687template <
int dim,
int spacedim>
7692 get_dataset_names(),
7693 get_nonscalar_data_ranges(),
7698template <
int dim,
int spacedim>
7703 get_dataset_names(),
7704 get_nonscalar_data_ranges(),
7709template <
int dim,
int spacedim>
7714 get_dataset_names(),
7715 get_nonscalar_data_ranges(),
7721template <
int dim,
int spacedim>
7727#ifndef DEAL_II_WITH_MPI
7762 std::stringstream
ss;
7775 const auto &patches = get_patches();
7784 std::stringstream
ss;
7787 get_dataset_names(),
7788 get_nonscalar_data_ranges(),
7815 std::stringstream
ss;
7845template <
int dim,
int spacedim>
7849 const std::vector<std::string> &
piece_names)
const
7853 get_dataset_names(),
7854 get_nonscalar_data_ranges(),
7860template <
int dim,
int spacedim>
7865 const unsigned int counter,
7893 this->write_vtu(output);
7898 this->write_vtu_in_parallel(
filename, mpi_communicator);
7902#ifdef DEAL_II_WITH_MPI
7941template <
int dim,
int spacedim>
7944 std::ostream &out)
const
7947 get_dataset_names(),
7948 get_nonscalar_data_ranges(),
7949 deal_II_intermediate_flags,
7955template <
int dim,
int spacedim>
7964 get_dataset_names(),
7965 get_nonscalar_data_ranges(),
7966 deal_II_intermediate_flags,
7974template <
int dim,
int spacedim>
7982 return create_xdmf_entry(
7988template <
int dim,
int spacedim>
7992 const std::string &h5_mesh_filename,
7998 ExcMessage(
"XDMF only supports 2 or 3 space dimensions."));
8000#ifndef DEAL_II_WITH_HDF5
8004 (
void)h5_mesh_filename;
8051 const int tag = 47381;
8056 const auto &patches = get_patches();
8061 for (
const auto &
patch : patches)
8062 Assert(
patch.reference_cell == patches[0].reference_cell,
8073 patches[0].reference_cell);
8074 const unsigned int n_data_sets =
data_filter.n_data_sets();
8078 for (
unsigned int i = 0; i < n_data_sets; ++i)
8119 return Utilities::unpack<XDMFEntry>(
buffer,
false);
8127template <
int dim,
int spacedim>
8130 const std::vector<XDMFEntry> &entries,
8134#ifdef DEAL_II_WITH_MPI
8146 xdmf_file <<
"<?xml version=\"1.0\" ?>\n";
8147 xdmf_file <<
"<!DOCTYPE Xdmf SYSTEM \"Xdmf.dtd\" []>\n";
8148 xdmf_file <<
"<Xdmf Version=\"2.0\">\n";
8151 <<
" <Grid Name=\"CellTime\" GridType=\"Collection\" CollectionType=\"Temporal\">\n";
8153 for (
const auto &entry : entries)
8172template <
int dim,
int spacedim>
8178 get_dataset_names(),
8179 get_nonscalar_data_ranges(),
8186#ifdef DEAL_II_WITH_HDF5
8190 template <
int dim,
int spacedim>
8222# ifdef DEAL_II_WITH_MPI
8223# ifdef H5_HAVE_PARALLEL
8230# ifndef DEAL_II_WITH_ZLIB
8240# ifdef DEAL_II_WITH_MPI
8264# ifdef DEAL_II_WITH_MPI
8265# ifdef H5_HAVE_PARALLEL
8288 cell_ds_dim[1] = patches[0].reference_cell.n_vertices();
8293# if H5Gcreate_vers == 1
8301# ifdef DEAL_II_WITH_ZLIB
8316# if H5Gcreate_vers == 1
8324# ifdef DEAL_II_WITH_ZLIB
8349 count[1] = (spacedim < 2) ? 2 : spacedim;
8366 count[1] = patches[0].reference_cell.n_vertices();
8458# if H5Gcreate_vers == 1
8466# ifdef DEAL_II_WITH_ZLIB
8539template <
int dim,
int spacedim>
8545 std::tuple<
unsigned int,
8549 &nonscalar_data_ranges,
8552 const unsigned int n_data_sets =
data_names.size();
8554#ifndef DEAL_II_WITH_MPI
8561 Assert(patches.size() > 0, ExcNoPatches());
8563 if (patches.empty())
8567 unsigned int n_nodes;
8600 while (
n_th_vector < nonscalar_data_ranges.size() &&
8615 std::get<1>(nonscalar_data_ranges[
n_th_vector]) >=
8618 std::get<0>(nonscalar_data_ranges[
n_th_vector])));
8620 std::get<1>(nonscalar_data_ranges[
n_th_vector]) < n_data_sets,
8627 if (!std::get<2>(nonscalar_data_ranges[
n_th_vector]).empty())
8634 for (i = std::get<0>(nonscalar_data_ranges[
n_th_vector]);
8662template <
int dim,
int spacedim>
8675template <
int dim,
int spacedim>
8695template <
int dim,
int spacedim>
8710template <
int dim,
int spacedim>
8724 "DataOutBase was asked to write HDF5 output for a space dimension of 1. "
8725 "HDF5 only supports datasets that live in 2 or 3 dimensions."));
8727#ifndef DEAL_II_WITH_HDF5
8744# ifndef H5_HAVE_PARALLEL
8748 "Serial HDF5 output on multiple processes is not yet supported."));
8758 Assert((patches.size() > 0) || (
n_ranks > 1), ExcNoPatches());
8793template <
int dim,
int spacedim>
8849 write_deal_II_intermediate(out);
8859template <
int dim,
int spacedim>
8868template <
int dim,
int spacedim>
8869template <
typename FlagType>
8873 if constexpr (std::is_same_v<FlagType, DataOutBase::DXFlags>)
8875 else if constexpr (std::is_same_v<FlagType, DataOutBase::UcdFlags>)
8877 else if constexpr (std::is_same_v<FlagType, DataOutBase::PovrayFlags>)
8878 povray_flags = flags;
8879 else if constexpr (std::is_same_v<FlagType, DataOutBase::EpsFlags>)
8881 else if constexpr (std::is_same_v<FlagType, DataOutBase::GmvFlags>)
8883 else if constexpr (std::is_same_v<FlagType, DataOutBase::Hdf5Flags>)
8885 else if constexpr (std::is_same_v<FlagType, DataOutBase::TecplotFlags>)
8886 tecplot_flags = flags;
8887 else if constexpr (std::is_same_v<FlagType, DataOutBase::VtkFlags>)
8889 else if constexpr (std::is_same_v<FlagType, DataOutBase::SvgFlags>)
8891 else if constexpr (std::is_same_v<FlagType, DataOutBase::GnuplotFlags>)
8892 gnuplot_flags = flags;
8893 else if constexpr (std::is_same_v<
FlagType,
8895 deal_II_intermediate_flags = flags;
8902template <
int dim,
int spacedim>
8915template <
int dim,
int spacedim>
8922 "A name for the output format to be used");
8926 "Number of subdivisions of each mesh cell");
8972template <
int dim,
int spacedim>
8978 default_subdivisions = prm.
get_integer(
"Subdivisions");
8981 dx_flags.parse_parameters(prm);
8985 ucd_flags.parse_parameters(prm);
8989 gnuplot_flags.parse_parameters(prm);
8993 povray_flags.parse_parameters(prm);
8997 eps_flags.parse_parameters(prm);
9001 gmv_flags.parse_parameters(prm);
9005 hdf5_flags.parse_parameters(prm);
9009 tecplot_flags.parse_parameters(prm);
9013 vtk_flags.parse_parameters(prm);
9017 deal_II_intermediate_flags.parse_parameters(prm);
9023template <
int dim,
int spacedim>
9027 return (
sizeof(default_fmt) +
9043template <
int dim,
int spacedim>
9045 std::tuple<
unsigned int,
9052 std::tuple<
unsigned int,
9059template <
int dim,
int spacedim>
9070 std::tuple<
unsigned int,
9074 ranges = this->get_nonscalar_data_ranges();
9075 const std::vector<std::string>
data_names = this->get_dataset_names();
9076 const unsigned int n_data_sets =
data_names.size();
9079 for (
const auto &
range : ranges)
9081 const std::string &name = std::get<2>(
range);
9086 "Error: names of fields in DataOut need to be unique, "
9088 name +
"' is used more than once."));
9102 "Error: names of fields in DataOut need to be unique, "
9104 name +
"' is used more than once."));
9115template <
int dim,
int spacedim>
9123 std::vector<typename ::DataOutBase::Patch<dim, spacedim>> tmp;
9127 std::vector<std::string> tmp;
9128 tmp.swap(dataset_names);
9132 std::tuple<
unsigned int,
9137 tmp.swap(nonscalar_data_ranges);
9148 ExcIncompatibleDimensions(
9160 std::ostringstream s;
9161 s <<
"[deal.II intermediate format graphics data]";
9169 std::ostringstream s;
9179 std::ostringstream s;
9185 "Invalid or incompatible file format. Intermediate format "
9186 "files can only be read by the same deal.II version as they "
9187 "are written by."));
9191 unsigned int n_datasets;
9193 dataset_names.resize(n_datasets);
9194 for (
unsigned int i = 0; i < n_datasets; ++i)
9195 in >> dataset_names[i];
9200 for (
unsigned int i = 0; i <
n_patches; ++i)
9208 in >> std::get<0>(nonscalar_data_ranges[i]) >>
9209 std::get<1>(nonscalar_data_ranges[i]);
9218 std::get<2>(nonscalar_data_ranges[i]) = name;
9226template <
int dim,
int spacedim>
9233 in.read(
reinterpret_cast<char *
>(&
header),
sizeof(
header));
9235 header.magic == 0x00dea111,
9237 "Invalid header of parallel deal.II intermediate format encountered."));
9241 "Incorrect header version of parallel deal.II intermediate format."));
9244 in.read(
reinterpret_cast<char *
>(
chunk_sizes.data()),
9245 header.n_ranks *
sizeof(std::uint64_t));
9247 for (
unsigned int n = 0; n <
header.n_ranks; ++n)
9259 boost::iostreams::filtering_istreambuf f;
9262#ifdef DEAL_II_WITH_ZLIB
9263 f.push(boost::iostreams::zlib_decompressor());
9268 "Decompression requires deal.II to be configured with ZLIB support."));
9294template <
int dim,
int spacedim>
9298 using Patch = typename ::DataOutBase::Patch<dim, spacedim>;
9305 Assert(get_dataset_names() ==
source.get_dataset_names(),
9306 ExcIncompatibleDatasetNames());
9310 source.get_nonscalar_data_ranges().size(),
9311 ExcMessage(
"Both sources need to declare the same components "
9313 for (
unsigned int i = 0; i < get_nonscalar_data_ranges().size(); ++i)
9315 Assert(std::get<0>(get_nonscalar_data_ranges()[i]) ==
9316 std::get<0>(
source.get_nonscalar_data_ranges()[i]),
9317 ExcMessage(
"Both sources need to declare the same components "
9319 Assert(std::get<1>(get_nonscalar_data_ranges()[i]) ==
9320 std::get<1>(
source.get_nonscalar_data_ranges()[i]),
9321 ExcMessage(
"Both sources need to declare the same components "
9323 Assert(std::get<2>(get_nonscalar_data_ranges()[i]) ==
9324 std::get<2>(
source.get_nonscalar_data_ranges()[i]),
9325 ExcMessage(
"Both sources need to declare the same components "
9331 ExcIncompatiblePatchLists());
9333 ExcIncompatiblePatchLists());
9335 ExcIncompatiblePatchLists());
9343 for (
unsigned int i =
old_n_patches; i < patches.size(); ++i)
9347 for (
unsigned int i =
old_n_patches; i < patches.size(); ++i)
9349 if (patches[i].neighbors[n] !=
9356template <
int dim,
int spacedim>
9357const std::vector<typename ::DataOutBase::Patch<dim, spacedim>> &
9365template <
int dim,
int spacedim>
9366std::vector<std::string>
9369 return dataset_names;
9374template <
int dim,
int spacedim>
9376 std::tuple<
unsigned int,
9382 return nonscalar_data_ranges;
9391 , h5_sol_filename(
"")
9392 , h5_mesh_filename(
"")
9394 , num_nodes(
numbers::invalid_unsigned_int)
9395 , num_cells(
numbers::invalid_unsigned_int)
9396 , dimension(
numbers::invalid_unsigned_int)
9397 , space_dimension(
numbers::invalid_unsigned_int)
9405 const std::uint64_t
nodes,
9406 const std::uint64_t cells,
9407 const unsigned int dim,
9417 const std::uint64_t
nodes,
9418 const std::uint64_t cells,
9419 const unsigned int dim,
9441 const unsigned int dimension)
9448 return ReferenceCells::get_hypercube<0>();
9450 return ReferenceCells::get_hypercube<1>();
9452 return ReferenceCells::get_hypercube<2>();
9454 return ReferenceCells::get_hypercube<3>();
9469 const std::uint64_t
nodes,
9470 const std::uint64_t cells,
9471 const unsigned int dim,
9472 const unsigned int spacedim,
9481 , space_dimension(spacedim)
9489 const unsigned int dimension)
9504 std::string
res =
"";
9519 std::stringstream
ss;
9522 <<
"<Grid Name=\"mesh\" GridType=\"Uniform\">\n";
9528 <<
"\" NumberType=\"Float\" Precision=\"8\" Format=\"HDF\">\n";
9554 ss <<
"Quadrilateral";
9573 ss <<
"Tetrahedron";
9579 ss <<
"\" NodesPerElement=\"1\">\n";
9581 ss <<
"\" NodesPerElement=\"2\">\n";
9588 <<
"\" NumberType=\"UInt\" Format=\"HDF\">\n";
9599 <<
"<Topology TopologyType=\"Polyvertex\" NumberOfElements=\""
9609 <<
"\" Center=\"Node\">\n";
9613 <<
"\" NumberType=\"Float\" Precision=\"8\" Format=\"HDF\">\n";
9629 template <
int dim,
int spacedim>
9634 out <<
"[deal.II intermediate Patch<" << dim <<
',' << spacedim <<
">]"
9638 out <<
patch.reference_cell <<
'\n';
9641 for (
const unsigned int i :
patch.reference_cell.vertex_indices())
9642 out <<
patch.vertices[i] <<
' ';
9645 for (
const unsigned int i :
patch.reference_cell.face_indices())
9646 out <<
patch.neighbors[i] <<
' ';
9649 out <<
patch.patch_index <<
' ' <<
patch.n_subdivisions <<
'\n';
9651 out <<
patch.points_are_available <<
'\n';
9653 out <<
patch.data.n_rows() <<
' ' <<
patch.data.n_cols() <<
'\n';
9654 for (
unsigned int i = 0; i <
patch.data.n_rows(); ++i)
9655 for (
unsigned int j = 0;
j <
patch.data.n_cols(); ++
j)
9656 out <<
patch.data[i][
j] <<
' ';
9665 template <
int dim,
int spacedim>
9681 while ((
header.empty()) && in);
9683 std::ostringstream s;
9684 s <<
"[deal.II intermediate Patch<" << dim <<
',' << spacedim <<
">]";
9690 if constexpr (dim > 0)
9691 in >>
patch.reference_cell;
9694 for (
const unsigned int i :
patch.reference_cell.vertex_indices())
9695 in >>
patch.vertices[i];
9697 for (
const unsigned int i :
patch.reference_cell.face_indices())
9698 in >>
patch.neighbors[i];
9700 in >>
patch.patch_index;
9704 unsigned int n_subdivisions;
9705 in >> n_subdivisions;
9706 if constexpr (dim > 1)
9707 patch.n_subdivisions = n_subdivisions;
9709 in >>
patch.points_are_available;
9711 unsigned int n_rows, n_cols;
9712 in >> n_rows >> n_cols;
9713 patch.data.reinit(n_rows, n_cols);
9714 for (
unsigned int i = 0; i <
patch.data.n_rows(); ++i)
9715 for (
unsigned int j = 0;
j <
patch.data.n_cols(); ++
j)
9727#include "base/data_out_base.inst"
const double * get_data_set(const unsigned int set_num) const
std::map< unsigned int, unsigned int > filtered_points
std::string get_data_set_name(const unsigned int set_num) const
void internal_add_cell(const unsigned int cell_index, const unsigned int pt_index)
void write_cell(const unsigned int index, const unsigned int start, const std::array< unsigned int, dim > &offsets)
std::vector< unsigned int > data_set_dims
unsigned int n_nodes() const
void fill_node_data(std::vector< double > &node_data) const
std::vector< std::vector< double > > data_sets
unsigned int get_data_set_dim(const unsigned int set_num) const
void write_data_set(const std::string &name, const unsigned int dimension, const unsigned int set_num, const Table< 2, double > &data_vectors)
std::map< unsigned int, unsigned int > filtered_cells
void write_cell_single(const unsigned int index, const unsigned int start, const unsigned int n_points, const ReferenceCell &reference_cell)
std::vector< std::string > data_set_names
void fill_cell_data(const unsigned int local_node_offset, std::vector< unsigned int > &cell_data) const
void write_point(const unsigned int index, const Point< dim > &p)
unsigned int n_cells() const
DataOutBase::DataOutFilterFlags flags
Map3DPoint existing_points
unsigned int n_data_sets() const
XDMFEntry create_xdmf_entry(const DataOutBase::DataOutFilter &data_filter, const std::string &h5_filename, const double cur_time, const MPI_Comm comm) const
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges() const
void parse_parameters(ParameterHandler &prm)
void write_filtered_data(DataOutBase::DataOutFilter &filtered_data) const
void write_pvtu_record(std::ostream &out, const std::vector< std::string > &piece_names) const
static void declare_parameters(ParameterHandler &prm)
void write_ucd(std::ostream &out) const
void write_povray(std::ostream &out) const
std::string default_suffix(const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
void write_xdmf_file(const std::vector< XDMFEntry > &entries, const std::string &filename, const MPI_Comm comm) const
std::size_t memory_consumption() const
void set_default_format(const DataOutBase::OutputFormat default_format)
void write(std::ostream &out, const DataOutBase::OutputFormat output_format=DataOutBase::default_format) const
void write_gnuplot(std::ostream &out) const
void write_vtu(std::ostream &out) const
void write_hdf5_parallel(const DataOutBase::DataOutFilter &data_filter, const std::string &filename, const MPI_Comm comm) const
void write_tecplot(std::ostream &out) const
void write_deal_II_intermediate_in_parallel(const std::string &filename, const MPI_Comm comm, const DataOutBase::CompressionLevel compression) const
void write_svg(std::ostream &out) const
void write_vtu_in_parallel(const std::string &filename, const MPI_Comm comm) const
void validate_dataset_names() const
void set_flags(const FlagType &flags)
void write_vtk(std::ostream &out) const
void write_gmv(std::ostream &out) const
std::string write_vtu_with_pvtu_record(const std::string &directory, const std::string &filename_without_extension, const unsigned int counter, const MPI_Comm mpi_communicator, const unsigned int n_digits_for_counter=numbers::invalid_unsigned_int, const unsigned int n_groups=0) const
void write_eps(std::ostream &out) const
void write_dx(std::ostream &out) const
void write_deal_II_intermediate(std::ostream &out) const
void merge(const DataOutReader< dim, spacedim > &other)
void read_whole_parallel_file(std::istream &in)
virtual const std::vector<::DataOutBase::Patch< dim, spacedim > > & get_patches() const override
void read(std::istream &in)
virtual std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > get_nonscalar_data_ranges() const override
virtual std::vector< std::string > get_dataset_names() const override
void enter_subsection(const std::string &subsection, const bool create_path_if_needed=true)
long int get_integer(const std::string &entry_string) const
bool get_bool(const std::string &entry_name) const
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation="", const bool has_to_be_set=false)
std::string get(const std::string &entry_string) const
double get_double(const std::string &entry_name) const
unsigned int n_vertices() const
static constexpr unsigned int rank
static constexpr unsigned int dimension
static constexpr TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
std::string h5_sol_filename
std::string h5_mesh_filename
std::string get_xdmf_content(const unsigned int indent_level) const
void add_attribute(const std::string &attr_name, const unsigned int dimension)
std::map< std::string, unsigned int > attribute_dims
unsigned int space_dimension
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_PACKAGE_VERSION
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_FALLTHROUGH
#define DEAL_II_PACKAGE_NAME
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcFileNotOpen(std::string arg1)
static ::ExceptionBase & ExcNotEnoughSpaceDimensionLabels()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNoPatches()
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcLowerRange(int arg1, int arg2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNeedsHDF5()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcInvalidDatasetSize(int arg1, int arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
Task< RT > new_task(const std::function< RT()> &function)
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
const unsigned int my_rank
std::vector< index_type > data
DataComponentInterpretation
@ component_is_part_of_tensor
void write_eps(const std::vector< Patch< 2, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const EpsFlags &flags, std::ostream &out)
std::pair< unsigned int, unsigned int > determine_intermediate_format_dimensions(std::istream &input)
std::ostream & operator<<(std::ostream &out, const Patch< dim, spacedim > &patch)
void write_nodes(const std::vector< Patch< dim, spacedim > > &patches, StreamType &out)
void write_deal_II_intermediate_in_parallel(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const Deal_II_IntermediateFlags &flags, const std::string &filename, const MPI_Comm comm, const CompressionLevel compression)
void write_ucd(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const UcdFlags &flags, std::ostream &out)
void write_dx(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const DXFlags &flags, std::ostream &out)
void write_vtu_header(std::ostream &out, const VtkFlags &flags)
void write_vtu(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
void write_gmv(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const GmvFlags &flags, std::ostream &out)
void write_data(const std::vector< Patch< dim, spacedim > > &patches, unsigned int n_data_sets, const bool double_precision, StreamType &out)
void write_vtu_main(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
void write_pvd_record(std::ostream &out, const std::vector< std::pair< double, std::string > > ×_and_names)
void write_deal_II_intermediate(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const Deal_II_IntermediateFlags &flags, std::ostream &out)
void write_vtu_footer(std::ostream &out)
void write_cells(const std::vector< Patch< dim, spacedim > > &patches, StreamType &out)
void write_tecplot(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const TecplotFlags &flags, std::ostream &out)
void write_filtered_data(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, DataOutFilter &filtered_data)
OutputFormat parse_output_format(const std::string &format_name)
std::vector< Point< spacedim > > get_node_positions(const std::vector< Patch< dim, spacedim > > &patches)
void write_hdf5_parallel(const std::vector< Patch< dim, spacedim > > &patches, const DataOutFilter &data_filter, const DataOutBase::Hdf5Flags &flags, const std::string &filename, const MPI_Comm comm)
std::istream & operator>>(std::istream &in, Patch< dim, spacedim > &patch)
std::string get_output_format_names()
void write_svg(const std::vector< Patch< 2, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const SvgFlags &flags, std::ostream &out)
void write_visit_record(std::ostream &out, const std::vector< std::string > &piece_names)
void write_high_order_cells(const std::vector< Patch< dim, spacedim > > &patches, StreamType &out, const bool legacy_format)
std::string default_suffix(const OutputFormat output_format)
void write_povray(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const PovrayFlags &flags, std::ostream &out)
void write_gnuplot(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const GnuplotFlags &flags, std::ostream &out)
void write_vtk(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
void write_pvtu_record(std::ostream &out, const std::vector< std::string > &piece_names, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const VtkFlags &flags)
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim > > > &Du)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Invalid
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Hexahedron
constexpr const ReferenceCell Vertex
constexpr const ReferenceCell Line
int File_write_at_c(MPI_File fh, MPI_Offset offset, const void *buf, MPI_Count count, MPI_Datatype datatype, MPI_Status *status)
int File_write_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf, MPI_Count count, MPI_Datatype datatype, MPI_Status *status)
T sum(const T &t, const MPI_Comm mpi_communicator)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
unsigned int this_mpi_process(const MPI_Comm mpi_communicator)
void free_communicator(MPI_Comm mpi_communicator)
size_t pack(const T &object, std::vector< char > &dest_buffer, const bool allow_compression=true)
std::string encode_base64(const std::vector< unsigned char > &binary_input)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
unsigned int needed_digits(const unsigned int max_number)
constexpr T pow(const T base, const int iexp)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
constexpr unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
void parse_parameters(const ParameterHandler &prm)
DXFlags(const bool write_neighbors=false, const bool int_binary=false, const bool coordinates_binary=false, const bool data_binary=false)
static void declare_parameters(ParameterHandler &prm)
static void declare_parameters(ParameterHandler &prm)
void parse_parameters(const ParameterHandler &prm)
bool filter_duplicate_vertices
DataOutFilterFlags(const bool filter_duplicate_vertices=false, const bool xdmf_hdf5_output=false)
static void declare_parameters(ParameterHandler &prm)
static RgbValues default_color_function(const double value, const double min_value, const double max_value)
void parse_parameters(const ParameterHandler &prm)
ColorFunction color_function
static RgbValues grey_scale_color_function(const double value, const double min_value, const double max_value)
EpsFlags(const unsigned int height_vector=0, const unsigned int color_vector=0, const SizeType size_type=width, const unsigned int size=300, const double line_width=0.5, const double azimut_angle=60, const double turn_angle=30, const double z_scaling=1.0, const bool draw_mesh=true, const bool draw_cells=true, const bool shade_cells=true, const ColorFunction color_function=&default_color_function)
unsigned int color_vector
static RgbValues reverse_grey_scale_color_function(const double value, const double min_value, const double max_value)
@ width
Scale to given width.
@ height
Scale to given height.
unsigned int height_vector
std::vector< std::string > space_dimension_labels
std::size_t memory_consumption() const
DataOutBase::CompressionLevel compression_level
Hdf5Flags(const CompressionLevel compression_level=CompressionLevel::best_speed)
static void declare_parameters(ParameterHandler &prm)
std::size_t memory_consumption() const
ReferenceCell reference_cell
static const unsigned int no_neighbor
bool operator==(const Patch &patch) const
void swap(Patch< dim, spacedim > &other_patch) noexcept
static const unsigned int space_dim
unsigned int n_subdivisions
std::array< unsigned int, GeometryInfo< dim >::faces_per_cell > neighbors
static void declare_parameters(ParameterHandler &prm)
PovrayFlags(const bool smooth=false, const bool bicubic_patch=false, const bool external_data=false)
void parse_parameters(const ParameterHandler &prm)
unsigned int height_vector
SvgFlags(const unsigned int height_vector=0, const int azimuth_angle=37, const int polar_angle=45, const unsigned int line_thickness=1, const bool margin=true, const bool draw_colorbar=true)
unsigned int line_thickness
std::size_t memory_consumption() const
TecplotFlags(const char *zone_name=nullptr, const double solution_time=-1.0)
void parse_parameters(const ParameterHandler &prm)
static void declare_parameters(ParameterHandler &prm)
UcdFlags(const bool write_preamble=false)
VtkFlags(const double time=std::numeric_limits< double >::min(), const unsigned int cycle=std::numeric_limits< unsigned int >::min(), const bool print_date_and_time=true, const CompressionLevel compression_level=CompressionLevel::best_speed, const bool write_higher_order_cells=false, const std::map< std::string, std::string > &physical_units={})
std::map< std::string, std::string > physical_units
bool write_higher_order_cells
DataOutBase::CompressionLevel compression_level
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices()
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices()
bool operator<(const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)