40#ifdef DEAL_II_WITH_ZLIB
44#ifdef DEAL_II_WITH_HDF5
48#include <boost/iostreams/copy.hpp>
49#include <boost/iostreams/device/back_inserter.hpp>
50#include <boost/iostreams/filtering_stream.hpp>
51#ifdef DEAL_II_WITH_ZLIB
52# include <boost/iostreams/filter/zlib.hpp>
66 <<
"Unexpected input: expected line\n <" <<
arg1
67 <<
">\nbut got\n <" <<
arg2 <<
">");
73#ifdef DEAL_II_WITH_ZLIB
80#ifdef DEAL_II_WITH_ZLIB
104# ifdef DEAL_II_WITH_MPI
115 return boost::iostreams::zlib::no_compression;
117 return boost::iostreams::zlib::best_speed;
119 return boost::iostreams::zlib::best_compression;
121 return boost::iostreams::zlib::default_compression;
124 return boost::iostreams::zlib::no_compression;
134 template <
typename T>
139#ifdef DEAL_II_WITH_ZLIB
140 if (data.size() != 0)
150 std::numeric_limits<std::uint32_t>::max(),
156 std::numeric_limits<std::uint32_t>::max(),
163 reinterpret_cast<const Bytef *
>(data.data()),
176 static_cast<std::uint32_t
>(
178 static_cast<std::uint32_t
>(
192 (void)compression_level;
194 ExcMessage(
"This function can only be called if cmake found "
195 "a working libz installation."));
210 template <
typename T>
224 std::ostringstream stream;
225 stream.precision(precision);
226 for (
const T &el : data)
241 struct ParallelIntermediateHeader
244 std::uint64_t version;
245 std::uint64_t compression;
246 std::uint64_t dimension;
247 std::uint64_t space_dimension;
248 std::uint64_t n_ranks;
249 std::uint64_t n_patches;
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>>
362 if (patches.size() == 0)
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) :
374 patches[0].data.n_rows();
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) :
401 patch.data.n_rows()));
402 Assert(
patch.reference_cell != ReferenceCells::get_hypercube<dim>() ||
403 (n_data_sets == 0) ||
405 Utilities::fixed_power<dim>(n_subdivisions + 1)),
407 n_subdivisions + 1));
424 , node_dim(
numbers::invalid_unsigned_int)
432 , node_dim(
numbers::invalid_unsigned_int)
445 for (
unsigned int d = 0; d < dim; ++d)
488 for (
unsigned int d = 0; d <
node_dim; ++d)
498 std::vector<unsigned int> &cell_data)
const
574 const unsigned int start,
575 const std::array<unsigned int, dim> &
offsets)
637 const unsigned int start,
638 const unsigned int n_points,
643 const unsigned int base_entry = index * n_points;
645 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
647 for (
unsigned int i = 0; i < n_points; ++i)
658 const unsigned int dimension,
681 for (
unsigned int d = 0; d <
new_dim; ++d)
700 const char *
gmv_cell_type[4] = {
"",
"line 2",
"quad 4",
"hex 8"};
702 const char *
ucd_cell_type[4] = {
"pt",
"line",
"quad",
"hex"};
719 template <
int dim,
int spacedim>
720 std::array<unsigned int, 3>
722 const bool write_higher_order_cells)
728 patch.reference_cell.n_vertices()}};
730 if (write_higher_order_cells)
735 else if (
patch.
data.n_cols() ==
patch.reference_cell.n_vertices())
752 else if (
patch.reference_cell.is_hyper_cube())
775 template <
int dim,
int spacedim>
780 const unsigned int n_subdivisions)
793 if (
patch.points_are_available)
802 point_no += (n_subdivisions + 1) * (n_subdivisions + 1) *
zstep;
820 for (
unsigned int d = 0;
d < spacedim; ++
d)
829 return patch.vertices[0];
833 const double stepsize = 1. / n_subdivisions;
866 template <
int dim,
int spacedim>
879 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
885 if (
patch.points_are_available)
888 for (
unsigned int d = 0;
d < spacedim; ++
d)
914 template <
int dim,
int spacedim>
915 std::tuple<unsigned int, unsigned int>
919 unsigned int n_nodes = 0;
921 for (
const auto &
patch : patches)
925 "The reference cell for this patch is set to 'Invalid', "
926 "but that is clearly not a valid choice. Did you forget "
927 "to set the reference cell for the patch?"));
929 if (
patch.reference_cell.is_hyper_cube())
931 n_nodes += Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
932 n_cells += Utilities::fixed_power<dim>(
patch.n_subdivisions);
937 n_nodes +=
patch.reference_cell.n_vertices();
942 return std::make_tuple(n_nodes, n_cells);
952 template <
int dim,
int spacedim>
953 std::tuple<unsigned int, unsigned int, unsigned int>
956 const bool write_higher_order_cells)
958 unsigned int n_nodes = 0;
962 for (
const auto &
patch : patches)
964 if (
patch.reference_cell.is_hyper_cube())
966 n_nodes += Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
968 if (write_higher_order_cells)
975 1 + Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
984 Utilities::fixed_power<dim>(
patch.n_subdivisions);
1006 template <
typename FlagsType>
1013 StreamBase(std::ostream &stream,
const FlagsType &flags)
1014 : selected_component(
numbers::invalid_unsigned_int)
1025 write_point(
const unsigned int,
const Point<dim> &)
1028 ExcMessage(
"The derived class you are using needs to "
1029 "reimplement this function if you want to call "
1049 write_cell(
const unsigned int ,
1050 const unsigned int ,
1051 std::array<unsigned int, dim> & )
1054 ExcMessage(
"The derived class you are using needs to "
1055 "reimplement this function if you want to call "
1066 write_cell_single(
const unsigned int index,
1067 const unsigned int start,
1068 const unsigned int n_points,
1074 (void)reference_cell;
1077 ExcMessage(
"The derived class you are using needs to "
1078 "reimplement this function if you want to call "
1096 template <
typename T>
1110 unsigned int selected_component;
1117 std::ostream &stream;
1128 class DXStream :
public StreamBase<DataOutBase::DXFlags>
1135 write_point(
const unsigned int index,
const Point<dim> &);
1147 write_cell(
const unsigned int index,
1148 const unsigned int start,
1149 const std::array<unsigned int, dim> &
offsets);
1157 template <
typename data>
1159 write_dataset(
const unsigned int index,
const std::vector<data> &values);
1165 class GmvStream :
public StreamBase<DataOutBase::GmvFlags>
1172 write_point(
const unsigned int index,
const Point<dim> &);
1184 write_cell(
const unsigned int index,
1185 const unsigned int start,
1186 const std::array<unsigned int, dim> &
offsets);
1192 class TecplotStream :
public StreamBase<DataOutBase::TecplotFlags>
1199 write_point(
const unsigned int index,
const Point<dim> &);
1211 write_cell(
const unsigned int index,
1212 const unsigned int start,
1213 const std::array<unsigned int, dim> &
offsets);
1219 class UcdStream :
public StreamBase<DataOutBase::UcdFlags>
1226 write_point(
const unsigned int index,
const Point<dim> &);
1240 write_cell(
const unsigned int index,
1241 const unsigned int start,
1242 const std::array<unsigned int, dim> &
offsets);
1250 template <
typename data>
1252 write_dataset(
const unsigned int index,
const std::vector<data> &values);
1258 class VtkStream :
public StreamBase<DataOutBase::VtkFlags>
1265 write_point(
const unsigned int index,
const Point<dim> &);
1277 write_cell(
const unsigned int index,
1278 const unsigned int start,
1279 const std::array<unsigned int, dim> &
offsets);
1285 write_cell_single(
const unsigned int index,
1286 const unsigned int start,
1287 const unsigned int n_points,
1300 const std::vector<unsigned> &connectivity);
1313 DXStream::write_point(
const unsigned int,
const Point<dim> &p)
1315 if (flags.coordinates_binary)
1318 for (
unsigned int d = 0;
d < dim; ++
d)
1320 stream.write(
reinterpret_cast<const char *
>(data), dim *
sizeof(*data));
1324 for (
unsigned int d = 0;
d < dim; ++
d)
1325 stream << p(d) <<
'\t';
1339 std::array<unsigned int, GeometryInfo<0>::vertices_per_cell>
1341 const std::array<unsigned int, 0> & )
1349 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell>
1351 const std::array<unsigned int, 1> &
offsets)
1353 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell>
nodes;
1361 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>
1363 const std::array<unsigned int, 2> &
offsets)
1369 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>
nodes;
1379 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell>
1381 const std::array<unsigned int, 3> &
offsets)
1387 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell>
nodes;
1404 DXStream::write_cell(
const unsigned int,
1405 const unsigned int start,
1406 const std::array<unsigned int, dim> &
offsets)
1409 DataOutBaseImplementation::set_node_numbers(start,
offsets);
1411 if (flags.int_binary)
1413 std::array<unsigned int, GeometryInfo<dim>::vertices_per_cell>
temp;
1414 for (
unsigned int i = 0; i <
nodes.
size(); ++i)
1416 stream.write(
reinterpret_cast<const char *
>(
temp.
data()),
1421 for (
unsigned int i = 0; i <
nodes.
size() - 1; ++i)
1430 template <
typename data>
1432 DXStream::write_dataset(
const unsigned int,
const std::vector<data> &values)
1434 if (flags.data_binary)
1436 stream.write(
reinterpret_cast<const char *
>(
values.data()),
1437 values.size() *
sizeof(data));
1441 for (
unsigned int i = 0; i <
values.size(); ++i)
1442 stream <<
'\t' << values[i];
1458 GmvStream::write_point(
const unsigned int,
const Point<dim> &p)
1462 stream << p(selected_component) <<
' ';
1469 GmvStream::write_cell(
const unsigned int,
1470 const unsigned int s,
1471 const std::array<unsigned int, dim> &
offsets)
1474 const unsigned int start = s + 1;
1489 stream <<
'\t' << start +
d1;
1498 stream <<
'\t' << start +
d1;
1499 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1509 stream <<
'\t' << start +
d1;
1510 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1511 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1512 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1524 TecplotStream::TecplotStream(std::ostream & out,
1532 TecplotStream::write_point(
const unsigned int,
const Point<dim> &p)
1536 stream << p(selected_component) <<
'\n';
1543 TecplotStream::write_cell(
const unsigned int,
1544 const unsigned int s,
1545 const std::array<unsigned int, dim> &
offsets)
1547 const unsigned int start = s + 1;
1561 stream <<
'\t' << start +
d1;
1570 stream <<
'\t' << start +
d1;
1571 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1581 stream <<
'\t' << start +
d1;
1582 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1583 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1584 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1603 UcdStream::write_point(
const unsigned int index,
const Point<dim> &p)
1605 stream <<
index + 1 <<
" ";
1607 for (
unsigned int i = 0; i < dim; ++i)
1608 stream << p(i) <<
' ';
1610 for (
unsigned int i = dim; i < 3; ++i)
1619 UcdStream::write_cell(
const unsigned int index,
1620 const unsigned int start,
1621 const std::array<unsigned int, dim> &
offsets)
1624 DataOutBaseImplementation::set_node_numbers(start,
offsets);
1628 for (
unsigned int i = 0; i <
nodes.
size(); ++i)
1635 template <
typename data>
1637 UcdStream::write_dataset(
const unsigned int index,
1638 const std::vector<data> &values)
1640 stream <<
index + 1;
1641 for (
unsigned int i = 0; i <
values.size(); ++i)
1642 stream <<
'\t' << values[i];
1657 VtkStream::write_point(
const unsigned int,
const Point<dim> &p)
1662 for (
unsigned int i = dim; i < 3; ++i)
1671 VtkStream::write_cell(
const unsigned int,
1672 const unsigned int start,
1673 const std::array<unsigned int, dim> &
offsets)
1689 stream <<
'\t' << start +
d1;
1698 stream <<
'\t' << start +
d1;
1699 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1709 stream <<
'\t' << start +
d1;
1710 stream <<
'\t' << start +
d2 +
d1 <<
'\t' << start +
d2;
1711 stream <<
'\t' << start +
d3 <<
'\t' << start +
d3 +
d1 <<
'\t'
1712 << start +
d3 +
d2 +
d1 <<
'\t' << start +
d3 +
d2;
1725 VtkStream::write_cell_single(
const unsigned int index,
1726 const unsigned int start,
1727 const unsigned int n_points,
1732 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
1734 stream <<
'\t' << n_points;
1735 for (
unsigned int i = 0; i < n_points; ++i)
1744 VtkStream::write_high_order_cell(
const unsigned int start,
1745 const std::vector<unsigned> &connectivity)
1747 stream << connectivity.size();
1748 for (
const auto &c : connectivity)
1749 stream <<
'\t' << start + c;
1761 template <
int dim,
int spacedim>
1765 template <
int dim,
int spacedim>
1769 template <
int dim,
int spacedim>
1771 : patch_index(no_neighbor)
1773 , points_are_available(
false)
1787 template <
int dim,
int spacedim>
1791 if (reference_cell !=
patch.reference_cell)
1795 const double epsilon = 3e-16;
1801 if (neighbors[i] !=
patch.neighbors[i])
1804 if (patch_index !=
patch.patch_index)
1807 if (n_subdivisions !=
patch.n_subdivisions)
1810 if (points_are_available !=
patch.points_are_available)
1813 if (data.n_rows() !=
patch.
data.n_rows())
1816 if (data.n_cols() !=
patch.
data.n_cols())
1819 for (
unsigned int i = 0; i < data.n_rows(); ++i)
1820 for (
unsigned int j = 0;
j < data.n_cols(); ++
j)
1829 template <
int dim,
int spacedim>
1835 sizeof(neighbors) /
sizeof(neighbors[0]) *
1841 sizeof(reference_cell));
1846 template <
int dim,
int spacedim>
1853 std::swap(n_subdivisions,
other_patch.n_subdivisions);
1855 std::swap(points_are_available,
other_patch.points_are_available);
1856 std::swap(reference_cell,
other_patch.reference_cell);
1861 template <
int spacedim>
1865 template <
int spacedim>
1869 template <
int spacedim>
1873 template <
int spacedim>
1876 template <
int spacedim>
1880 template <
int spacedim>
1882 : patch_index(no_neighbor)
1883 , points_are_available(
false)
1890 template <
int spacedim>
1894 const unsigned int dim = 0;
1897 const double epsilon = 3e-16;
1902 if (patch_index !=
patch.patch_index)
1905 if (points_are_available !=
patch.points_are_available)
1908 if (data.n_rows() !=
patch.
data.n_rows())
1911 if (data.n_cols() !=
patch.
data.n_cols())
1914 for (
unsigned int i = 0; i < data.n_rows(); ++i)
1915 for (
unsigned int j = 0;
j < data.n_cols(); ++
j)
1924 template <
int spacedim>
1936 template <
int spacedim>
1943 std::swap(points_are_available,
other_patch.points_are_available);
1949 : write_preamble(write_preamble)
1964 : space_dimension_labels(
labels)
1978 const bool bicubic_patch,
1979 const bool external_data)
1981 , bicubic_patch(bicubic_patch)
1982 , external_data(external_data)
1987 const bool xdmf_hdf5_output)
1988 : filter_duplicate_vertices(filter_duplicate_vertices)
1989 , xdmf_hdf5_output(xdmf_hdf5_output)
1997 "Filter duplicate vertices",
2000 "Whether to remove duplicate vertex values. deal.II duplicates "
2001 "vertices once for each adjacent cell so that it can output "
2002 "discontinuous quantities for which there may be more than one "
2003 "value for each vertex position. Setting this flag to "
2004 "'true' will merge all of these values by selecting a "
2005 "random one and outputting this as 'the' value for the vertex. "
2006 "As long as the data to be output corresponds to continuous "
2007 "fields, merging vertices has no effect. On the other hand, "
2008 "if the data to be output corresponds to discontinuous fields "
2009 "(either because you are using a discontinuous finite element, "
2010 "or because you are using a DataPostprocessor that yields "
2011 "discontinuous data, or because the data to be output has been "
2012 "produced by entirely different means), then the data in the "
2013 "output file no longer faithfully represents the underlying data "
2014 "because the discontinuous field has been replaced by a "
2015 "continuous one. Note also that the filtering can not occur "
2016 "on processor boundaries. Thus, a filtered discontinuous field "
2017 "looks like a continuous field inside of a subdomain, "
2018 "but like a discontinuous field at the subdomain boundary."
2020 "In any case, filtering results in drastically smaller output "
2021 "files (smaller by about a factor of 2^dim).");
2026 "Whether the data will be used in an XDMF/HDF5 combination.");
2041 const bool int_binary,
2042 const bool coordinates_binary,
2043 const bool data_binary)
2044 : write_neighbors(write_neighbors)
2045 , int_binary(int_binary)
2046 , coordinates_binary(coordinates_binary)
2047 , data_binary(data_binary)
2048 , data_double(
false)
2058 "A boolean field indicating whether neighborship "
2059 "information between cells is to be written to the "
2060 "OpenDX output file");
2064 "Output format of integer numbers, which is "
2065 "either a text representation (ascii) or binary integer "
2066 "values of 32 or 64 bits length");
2070 "Output format of vertex coordinates, which is "
2071 "either a text representation (ascii) or binary "
2072 "floating point values of 32 or 64 bits length");
2076 "Output format of data values, which is "
2077 "either a text representation (ascii) or binary "
2078 "floating point values of 32 or 64 bits length");
2098 "A flag indicating whether a comment should be "
2099 "written to the beginning of the output file "
2100 "indicating date and time of creation as well "
2101 "as the creating program");
2115 const int azimuth_angle,
2116 const int polar_angle,
2117 const unsigned int line_thickness,
2119 const bool draw_colorbar)
2122 , height_vector(height_vector)
2123 , azimuth_angle(azimuth_angle)
2124 , polar_angle(polar_angle)
2125 , line_thickness(line_thickness)
2127 , draw_colorbar(draw_colorbar)
2138 "A flag indicating whether POVRAY should use smoothed "
2139 "triangles instead of the usual ones");
2143 "Whether POVRAY should use bicubic patches");
2147 "Whether camera and lighting information should "
2148 "be put into an external file \"data.inc\" or into "
2149 "the POVRAY input file");
2165 const unsigned int color_vector,
2167 const unsigned int size,
2168 const double line_width,
2169 const double azimut_angle,
2170 const double turn_angle,
2171 const double z_scaling,
2172 const bool draw_mesh,
2173 const bool draw_cells,
2174 const bool shade_cells,
2176 : height_vector(height_vector)
2177 , color_vector(color_vector)
2178 , size_type(size_type)
2180 , line_width(line_width)
2181 , azimut_angle(azimut_angle)
2182 , turn_angle(turn_angle)
2183 , z_scaling(z_scaling)
2184 , draw_mesh(draw_mesh)
2185 , draw_cells(draw_cells)
2186 , shade_cells(shade_cells)
2187 , color_function(color_function)
2237 else if (
x < (
sum22) / 4)
2239 else if (
x < (
sum13) / 4)
2312 "Number of the input vector that is to be used to "
2313 "generate height information");
2317 "Number of the input vector that is to be used to "
2318 "generate color information");
2322 "Whether width or height should be scaled to match "
2327 "The size (width or height) to which the eps output "
2328 "file is to be scaled");
2332 "The width in which the postscript renderer is to "
2337 "Angle of the viewing position against the vertical "
2342 "Angle of the viewing direction against the y-axis");
2346 "Scaling for the z-direction relative to the scaling "
2347 "used in x- and y-directions");
2351 "Whether the mesh lines, or only the surface should be "
2356 "Whether only the mesh lines, or also the interior of "
2357 "cells should be plotted. If this flag is false, then "
2358 "one can see through the mesh");
2362 "Whether the interior of cells shall be shaded");
2366 "default|grey scale|reverse grey scale"),
2367 "Name of a color function used to colorize mesh lines "
2368 "and/or cell interiors");
2378 if (prm.
get(
"Scale to width or height") ==
"width")
2390 if (prm.
get(
"Color function") ==
"default")
2392 else if (prm.
get(
"Color function") ==
"grey scale")
2394 else if (prm.
get(
"Color function") ==
"reverse grey scale")
2404 : compression_level(compression_level)
2409 : zone_name(zone_name)
2410 , solution_time(solution_time)
2424 const unsigned int cycle,
2425 const bool print_date_and_time,
2427 const bool write_higher_order_cells,
2428 const std::map<std::string, std::string> &physical_units)
2431 , print_date_and_time(print_date_and_time)
2432 , compression_level(compression_level)
2433 , write_higher_order_cells(write_higher_order_cells)
2434 , physical_units(physical_units)
2479 ExcMessage(
"The given file format name is not recognized: <" +
2491 return "none|dx|ucd|gnuplot|povray|eps|gmv|tecplot|vtk|vtu|hdf5|svg|deal.II intermediate";
2541 template <
int dim,
int spacedim>
2542 std::vector<Point<spacedim>>
2546 static const std::array<unsigned int, 5> table = {{0, 1, 3, 2, 4}};
2549 for (
const auto &
patch : patches)
2552 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2564 const unsigned int n_subdivisions =
patch.n_subdivisions;
2565 const unsigned int n = n_subdivisions + 1;
2574 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2579 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
2580 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2585 for (
unsigned int i3 = 0;
i3 < n; ++
i3)
2586 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
2587 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
2602 template <
int dim,
int spacedim,
typename StreamType>
2619 template <
int dim,
int spacedim,
typename StreamType>
2624 unsigned int count = 0;
2626 for (
const auto &
patch : patches)
2629 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2631 out.write_cell_single(
count++,
2634 patch.reference_cell);
2639 const unsigned int n_subdivisions =
patch.n_subdivisions;
2640 const unsigned int n = n_subdivisions + 1;
2653 constexpr unsigned int d1 = 1;
2655 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2657 const unsigned int offset =
2667 constexpr unsigned int d1 = 1;
2668 const unsigned int d2 = n;
2670 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
2671 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2673 const unsigned int offset =
2685 constexpr unsigned int d1 = 1;
2686 const unsigned int d2 = n;
2687 const unsigned int d3 = n * n;
2689 for (
unsigned int i3 = 0;
i3 < n_subdivisions; ++
i3)
2690 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
2691 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
2709 Utilities::fixed_power<dim>(n_subdivisions + 1);
2718 template <
int dim,
int spacedim,
typename StreamType>
2727 std::vector<unsigned> connectivity;
2729 for (
const auto &
patch : patches)
2731 if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
2733 connectivity.resize(
patch.
data.n_cols());
2736 connectivity[i] = i;
2745 const unsigned int n_subdivisions =
patch.n_subdivisions;
2746 const unsigned int n = n_subdivisions + 1;
2748 connectivity.resize(Utilities::fixed_power<dim>(n));
2755 ExcMessage(
"Point-like cells should not be possible "
2756 "when writing higher-order cells."));
2761 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2765 patch.reference_cell
2775 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1; ++
i2)
2776 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2780 patch.reference_cell
2783 {{n_subdivisions, n_subdivisions}},
2792 for (
unsigned int i3 = 0;
i3 < n_subdivisions + 1; ++
i3)
2793 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1; ++
i2)
2794 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1; ++
i1)
2797 i3 * n * n +
i2 * n +
i1;
2799 patch.reference_cell
2829 template <
int dim,
int spacedim,
class StreamType>
2832 unsigned int n_data_sets,
2837 unsigned int count = 0;
2839 for (
const auto &
patch : patches)
2841 const unsigned int n_subdivisions =
patch.n_subdivisions;
2842 const unsigned int n = n_subdivisions + 1;
2845 !
patch.points_are_available) ||
2846 (
patch.
data.n_rows() == n_data_sets + spacedim &&
2847 patch.points_are_available),
2849 (n_data_sets + spacedim) :
2851 patch.data.n_rows()));
2855 std::vector<float>
floats(n_data_sets);
2856 std::vector<double>
doubles(n_data_sets);
2955 for (
int i = 0; i < 2; ++i)
2957 for (
int j = 0;
j < 2 - i; ++
j)
2959 if (points[
j][2] > points[
j + 1][2])
2962 points[
j] = points[
j + 1];
2995 double temp = A[1][0];
3000 for (
unsigned int k = 0;
k < 1; ++
k)
3002 for (
unsigned int i =
k + 1; i < 2; ++i)
3004 x = A[i][
k] / A[
k][
k];
3006 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3007 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3009 b[i] = b[i] - b[
k] *
x;
3013 b[1] =
b[1] / A[1][1];
3015 for (
int i = 0; i >= 0; i--)
3019 for (
unsigned int j = i + 1;
j < 2; ++
j)
3020 sum = sum - A[i][
j] * b[
j];
3022 b[i] = sum / A[i][i];
3041 b[0] = 1.0 -
v_min[0];
3058 for (
unsigned int k = 0;
k < 1; ++
k)
3060 for (
unsigned int i =
k + 1; i < 2; ++i)
3062 x = A[i][
k] / A[
k][
k];
3064 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3065 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3067 b[i] = b[i] - b[
k] *
x;
3071 b[1] =
b[1] / A[1][1];
3073 for (
int i = 0; i >= 0; i--)
3077 for (
unsigned int j = i + 1;
j < 2; ++
j)
3078 sum = sum - A[i][
j] * b[
j];
3080 b[i] =
sum / A[i][i];
3100 b[1] = 1.0 -
v_min[1];
3111 double temp = A[1][0];
3116 for (
unsigned int k = 0;
k < 1; ++
k)
3118 for (
unsigned int i =
k + 1; i < 2; ++i)
3120 x = A[i][
k] / A[
k][
k];
3122 for (
unsigned int j =
k + 1;
j < 2; ++
j)
3123 A[i][
j] = A[i][
j] - A[
k][
j] *
x;
3125 b[i] = b[i] - b[
k] *
x;
3129 b[1] =
b[1] / A[1][1];
3131 for (
int i = 0; i >= 0; i--)
3135 for (
unsigned int j = i + 1;
j < 2; ++
j)
3136 sum = sum - A[i][
j] * b[
j];
3138 b[i] =
sum / A[i][i];
3174 template <
int dim,
int spacedim>
3180 std::tuple<
unsigned int,
3193#ifndef DEAL_II_WITH_MPI
3202 if (patches.size() == 0)
3208 UcdStream
ucd_out(out, flags);
3211 unsigned int n_nodes;
3212 unsigned int n_cells;
3219 <<
"# This file was generated by the deal.II library." <<
'\n'
3223 <<
"# For a description of the UCD format see the AVS Developer's guide."
3229 out << n_nodes <<
' ' << n_cells <<
' ' << n_data_sets <<
' ' << 0
3242 if (n_data_sets != 0)
3244 out << n_data_sets <<
" ";
3245 for (
unsigned int i = 0; i < n_data_sets; ++i)
3265 template <
int dim,
int spacedim>
3271 std::tuple<
unsigned int,
3283#ifndef DEAL_II_WITH_MPI
3292 if (patches.size() == 0)
3296 DXStream
dx_out(out, flags);
3299 unsigned int offset = 0;
3304 unsigned int n_nodes;
3305 unsigned int n_cells;
3309 out <<
"object \"vertices\" class array type float rank 1 shape "
3310 << spacedim <<
" items " << n_nodes;
3314 out <<
" lsb ieee data 0" <<
'\n';
3315 offset += n_nodes * spacedim *
sizeof(float);
3319 out <<
" data follows" <<
'\n';
3328 out <<
"object \"cells\" class array type int rank 1 shape "
3333 out <<
" lsb binary data " << offset <<
'\n';
3334 offset += n_cells *
sizeof(
int);
3338 out <<
" data follows" <<
'\n';
3344 out <<
"attribute \"element type\" string \"";
3351 out <<
"\"" <<
'\n' <<
"attribute \"ref\" string \"positions\"" <<
'\n';
3358 out <<
"object \"neighbors\" class array type int rank 1 shape "
3362 for (
const auto &
patch : patches)
3364 const unsigned int n =
patch.n_subdivisions;
3365 const unsigned int n1 = (dim > 0) ? n : 1;
3366 const unsigned int n2 = (dim > 1) ? n : 1;
3367 const unsigned int n3 = (dim > 2) ? n : 1;
3368 const unsigned int x_minus = (dim > 0) ? 0 : 0;
3369 const unsigned int x_plus = (dim > 0) ? 1 : 0;
3370 const unsigned int y_minus = (dim > 1) ? 2 : 0;
3371 const unsigned int y_plus = (dim > 1) ? 3 : 0;
3372 const unsigned int z_minus = (dim > 2) ? 4 : 0;
3373 const unsigned int z_plus = (dim > 2) ? 5 : 0;
3375 unsigned int dx = 1;
3376 unsigned int dy = n;
3377 unsigned int dz = n * n;
3382 for (
unsigned int i3 = 0;
i3 <
n3; ++
i3)
3383 for (
unsigned int i2 = 0;
i2 <
n2; ++
i2)
3384 for (
unsigned int i1 = 0;
i1 <
n1; ++
i1)
3386 const unsigned int nx =
i1 *
dx;
3387 const unsigned int ny =
i2 * dy;
3388 const unsigned int nz =
i3 *
dz;
3495 if (n_data_sets != 0)
3497 out <<
"object \"data\" class array type float rank 1 shape "
3498 << n_data_sets <<
" items " << n_nodes;
3502 out <<
" lsb ieee data " << offset <<
'\n';
3503 offset += n_data_sets * n_nodes *
3504 ((flags.
data_double) ?
sizeof(
double) :
sizeof(float));
3508 out <<
" data follows" <<
'\n';
3513 out <<
"attribute \"dep\" string \"positions\"" <<
'\n';
3517 out <<
"object \"data\" class constantarray type float rank 0 items "
3518 << n_nodes <<
" data follows" <<
'\n'
3524 out <<
"object \"deal data\" class field" <<
'\n'
3525 <<
"component \"positions\" value \"vertices\"" <<
'\n'
3526 <<
"component \"connections\" value \"cells\"" <<
'\n'
3527 <<
"component \"data\" value \"data\"" <<
'\n';
3530 out <<
"component \"neighbors\" value \"neighbors\"" <<
'\n';
3537 out <<
"end" <<
'\n';
3555 template <
int dim,
int spacedim>
3561 std::tuple<
unsigned int,
3570#ifndef DEAL_II_WITH_MPI
3580 if (patches.size() == 0)
3588 out <<
"# This file was generated by the deal.II library." <<
'\n'
3592 <<
"# For a description of the GNUPLOT format see the GNUPLOT manual."
3611 for (
const auto &
patch : patches)
3613 const unsigned int n_subdivisions =
patch.n_subdivisions;
3617 !
patch.points_are_available) ||
3618 (
patch.
data.n_rows() == n_data_sets + spacedim &&
3619 patch.points_are_available),
3621 (n_data_sets + spacedim) :
3639 n_subdivisions + 1));
3658 n_subdivisions + 1));
3682 n_subdivisions + 1));
3757 n_subdivisions + 1));
3774 if (
i1 < n_subdivisions)
3797 out <<
'\n' <<
'\n';
3801 if (
i2 < n_subdivisions)
3824 out <<
'\n' <<
'\n';
3828 if (
i3 < n_subdivisions)
3850 out <<
'\n' <<
'\n';
3859 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
3867 for (
const unsigned int v : {3, 1})
3880 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
3888 for (
const unsigned int v : {2, 4, 3})
3905 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
3913 for (
const unsigned int v : {1, 4})
3921 for (
const unsigned int v : {2, 5})
3949 template <
int dim,
int spacedim>
3952 const std::vector<std::string> &,
3953 const PovrayFlags &,
3957 ExcMessage(
"Writing files in POVRAY format is only supported "
3958 "for two-dimensional meshes."));
3966 const PovrayFlags & flags,
3971#ifndef DEAL_II_WITH_MPI
3980 if (patches.size() == 0)
3983 constexpr int dim = 2;
3985 constexpr int spacedim = 2;
3993 <<
"/* This file was generated by the deal.II library." <<
'\n'
3997 <<
" For a description of the POVRAY format see the POVRAY manual."
4002 out <<
"#include \"colors.inc\" " <<
'\n'
4003 <<
"#include \"textures.inc\" " <<
'\n';
4007 if (flags.external_data)
4008 out <<
"#include \"data.inc\" " <<
'\n';
4014 <<
"camera {" <<
'\n'
4015 <<
" location <1,4,-7>" <<
'\n'
4016 <<
" look_at <0,0,0>" <<
'\n'
4017 <<
" angle 30" <<
'\n'
4022 <<
"light_source {" <<
'\n'
4023 <<
" <1,4,-7>" <<
'\n'
4024 <<
" color Grey" <<
'\n'
4027 <<
"light_source {" <<
'\n'
4028 <<
" <0,20,0>" <<
'\n'
4029 <<
" color White" <<
'\n'
4036 double hmin = patches[0].
data(0, 0);
4037 double hmax = patches[0].
data(0, 0);
4039 for (
const auto &
patch : patches)
4041 const unsigned int n_subdivisions =
patch.n_subdivisions;
4044 !
patch.points_are_available) ||
4045 (
patch.
data.n_rows() == n_data_sets + spacedim &&
4046 patch.points_are_available),
4048 (n_data_sets + spacedim) :
4050 patch.data.n_rows()));
4052 Utilities::fixed_power<dim>(n_subdivisions + 1),
4054 n_subdivisions + 1));
4056 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
4057 for (
unsigned int j = 0;
j < n_subdivisions + 1; ++
j)
4059 const int dl = i * (n_subdivisions + 1) +
j;
4067 out <<
"#declare HMIN=" <<
hmin <<
";" <<
'\n'
4068 <<
"#declare HMAX=" <<
hmax <<
";" <<
'\n'
4071 if (!flags.external_data)
4074 out <<
"#declare Tex=texture{" <<
'\n'
4075 <<
" pigment {" <<
'\n'
4076 <<
" gradient y" <<
'\n'
4077 <<
" scale y*(HMAX-HMIN)*" << 0.1 <<
'\n'
4078 <<
" color_map {" <<
'\n'
4079 <<
" [0.00 color Light_Purple] " <<
'\n'
4080 <<
" [0.95 color Light_Purple] " <<
'\n'
4081 <<
" [1.00 color White] " <<
'\n'
4086 if (!flags.bicubic_patch)
4089 out <<
'\n' <<
"mesh {" <<
'\n';
4093 for (
const auto &
patch : patches)
4095 const unsigned int n_subdivisions =
patch.n_subdivisions;
4096 const unsigned int n = n_subdivisions + 1;
4097 const unsigned int d1 = 1;
4098 const unsigned int d2 = n;
4101 !
patch.points_are_available) ||
4102 (
patch.
data.n_rows() == n_data_sets + spacedim &&
4103 patch.points_are_available),
4105 (n_data_sets + spacedim) :
4107 patch.data.n_rows()));
4110 n_subdivisions + 1));
4113 std::vector<Point<spacedim>>
ver(n * n);
4115 for (
unsigned int i2 = 0;
i2 < n; ++
i2)
4116 for (
unsigned int i1 = 0;
i1 < n; ++
i1)
4124 if (!flags.bicubic_patch)
4127 std::vector<Point<3>>
nrml;
4137 for (
unsigned int i = 0; i < n; ++i)
4138 for (
unsigned int j = 0;
j < n; ++
j)
4140 const unsigned int il = (i == 0) ? i : (i - 1);
4141 const unsigned int ir =
4142 (i == n_subdivisions) ? i : (i + 1);
4143 const unsigned int jl = (
j == 0) ?
j : (
j - 1);
4144 const unsigned int jr =
4145 (
j == n_subdivisions) ?
j : (
j + 1);
4177 for (
unsigned int k = 0;
k < 3; ++
k)
4183 for (
unsigned int i = 0; i < n_subdivisions; ++i)
4184 for (
unsigned int j = 0;
j < n_subdivisions; ++
j)
4187 const int dl = i *
d1 +
j *
d2;
4193 out <<
"smooth_triangle {" <<
'\n'
4198 out <<
" \t<" <<
ver[
dl +
d1](0) <<
","
4200 <<
">, <" <<
nrml[
dl +
d1](0) <<
", "
4203 out <<
"\t<" <<
ver[
dl +
d1 +
d2](0) <<
","
4211 out <<
"smooth_triangle {" <<
'\n'
4216 out <<
"\t<" <<
ver[
dl +
d1 +
d2](0) <<
","
4222 out <<
"\t<" <<
ver[
dl +
d2](0) <<
","
4224 <<
">, <" <<
nrml[
dl +
d2](0) <<
", "
4231 out <<
"triangle {" <<
'\n'
4233 <<
"," <<
ver[
dl](1) <<
">," <<
'\n';
4234 out <<
"\t<" <<
ver[
dl +
d1](0) <<
","
4237 out <<
"\t<" <<
ver[
dl +
d1 +
d2](0) <<
","
4239 <<
ver[
dl +
d1 +
d2](1) <<
">}" <<
'\n';
4242 out <<
"triangle {" <<
'\n'
4244 <<
"," <<
ver[
dl](1) <<
">," <<
'\n';
4245 out <<
"\t<" <<
ver[
dl +
d1 +
d2](0) <<
","
4247 <<
ver[
dl +
d1 +
d2](1) <<
">," <<
'\n';
4248 out <<
"\t<" <<
ver[
dl +
d2](0) <<
","
4257 Assert(n_subdivisions == 3,
4260 <<
"bicubic_patch {" <<
'\n'
4261 <<
" type 0" <<
'\n'
4262 <<
" flatness 0" <<
'\n'
4263 <<
" u_steps 0" <<
'\n'
4264 <<
" v_steps 0" <<
'\n';
4265 for (
int i = 0; i < 16; ++i)
4267 out <<
"\t<" <<
ver[i](0) <<
"," <<
patch.
data(0, i) <<
","
4268 <<
ver[i](1) <<
">";
4273 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n';
4277 if (!flags.bicubic_patch)
4280 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n' <<
'\n';
4292 template <
int dim,
int spacedim>
4298 std::tuple<
unsigned int,
4310 template <
int dim,
int spacedim>
4314 const std::vector<std::string> & ,
4316 std::tuple<
unsigned int,
4328 template <
int spacedim>
4332 const std::vector<std::string> & ,
4334 std::tuple<
unsigned int,
4343#ifndef DEAL_II_WITH_MPI
4352 if (patches.size() == 0)
4362 std::multiset<EpsCell2d> cells;
4371 double heights[4] = {0, 0, 0, 0};
4375 for (
const auto &
patch : patches)
4377 const unsigned int n_subdivisions =
patch.n_subdivisions;
4378 const unsigned int n = n_subdivisions + 1;
4379 const unsigned int d1 = 1;
4380 const unsigned int d2 = n;
4382 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
4383 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
4428 for (
unsigned int i = 0; i < 4; ++i)
4454 for (
unsigned int vertex = 0; vertex < 4; ++vertex)
4456 const double x = points[vertex](0),
y = points[vertex](1),
4485 (points[0] + points[1] + points[2] + points[3]) / 4;
4537 double x_min = cells.
begin()->vertices[0](0);
4539 double y_min = cells.
begin()->vertices[0](1);
4542 for (
const auto &cell : cells)
4543 for (
const auto &vertex : cell.vertices)
4553 const double scale =
4562 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4563 <<
"%%Title: deal.II Output" <<
'\n'
4564 <<
"%%Creator: the deal.II library" <<
'\n'
4567 <<
"%%BoundingBox: "
4571 <<
static_cast<unsigned int>((
x_max -
x_min) * scale + 0.5) <<
' '
4572 <<
static_cast<unsigned int>((
y_max -
y_min) * scale + 0.5) <<
'\n';
4581 out <<
"/m {moveto} bind def" <<
'\n'
4582 <<
"/l {lineto} bind def" <<
'\n'
4583 <<
"/s {setrgbcolor} bind def" <<
'\n'
4584 <<
"/sg {setgray} bind def" <<
'\n'
4585 <<
"/lx {lineto closepath stroke} bind def" <<
'\n'
4586 <<
"/lf {lineto closepath fill} bind def" <<
'\n';
4588 out <<
"%%EndProlog" <<
'\n' <<
'\n';
4590 out << flags.
line_width <<
" setlinewidth" <<
'\n';
4603 for (
const auto &cell : cells)
4624 out << (cell.vertices[0] - offset) * scale <<
" m "
4625 << (cell.vertices[1] - offset) * scale <<
" l "
4626 << (cell.vertices[3] - offset) * scale <<
" l "
4627 << (cell.vertices[2] - offset) * scale <<
" lf" <<
'\n';
4632 << (cell.vertices[0] - offset) * scale <<
" m "
4633 << (cell.vertices[1] - offset) * scale <<
" l "
4634 << (cell.vertices[3] - offset) * scale <<
" l "
4635 << (cell.vertices[2] - offset) * scale <<
" lx" <<
'\n';
4637 out <<
"showpage" <<
'\n';
4646 template <
int dim,
int spacedim>
4652 std::tuple<
unsigned int,
4668#ifndef DEAL_II_WITH_MPI
4677 if (patches.size() == 0)
4681 GmvStream
gmv_out(out, flags);
4685 Assert((patches[0].data.n_rows() == n_data_sets &&
4686 !patches[0].points_are_available) ||
4687 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4688 patches[0].points_are_available),
4690 (n_data_sets + spacedim) :
4692 patches[0].data.n_rows()));
4696 out <<
"gmvinput ascii" <<
'\n' <<
'\n';
4699 unsigned int n_nodes;
4700 unsigned int n_cells;
4722 out <<
"nodes " << n_nodes <<
'\n';
4723 for (
unsigned int d = 0; d < spacedim; ++d)
4725 gmv_out.selected_component = d;
4731 for (
unsigned int d = spacedim; d < 3; ++d)
4733 for (
unsigned int i = 0; i < n_nodes; ++i)
4740 out <<
"cells " << n_cells <<
'\n';
4745 out <<
"variable" <<
'\n';
4758 std::ostream_iterator<double>(out,
" "));
4759 out <<
'\n' <<
'\n';
4765 out <<
"endvars" <<
'\n';
4768 out <<
"endgmv" <<
'\n';
4779 template <
int dim,
int spacedim>
4785 std::tuple<
unsigned int,
4799#ifndef DEAL_II_WITH_MPI
4808 if (patches.size() == 0)
4817 Assert((patches[0].data.n_rows() == n_data_sets &&
4818 !patches[0].points_are_available) ||
4819 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4820 patches[0].points_are_available),
4822 (n_data_sets + spacedim) :
4824 patches[0].data.n_rows()));
4827 unsigned int n_nodes;
4828 unsigned int n_cells;
4835 <<
"# This file was generated by the deal.II library." <<
'\n'
4839 <<
"# For a description of the Tecplot format see the Tecplot documentation."
4844 out <<
"Variables=";
4852 out <<
"\"x\", \"y\"";
4855 out <<
"\"x\", \"y\", \"z\"";
4868 out <<
"t=\"" << flags.
zone_name <<
"\" ";
4871 out <<
"strandid=1, solutiontime=" << flags.
solution_time <<
", ";
4873 out <<
"f=feblock, n=" << n_nodes <<
", e=" << n_cells
4897 for (
unsigned int d = 0; d < spacedim; ++d)
4917 std::ostream_iterator<double>(out,
"\n"));
4932 template <
int dim,
int spacedim>
4938 std::tuple<
unsigned int,
4942 & nonscalar_data_ranges,
4948#ifndef DEAL_II_WITH_MPI
4957 if (patches.size() == 0)
4961 VtkStream
vtk_out(out, flags);
4965 if (patches[0].points_are_available)
4977 out <<
"# vtk DataFile Version 3.0" <<
'\n'
4978 <<
"#This file was generated by the deal.II library";
4986 out <<
'\n' <<
"ASCII" <<
'\n';
4988 out <<
"DATASET UNSTRUCTURED_GRID\n" <<
'\n';
4996 ((flags.
cycle != std::numeric_limits<unsigned int>::min() ? 1 : 0) +
4997 (flags.
time != std::numeric_limits<double>::min() ? 1 : 0));
5000 out <<
"FIELD FieldData " <<
n_metadata <<
'\n';
5002 if (flags.
cycle != std::numeric_limits<unsigned int>::min())
5004 out <<
"CYCLE 1 1 int\n" << flags.
cycle <<
'\n';
5006 if (flags.
time != std::numeric_limits<double>::min())
5008 out <<
"TIME 1 1 double\n" << flags.
time <<
'\n';
5014 unsigned int n_nodes;
5015 unsigned int n_cells;
5039 out <<
"POINTS " << n_nodes <<
" double" <<
'\n';
5052 out <<
"CELL_TYPES " << n_cells <<
'\n';
5056 for (
const auto &
patch : patches)
5076 out <<
"POINT_DATA " << n_nodes <<
'\n';
5086 "The VTK writer does not currently support outputting "
5087 "tensor data. Use the VTU writer instead."));
5101 "Can't declare a vector with more than 3 components "
5125 out <<
" double" <<
'\n';
5128 for (
unsigned int n = 0; n < n_nodes; ++n)
5166 <<
"LOOKUP_TABLE default" <<
'\n';
5169 std::ostream_iterator<double>(out,
" "));
5185 out <<
"<?xml version=\"1.0\" ?> \n";
5187 out <<
"# vtk DataFile Version 3.0" <<
'\n'
5188 <<
"#This file was generated by the deal.II library";
5199 out <<
"<VTKFile type=\"UnstructuredGrid\" version=\"2.2\"";
5201 out <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\"";
5204 out <<
" compressor=\"vtkZLibDataCompressor\"";
5205#ifdef DEAL_II_WORDS_BIGENDIAN
5206 out <<
" byte_order=\"BigEndian\"";
5208 out <<
" byte_order=\"LittleEndian\"";
5212 out <<
"<UnstructuredGrid>";
5222 out <<
" </UnstructuredGrid>\n";
5223 out <<
"</VTKFile>\n";
5228 template <
int dim,
int spacedim>
5234 std::tuple<
unsigned int,
5238 & nonscalar_data_ranges,
5250 template <
int dim,
int spacedim>
5256 std::tuple<
unsigned int,
5260 & nonscalar_data_ranges,
5274 unit.second.find(
'\"') == std::string::npos,
5276 "A physical unit you provided, <" +
unit.second +
5277 ">, contained a quotation mark character. This is not allowed."));
5280#ifndef DEAL_II_WITH_MPI
5289 if (patches.size() == 0)
5294 out <<
"<Piece NumberOfPoints=\"0\" NumberOfCells=\"0\" >\n"
5296 <<
"<DataArray type=\"UInt8\" Name=\"types\"></DataArray>\n"
5298 <<
" <PointData Scalars=\"scalars\">\n";
5310 out <<
" <DataArray type=\"Float32\" Name=\"";
5323 out <<
"\" NumberOfComponents=\"3\"></DataArray>\n";
5330 out <<
" <DataArray type=\"Float32\" Name=\""
5334 out <<
" </PointData>\n";
5335 out <<
"</Piece>\n";
5350 ((flags.
cycle != std::numeric_limits<unsigned int>::min() ? 1 : 0) +
5351 (flags.
time != std::numeric_limits<double>::min() ? 1 : 0));
5353 out <<
"<FieldData>\n";
5355 if (flags.
cycle != std::numeric_limits<unsigned int>::min())
5358 <<
"<DataArray type=\"Float32\" Name=\"CYCLE\" NumberOfTuples=\"1\" format=\"ascii\">"
5359 << flags.
cycle <<
"</DataArray>\n";
5361 if (flags.
time != std::numeric_limits<double>::min())
5364 <<
"<DataArray type=\"Float32\" Name=\"TIME\" NumberOfTuples=\"1\" format=\"ascii\">"
5365 << flags.
time <<
"</DataArray>\n";
5369 out <<
"</FieldData>\n";
5376 if (patches[0].points_are_available)
5393 unsigned int n_nodes;
5394 unsigned int n_cells;
5395 std::tie(n_nodes, n_cells, std::ignore) =
5408 std::ostringstream
o;
5410 o <<
" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\""
5421 for (
unsigned int d = 0; d < 3; ++d)
5431 o <<
" </DataArray>\n";
5432 o <<
" </Points>\n\n";
5445 out.precision()]() {
5446 std::ostringstream
o;
5449 o <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\""
5452 std::vector<int32_t> cells;
5457 for (
const auto &
patch : patches)
5466 (
patch.reference_cell == ReferenceCells::get_simplex<dim>()) &&
5467 (
patch.n_subdivisions == 2))
5469 const unsigned int n_points =
patch.
data.n_cols();
5470 Assert((dim == 2 && n_points == 6) ||
5471 (dim == 3 && n_points == 10),
5478 for (
unsigned int i = 0; i < n_points; ++i)
5483 for (
unsigned int i = 0; i < n_points; ++i)
5493 else if (
patch.reference_cell != ReferenceCells::get_hypercube<dim>())
5497 const unsigned int n_points =
patch.
data.n_cols();
5503 for (
unsigned int i = 0; i < n_points; ++i)
5506 patch.reference_cell.vtk_vertex_to_deal_vertex(i));
5510 for (
unsigned int i = 0; i < n_points; ++i)
5513 patch.reference_cell.vtk_vertex_to_deal_vertex(i));
5521 const unsigned int n_subdivisions =
patch.n_subdivisions;
5565 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
5578 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
5579 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
5598 for (
unsigned int i3 = 0;
i3 < n_subdivisions; ++
i3)
5599 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
5600 for (
unsigned int i1 = 0;
i1 < n_subdivisions;
5654 "Point-like cells should not be possible "
5655 "when writing higher-order cells."));
5660 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5665 patch.reference_cell
5679 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1;
5681 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5687 patch.reference_cell
5688 .template vtk_lexicographic_to_node_index<
5690 {{n_subdivisions, n_subdivisions}},
5701 for (
unsigned int i3 = 0;
i3 < n_subdivisions + 1;
5703 for (
unsigned int i2 = 0;
i2 < n_subdivisions + 1;
5705 for (
unsigned int i1 = 0;
i1 < n_subdivisions + 1;
5713 patch.reference_cell
5714 .template vtk_lexicographic_to_node_index<
5735 Utilities::fixed_power<dim>(
patch.n_subdivisions + 1);
5748 o <<
" </DataArray>\n";
5774 std::ostringstream
o;
5776 o <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\""
5784 std::vector<unsigned int> cell_types;
5785 cell_types.reserve(n_cells);
5789 for (
const auto &
patch : patches)
5806 o <<
" </DataArray>\n";
5808 o <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\""
5815 for (
unsigned int i = 0; i < cell_types.size(); ++i)
5830 o <<
" </DataArray>\n";
5847 const auto &
range) {
5848 std::ostringstream
o;
5850 const auto first_component = std::get<0>(
range);
5852 const auto &name = std::get<2>(
range);
5854 (std::get<3>(
range) ==
5856 const unsigned int n_components = (
is_tensor ? 9 : 3);
5865 "Can't declare a tensor with more than 9 components "
5866 "in VTK/VTU format."));
5872 "Can't declare a vector with more than 3 components "
5873 "in VTK/VTU format."));
5878 o <<
" <DataArray type=\"Float32\" Name=\"";
5889 o <<
"\" NumberOfComponents=\"" << n_components <<
"\" format=\""
5909 std::vector<float> data;
5910 data.reserve(n_nodes * n_components);
5912 for (
unsigned int n = 0; n < n_nodes; ++n)
5955 for (
unsigned int c = 0; c < size; ++c)
5966 for (
unsigned int c = 0; c < size; ++c)
5982 for (
unsigned int i = 0; i < 3; ++i)
5983 for (
unsigned int j = 0;
j < 3; ++
j)
5992 o <<
" </DataArray>\n";
6003 std::ostringstream
o;
6021 o <<
" </DataArray>\n";
6061 for (
const auto &
range : nonscalar_data_ranges)
6064 const auto first_component = std::get<0>(
range);
6085 out <<
"<Piece NumberOfPoints=\"" << n_nodes <<
"\" NumberOfCells=\""
6086 << n_cells <<
"\" >\n";
6087 for (
const auto &s :
mesh_tasks.return_values())
6089 out <<
" <PointData Scalars=\"scalars\">\n";
6090 for (
const auto &s :
data_tasks.return_values())
6092 out <<
" </PointData>\n";
6093 out <<
" </Piece>\n";
6110 std::tuple<
unsigned int,
6114 & nonscalar_data_ranges,
6127 unit.second.find(
'\"') == std::string::npos,
6129 "A physical unit you provided, <" +
unit.second +
6130 ">, contained a quotation mark character. This is not allowed."));
6135 out <<
"<?xml version=\"1.0\"?>\n";
6138 out <<
"#This file was generated by the deal.II library"
6143 <<
"<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
6144 out <<
" <PUnstructuredGrid GhostLevel=\"0\">\n";
6145 out <<
" <PPointData Scalars=\"scalars\">\n";
6156 const unsigned int n_components = (
is_tensor ? 9 : 3);
6165 "Can't declare a tensor with more than 9 components "
6172 "Can't declare a vector with more than 3 components "
6184 out <<
" <PDataArray type=\"Float32\" Name=\"";
6198 out <<
"\" NumberOfComponents=\"" << n_components
6199 <<
"\" format=\"ascii\"";
6226 out <<
" <PDataArray type=\"Float32\" Name=\""
6237 out <<
" </PPointData>\n";
6239 out <<
" <PPoints>\n";
6240 out <<
" <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
6241 out <<
" </PPoints>\n";
6244 out <<
" <Piece Source=\"" <<
piece_name <<
"\"/>\n";
6246 out <<
" </PUnstructuredGrid>\n";
6247 out <<
"</VTKFile>\n";
6264 out <<
"<?xml version=\"1.0\"?>\n";
6267 out <<
"#This file was generated by the deal.II library"
6272 <<
"<VTKFile type=\"Collection\" version=\"0.1\" ByteOrder=\"LittleEndian\">\n";
6273 out <<
" <Collection>\n";
6275 std::streamsize
ss = out.precision();
6280 <<
"\" group=\"\" part=\"0\" file=\"" <<
time_and_name.second
6283 out <<
" </Collection>\n";
6284 out <<
"</VTKFile>\n";
6309 const std::vector<std::vector<std::string>> &
piece_names)
6318 ExcMessage(
"piece_names should be a vector of nonempty vectors."));
6320 out <<
"!NBLOCKS " <<
nblocks <<
'\n';
6325 "piece_names should be a vector of equal sized vectors."));
6338 const std::vector<std::pair<
double, std::vector<std::string>>>
6350 "time_and_piece_names should contain nonempty vectors of filenames for every timestep."));
6353 out <<
"!TIME " <<
domain.first <<
'\n';
6355 out <<
"!NBLOCKS " <<
nblocks <<
'\n';
6360 "piece_names should be a vector of equal sized vectors."));
6370 template <
int dim,
int spacedim>
6374 const std::vector<std::string> &,
6376 std::tuple<
unsigned int,
6386 template <
int spacedim>
6390 const std::vector<std::string> & ,
6392 std::tuple<
unsigned int,
6400 const unsigned int height = flags.
height;
6401 unsigned int width = flags.
width;
6414 unsigned int n_subdivisions =
first_patch.n_subdivisions;
6415 unsigned int n = n_subdivisions + 1;
6416 const unsigned int d1 = 1;
6417 const unsigned int d2 = n;
6443 for (
const auto &
patch : patches)
6445 n_subdivisions =
patch.n_subdivisions;
6446 n = n_subdivisions + 1;
6448 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6450 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6498 std::min<double>(
z_min,
6512 std::max<double>(
z_max,
6631 n = n_subdivisions + 1;
6661 for (
const auto &
patch : patches)
6663 n_subdivisions =
patch.n_subdivisions;
6664 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6666 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6682 const std::array<Point<3>, 4>
vertices = {
6728 static_cast<double>(
6732 static_cast<double>(
6736 static_cast<double>(
6740 static_cast<double>(
6745 static_cast<double>(
6749 static_cast<double>(
6753 static_cast<double>(
6757 static_cast<double>(
6762 static_cast<double>(
6766 static_cast<double>(
6770 static_cast<double>(
6774 static_cast<double>(
6779 static_cast<double>(
6783 static_cast<double>(
6787 static_cast<double>(
6791 static_cast<double>(
6800 std::multiset<SvgCell> cells;
6803 for (
const auto &
patch : patches)
6805 n_subdivisions =
patch.n_subdivisions;
6807 for (
unsigned int i2 = 0;
i2 < n_subdivisions; ++
i2)
6809 for (
unsigned int i1 = 0;
i1 < n_subdivisions; ++
i1)
6829 cell.vertices[0][2] =
patch.
data.n_rows() != 0 ?
6835 cell.vertices[1][2] =
patch.
data.n_rows() != 0 ?
6841 cell.vertices[2][2] =
patch.
data.n_rows() != 0 ?
6847 cell.vertices[3][2] =
6852 cell.projected_vertices[0] =
6858 cell.projected_vertices[1] =
6864 cell.projected_vertices[2] =
6870 cell.projected_vertices[3] =
6877 cell.center = .25 * (cell.vertices[0] + cell.vertices[1] +
6878 cell.vertices[2] + cell.vertices[3]);
6895 width =
static_cast<unsigned int>(
6905 << height <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">"
6908 << height <<
"\" style=\"fill:white\"/>" <<
'\n'
6914 for (
const auto &cell : cells)
6964 unsigned int stop_i =
static_cast<unsigned int>(
stop_h * 6.);
7006 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7009 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7014 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7017 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7021 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_f),
7026 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_q);
7057 <<
"\" gradientUnits=\"userSpaceOnUse\" "
7059 <<
static_cast<unsigned int>(
7067 <<
static_cast<unsigned int>(
7074 <<
static_cast<unsigned int>(
7082 <<
static_cast<unsigned int>(
7089 <<
" <stop offset=\"0\" style=\"stop-color:rgb(" <<
start_r
7091 <<
" <stop offset=\"1\" style=\"stop-color:rgb(" <<
stop_r
7093 <<
" </linearGradient>" <<
'\n';
7096 double x1 = 0,
y1 = 0,
x2 = 0,
y2 = 0;
7097 double x3 = cell.projected_center[0];
7098 double y3 = cell.projected_center[1];
7103 x1 = cell.projected_vertices[0][0],
7104 y1 = cell.projected_vertices[0][1],
7105 x2 = cell.projected_vertices[1][0],
7106 y2 = cell.projected_vertices[1][1];
7109 x1 = cell.projected_vertices[1][0],
7110 y1 = cell.projected_vertices[1][1],
7111 x2 = cell.projected_vertices[3][0],
7112 y2 = cell.projected_vertices[3][1];
7115 x1 = cell.projected_vertices[3][0],
7116 y1 = cell.projected_vertices[3][1],
7117 x2 = cell.projected_vertices[2][0],
7118 y2 = cell.projected_vertices[2][1];
7121 x1 = cell.projected_vertices[2][0],
7122 y1 = cell.projected_vertices[2][1],
7123 x2 = cell.projected_vertices[0][0],
7124 y2 = cell.projected_vertices[0][1];
7130 out <<
" <path d=\"M "
7131 <<
static_cast<unsigned int>(
7137 <<
static_cast<unsigned int>(
7142 <<
static_cast<unsigned int>(
7148 <<
static_cast<unsigned int>(
7153 <<
static_cast<unsigned int>(
7159 <<
static_cast<unsigned int>(
7164 <<
static_cast<unsigned int>(
7170 <<
static_cast<unsigned int>(
7185 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
7190 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
7195 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
7197 for (
unsigned int index = 0; index < 4; ++index)
7199 double start_h = .667 - ((index + 1) / 4.) * .667;
7200 double stop_h = .667 - (index / 4.) * .667;
7211 unsigned int stop_i =
static_cast<unsigned int>(
stop_h * 6.);
7253 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7256 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7261 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_f);
7264 stop_g =
static_cast<unsigned int>(.5 + 255. *
stop_q),
7268 stop_r =
static_cast<unsigned int>(.5 + 255. *
stop_f),
7273 stop_b =
static_cast<unsigned int>(.5 + 255. *
stop_q);
7280 out <<
" <linearGradient id=\"colorbar_" << index
7281 <<
"\" gradientUnits=\"userSpaceOnUse\" "
7284 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7290 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7295 <<
" <stop offset=\"0\" style=\"stop-color:rgb(" <<
start_r
7297 <<
" <stop offset=\"1\" style=\"stop-color:rgb(" <<
stop_r
7299 <<
" </linearGradient>" <<
'\n';
7305 <<
static_cast<unsigned int>(.5 + (height / 100.) *
7310 <<
"\" style=\"stroke:black; stroke-width:2; fill:url(#colorbar_"
7311 << index <<
")\"/>" <<
'\n';
7314 for (
unsigned int index = 0; index < 5; ++index)
7321 <<
static_cast<unsigned int>(
7325 <<
" style=\"text-anchor:start; font-size:80; font-family:Helvetica";
7327 if (index == 0 || index == 4)
7328 out <<
"; font-weight:bold";
7331 <<
static_cast<float>(
7341 out <<
"</text>" <<
'\n';
7346 out <<
'\n' <<
"</svg>";
7352 template <
int dim,
int spacedim>
7358 std::tuple<
unsigned int,
7362 &nonscalar_data_ranges,
7371 out << dim <<
' ' << spacedim <<
'\n';
7374 out <<
"[deal.II intermediate format graphics data]" <<
'\n'
7384 out << patches.
size() <<
'\n';
7385 for (
unsigned int i = 0; i < patches.size(); ++i)
7386 out << patches[i] <<
'\n';
7388 out << nonscalar_data_ranges.size() <<
'\n';
7400 template <
int dim,
int spacedim>
7406 std::tuple<
unsigned int,
7410 & nonscalar_data_ranges,
7416#ifndef DEAL_II_WITH_MPI
7419 (void)nonscalar_data_ranges;
7426 ExcMessage(
"This functionality requires MPI to be enabled."));
7447 boost::iostreams::filtering_ostream f;
7453# ifdef DEAL_II_WITH_ZLIB
7454 f.push(boost::iostreams::zlib_compressor(
7460 "Compression requires deal.II to be configured with ZLIB support."));
7463 boost::iostreams::back_insert_device<std::vector<char>>
inserter(
7468 patches,
data_names, nonscalar_data_ranges, flags, f);
7476 const ParallelIntermediateHeader
header{
7479 static_cast<std::uint64_t
>(compression),
7543 n_ranks *
sizeof(std::uint64_t) +
prefix_sum;
7565 std::pair<unsigned int, unsigned int>
7570 unsigned int dim, spacedim;
7571 input >> dim >> spacedim;
7573 return std::make_pair(dim, spacedim);
7582template <
int dim,
int spacedim>
7584 : default_subdivisions(1)
7590template <
int dim,
int spacedim>
7595 get_dataset_names(),
7596 get_nonscalar_data_ranges(),
7603template <
int dim,
int spacedim>
7608 get_dataset_names(),
7609 get_nonscalar_data_ranges(),
7616template <
int dim,
int spacedim>
7621 get_dataset_names(),
7622 get_nonscalar_data_ranges(),
7629template <
int dim,
int spacedim>
7634 get_dataset_names(),
7635 get_nonscalar_data_ranges(),
7642template <
int dim,
int spacedim>
7647 get_dataset_names(),
7648 get_nonscalar_data_ranges(),
7655template <
int dim,
int spacedim>
7660 get_dataset_names(),
7661 get_nonscalar_data_ranges(),
7668template <
int dim,
int spacedim>
7673 get_dataset_names(),
7674 get_nonscalar_data_ranges(),
7681template <
int dim,
int spacedim>
7686 get_dataset_names(),
7687 get_nonscalar_data_ranges(),
7692template <
int dim,
int spacedim>
7697 get_dataset_names(),
7698 get_nonscalar_data_ranges(),
7703template <
int dim,
int spacedim>
7708 get_dataset_names(),
7709 get_nonscalar_data_ranges(),
7715template <
int dim,
int spacedim>
7721#ifndef DEAL_II_WITH_MPI
7756 std::stringstream
ss;
7769 const auto & patches = get_patches();
7778 std::stringstream
ss;
7781 get_dataset_names(),
7782 get_nonscalar_data_ranges(),
7804 if (
myrank == n_ranks - 1)
7809 std::stringstream
ss;
7839template <
int dim,
int spacedim>
7843 const std::vector<std::string> &
piece_names)
const
7847 get_dataset_names(),
7848 get_nonscalar_data_ranges(),
7854template <
int dim,
int spacedim>
7859 const unsigned int counter,
7865 const unsigned int n_ranks =
7885 std::ofstream output(
filename.c_str());
7887 this->write_vtu(output);
7892 this->write_vtu_in_parallel(
filename.c_str(), mpi_communicator);
7896#ifdef DEAL_II_WITH_MPI
7935template <
int dim,
int spacedim>
7938 std::ostream &out)
const
7941 get_dataset_names(),
7942 get_nonscalar_data_ranges(),
7943 deal_II_intermediate_flags,
7949template <
int dim,
int spacedim>
7958 get_dataset_names(),
7959 get_nonscalar_data_ranges(),
7960 deal_II_intermediate_flags,
7968template <
int dim,
int spacedim>
7976 return create_xdmf_entry(
7982template <
int dim,
int spacedim>
7986 const std::string & h5_mesh_filename,
7992 ExcMessage(
"XDMF only supports 2 or 3 space dimensions."));
7994#ifndef DEAL_II_WITH_HDF5
7998 (void)h5_mesh_filename;
8045 const int tag = 47381;
8050 const auto &patches = get_patches();
8055 for (
const auto &
patch : patches)
8056 Assert(
patch.reference_cell == patches[0].reference_cell,
8067 patches[0].reference_cell);
8068 const unsigned int n_data_sets =
data_filter.n_data_sets();
8072 for (
unsigned int i = 0; i < n_data_sets; ++i)
8113 return Utilities::unpack<XDMFEntry>(
buffer,
false);
8121template <
int dim,
int spacedim>
8124 const std::vector<XDMFEntry> &entries,
8128#ifdef DEAL_II_WITH_MPI
8140 xdmf_file <<
"<?xml version=\"1.0\" ?>\n";
8141 xdmf_file <<
"<!DOCTYPE Xdmf SYSTEM \"Xdmf.dtd\" []>\n";
8142 xdmf_file <<
"<Xdmf Version=\"2.0\">\n";
8145 <<
" <Grid Name=\"CellTime\" GridType=\"Collection\" CollectionType=\"Temporal\">\n";
8147 for (
const auto &entry : entries)
8166template <
int dim,
int spacedim>
8172 get_dataset_names(),
8173 get_nonscalar_data_ranges(),
8180#ifdef DEAL_II_WITH_HDF5
8184 template <
int dim,
int spacedim>
8216# ifdef DEAL_II_WITH_MPI
8217# ifdef H5_HAVE_PARALLEL
8224# ifndef DEAL_II_WITH_ZLIB
8234# ifdef DEAL_II_WITH_MPI
8258# ifdef DEAL_II_WITH_MPI
8259# ifdef H5_HAVE_PARALLEL
8282 cell_ds_dim[1] = patches[0].reference_cell.n_vertices();
8287# if H5Gcreate_vers == 1
8295# ifdef DEAL_II_WITH_ZLIB
8310# if H5Gcreate_vers == 1
8318# ifdef DEAL_II_WITH_ZLIB
8343 count[1] = (spacedim < 2) ? 2 : spacedim;
8360 count[1] = patches[0].reference_cell.n_vertices();
8452# if H5Gcreate_vers == 1
8460# ifdef DEAL_II_WITH_ZLIB
8533template <
int dim,
int spacedim>
8539 std::tuple<
unsigned int,
8543 & nonscalar_data_ranges,
8548#ifndef DEAL_II_WITH_MPI
8555 Assert(patches.size() > 0, ExcNoPatches());
8557 if (patches.size() == 0)
8561 unsigned int n_nodes;
8609 std::get<1>(nonscalar_data_ranges[
n_th_vector]) >=
8612 std::get<0>(nonscalar_data_ranges[
n_th_vector])));
8614 std::get<1>(nonscalar_data_ranges[
n_th_vector]) < n_data_sets,
8621 if (!std::get<2>(nonscalar_data_ranges[
n_th_vector]).empty())
8628 for (i = std::get<0>(nonscalar_data_ranges[
n_th_vector]);
8656template <
int dim,
int spacedim>
8669template <
int dim,
int spacedim>
8689template <
int dim,
int spacedim>
8704template <
int dim,
int spacedim>
8718 "DataOutBase was asked to write HDF5 output for a space dimension of 1. "
8719 "HDF5 only supports datasets that live in 2 or 3 dimensions."));
8721#ifndef DEAL_II_WITH_HDF5
8738# ifndef H5_HAVE_PARALLEL
8742 "Serial HDF5 output on multiple processes is not yet supported."));
8752 Assert((patches.size() > 0) || (n_ranks > 1), ExcNoPatches());
8787template <
int dim,
int spacedim>
8843 write_deal_II_intermediate(out);
8853template <
int dim,
int spacedim>
8862template <
int dim,
int spacedim>
8863template <
typename FlagType>
8869 if (
typeid(flags) ==
typeid(dx_flags))
8871 else if (
typeid(flags) ==
typeid(ucd_flags))
8873 else if (
typeid(flags) ==
typeid(povray_flags))
8875 else if (
typeid(flags) ==
typeid(eps_flags))
8877 else if (
typeid(flags) ==
typeid(gmv_flags))
8879 else if (
typeid(flags) ==
typeid(hdf5_flags))
8881 else if (
typeid(flags) ==
typeid(tecplot_flags))
8884 else if (
typeid(flags) ==
typeid(vtk_flags))
8886 else if (
typeid(flags) ==
typeid(svg_flags))
8888 else if (
typeid(flags) ==
typeid(gnuplot_flags))
8891 else if (
typeid(flags) ==
typeid(deal_II_intermediate_flags))
8892 deal_II_intermediate_flags =
8900template <
int dim,
int spacedim>
8913template <
int dim,
int spacedim>
8920 "A name for the output format to be used");
8924 "Number of subdivisions of each mesh cell");
8970template <
int dim,
int spacedim>
8976 default_subdivisions = prm.
get_integer(
"Subdivisions");
8979 dx_flags.parse_parameters(prm);
8983 ucd_flags.parse_parameters(prm);
8987 gnuplot_flags.parse_parameters(prm);
8991 povray_flags.parse_parameters(prm);
8995 eps_flags.parse_parameters(prm);
8999 gmv_flags.parse_parameters(prm);
9003 hdf5_flags.parse_parameters(prm);
9007 tecplot_flags.parse_parameters(prm);
9011 vtk_flags.parse_parameters(prm);
9015 deal_II_intermediate_flags.parse_parameters(prm);
9021template <
int dim,
int spacedim>
9025 return (
sizeof(default_fmt) +
9041template <
int dim,
int spacedim>
9043 std::tuple<
unsigned int,
9050 std::tuple<
unsigned int,
9057template <
int dim,
int spacedim>
9068 std::tuple<
unsigned int,
9072 ranges = this->get_nonscalar_data_ranges();
9073 const std::vector<std::string>
data_names = this->get_dataset_names();
9077 for (
const auto &
range : ranges)
9079 const std::string &name = std::get<2>(
range);
9084 "Error: names of fields in DataOut need to be unique, "
9086 name +
"' is used more than once."));
9100 "Error: names of fields in DataOut need to be unique, "
9102 name +
"' is used more than once."));
9113template <
int dim,
int spacedim>
9121 std::vector<typename ::DataOutBase::Patch<dim, spacedim>> tmp;
9125 std::vector<std::string> tmp;
9126 tmp.swap(dataset_names);
9130 std::tuple<
unsigned int,
9135 tmp.swap(nonscalar_data_ranges);
9146 ExcIncompatibleDimensions(
9158 std::ostringstream s;
9159 s <<
"[deal.II intermediate format graphics data]";
9167 std::ostringstream s;
9177 std::ostringstream s;
9183 "Invalid or incompatible file format. Intermediate format "
9184 "files can only be read by the same deal.II version as they "
9185 "are written by."));
9189 unsigned int n_datasets;
9191 dataset_names.resize(n_datasets);
9192 for (
unsigned int i = 0; i < n_datasets; ++i)
9193 in >> dataset_names[i];
9195 unsigned int n_patches;
9197 patches.resize(n_patches);
9198 for (
unsigned int i = 0; i < n_patches; ++i)
9206 in >> std::get<0>(nonscalar_data_ranges[i]) >>
9207 std::get<1>(nonscalar_data_ranges[i]);
9216 std::get<2>(nonscalar_data_ranges[i]) = name;
9224template <
int dim,
int spacedim>
9230 ParallelIntermediateHeader
header;
9231 in.read(
reinterpret_cast<char *
>(&
header),
sizeof(
header));
9233 header.magic == 0x00dea111,
9235 "Invalid header of parallel deal.II intermediate format encountered."));
9239 "Incorrect header version of parallel deal.II intermediate format."));
9243 header.n_ranks *
sizeof(std::uint64_t));
9245 for (
unsigned int n = 0; n <
header.n_ranks; ++n)
9257 boost::iostreams::filtering_istreambuf f;
9260#ifdef DEAL_II_WITH_ZLIB
9261 f.push(boost::iostreams::zlib_decompressor());
9266 "Decompression requires deal.II to be configured with ZLIB support."));
9292template <
int dim,
int spacedim>
9296 using Patch = typename ::DataOutBase::Patch<dim, spacedim>;
9303 Assert(get_dataset_names() ==
source.get_dataset_names(),
9304 ExcIncompatibleDatasetNames());
9309 ExcMessage(
"Both sources need to declare the same components "
9311 for (
unsigned int i = 0; i < get_nonscalar_data_ranges().size(); ++i)
9313 Assert(std::get<0>(get_nonscalar_data_ranges()[i]) ==
9314 std::get<0>(
source.get_nonscalar_data_ranges()[i]),
9315 ExcMessage(
"Both sources need to declare the same components "
9317 Assert(std::get<1>(get_nonscalar_data_ranges()[i]) ==
9318 std::get<1>(
source.get_nonscalar_data_ranges()[i]),
9319 ExcMessage(
"Both sources need to declare the same components "
9321 Assert(std::get<2>(get_nonscalar_data_ranges()[i]) ==
9322 std::get<2>(
source.get_nonscalar_data_ranges()[i]),
9323 ExcMessage(
"Both sources need to declare the same components "
9329 ExcIncompatiblePatchLists());
9331 ExcIncompatiblePatchLists());
9333 ExcIncompatiblePatchLists());
9341 for (
unsigned int i =
old_n_patches; i < patches.size(); ++i)
9345 for (
unsigned int i =
old_n_patches; i < patches.size(); ++i)
9347 if (patches[i].neighbors[n] !=
9354template <
int dim,
int spacedim>
9355const std::vector<typename ::DataOutBase::Patch<dim, spacedim>> &
9363template <
int dim,
int spacedim>
9364std::vector<std::string>
9367 return dataset_names;
9372template <
int dim,
int spacedim>
9374 std::tuple<
unsigned int,
9380 return nonscalar_data_ranges;
9389 , h5_sol_filename(
"")
9390 , h5_mesh_filename(
"")
9392 , num_nodes(
numbers::invalid_unsigned_int)
9393 , num_cells(
numbers::invalid_unsigned_int)
9394 , dimension(
numbers::invalid_unsigned_int)
9395 , space_dimension(
numbers::invalid_unsigned_int)
9403 const std::uint64_t
nodes,
9404 const std::uint64_t cells,
9405 const unsigned int dim)
9411 const std::uint64_t
nodes,
9412 const std::uint64_t cells,
9413 const unsigned int dim,
9423 const std::uint64_t
nodes,
9424 const std::uint64_t cells,
9425 const unsigned int dim)
9441 const std::uint64_t
nodes,
9442 const std::uint64_t cells,
9443 const unsigned int dim,
9460 const std::uint64_t
nodes,
9461 const std::uint64_t cells,
9462 const unsigned int dim,
9463 const unsigned int spacedim)
9484 const unsigned int dimension)
9491 return ReferenceCells::get_hypercube<0>();
9493 return ReferenceCells::get_hypercube<1>();
9495 return ReferenceCells::get_hypercube<2>();
9497 return ReferenceCells::get_hypercube<3>();
9512 const std::uint64_t
nodes,
9513 const std::uint64_t cells,
9514 const unsigned int dim,
9515 const unsigned int spacedim,
9524 , space_dimension(spacedim)
9532 const unsigned int dimension)
9547 std::string
res =
"";
9561 (void)reference_cell;
9563 ExcMessage(
"Incorrect ReferenceCell type passed in."));
9575 std::stringstream
ss;
9578 <<
"<Grid Name=\"mesh\" GridType=\"Uniform\">\n";
9584 <<
"\" NumberType=\"Float\" Precision=\"8\" Format=\"HDF\">\n";
9610 ss <<
"Quadrilateral";
9629 ss <<
"Tetrahedron";
9635 ss <<
"\" NodesPerElement=\"1\">\n";
9637 ss <<
"\" NodesPerElement=\"2\">\n";
9644 <<
"\" NumberType=\"UInt\" Format=\"HDF\">\n";
9655 <<
"<Topology TopologyType=\"Polyvertex\" NumberOfElements=\""
9665 <<
"\" Center=\"Node\">\n";
9669 <<
"\" NumberType=\"Float\" Precision=\"8\" Format=\"HDF\">\n";
9685 template <
int dim,
int spacedim>
9690 out <<
"[deal.II intermediate Patch<" << dim <<
',' << spacedim <<
">]"
9694 out <<
patch.reference_cell <<
'\n';
9697 for (
const unsigned int i :
patch.reference_cell.vertex_indices())
9698 out <<
patch.vertices[i] <<
' ';
9701 for (
const unsigned int i :
patch.reference_cell.face_indices())
9702 out <<
patch.neighbors[i] <<
' ';
9705 out <<
patch.patch_index <<
' ' <<
patch.n_subdivisions <<
'\n';
9707 out <<
patch.points_are_available <<
'\n';
9710 for (
unsigned int i = 0; i <
patch.
data.n_rows(); ++i)
9721 template <
int dim,
int spacedim>
9739 std::ostringstream s;
9740 s <<
"[deal.II intermediate Patch<" << dim <<
',' << spacedim <<
">]";
9746#ifdef DEAL_II_HAVE_CXX17
9747 if constexpr (dim > 0)
9748 in >>
patch.reference_cell;
9758 for (
const unsigned int i :
patch.reference_cell.vertex_indices())
9759 in >>
patch.vertices[i];
9761 for (
const unsigned int i :
patch.reference_cell.face_indices())
9762 in >>
patch.neighbors[i];
9764 in >>
patch.patch_index;
9768 unsigned int n_subdivisions;
9769 in >> n_subdivisions;
9770#ifdef DEAL_II_HAVE_CXX17
9771 if constexpr (dim > 1)
9772 patch.n_subdivisions = n_subdivisions;
9778 const_cast<unsigned int &
>(
patch.n_subdivisions) = n_subdivisions;
9781 in >>
patch.points_are_available;
9783 unsigned int n_rows, n_cols;
9784 in >> n_rows >> n_cols;
9786 for (
unsigned int i = 0; i <
patch.
data.n_rows(); ++i)
9799#include "data_out_base.inst"
value_type * data() const noexcept
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
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
void enter_subsection(const std::string &subsection)
unsigned int n_vertices() const
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
Point< 2 > projected_vertices[4]
Point< 2 > projected_center
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)
LogStream & operator<<(LogStream &log, const T &t)
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< T >::value, 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)
constexpr T pow(const T base, const int iexp)
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)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
static constexpr double PI
static const 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 > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
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
static const unsigned int space_dim
unsigned int n_subdivisions
void swap(Patch< dim, spacedim > &other_patch)
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)