57#ifdef DEAL_II_WITH_ZLIB
61#ifdef DEAL_II_WITH_HDF5
75 <<
"Unexpected input: expected line\n <" << arg1
76 <<
">\nbut got\n <" << arg2 <<
">");
82#ifdef DEAL_II_WITH_ZLIB
88 get_zlib_compression_level(
94 return Z_NO_COMPRESSION;
98 return Z_BEST_COMPRESSION;
100 return Z_DEFAULT_COMPRESSION;
103 return Z_NO_COMPRESSION;
111 template <
typename T>
113 write_compressed_block(
const std::vector<T> & data,
115 std::ostream & output_stream)
117 if (data.size() != 0)
120 auto compressed_data_length = compressBound(data.size() *
sizeof(
T));
121 std::vector<unsigned char> compressed_data(compressed_data_length);
124 compress2(&compressed_data[0],
125 &compressed_data_length,
126 reinterpret_cast<const Bytef *
>(data.data()),
127 data.size() *
sizeof(
T),
133 compressed_data.resize(compressed_data_length);
136 const uint32_t compression_header[4] = {
138 static_cast<uint32_t
>(data.size() *
sizeof(
T)),
139 static_cast<uint32_t
>(data.size() *
141 static_cast<uint32_t
>(
142 compressed_data_length)};
144 const auto header_start =
145 reinterpret_cast<const unsigned char *
>(&compression_header[0]);
148 {header_start, header_start + 4 *
sizeof(uint32_t)})
258 template <
int dim,
int spacedim,
typename Number =
double>
260 write_gmv_reorder_data_vectors(
261 const std::vector<Patch<dim, spacedim>> &patches,
265 if (patches.size() == 0)
275 const unsigned int n_data_sets = patches[0].points_are_available ?
276 (patches[0].data.n_rows() - spacedim) :
277 patches[0].data.n_rows();
282 unsigned int next_value = 0;
283 for (
const auto &patch : patches)
285 const unsigned int n_subdivisions = patch.n_subdivisions;
286 (void)n_subdivisions;
288 Assert((patch.data.n_rows() == n_data_sets &&
289 !patch.points_are_available) ||
290 (patch.data.n_rows() == n_data_sets + spacedim &&
291 patch.points_are_available),
293 (n_data_sets + spacedim) :
295 patch.data.n_rows()));
296 Assert(patch.reference_cell != ReferenceCells::get_hypercube<dim>() ||
297 (n_data_sets == 0) ||
298 (patch.data.n_cols() ==
299 Utilities::fixed_power<dim>(n_subdivisions + 1)),
301 n_subdivisions + 1));
303 for (
unsigned int i = 0; i < patch.data.n_cols(); ++i, ++next_value)
304 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
305 data_vectors[data_set][next_value] = patch.data(data_set, i);
308 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
338 for (
unsigned int d = 0;
d < dim; ++
d)
342 unsigned int internal_ind;
353 internal_ind = it->second;
363 const unsigned int pt_index)
382 node_data[
node_dim * existing_point.second +
d] =
383 existing_point.first(
d);
391 std::vector<unsigned int> &cell_data)
const
397 cell_data[filtered_cell.first] =
398 filtered_cell.second + local_node_offset;
467 const unsigned int start,
468 const unsigned int d1,
469 const unsigned int d2,
470 const unsigned int d3)
474 const unsigned int base_entry =
500 const unsigned int start,
501 const unsigned int n_points)
505 const unsigned int base_entry = index * n_points;
507 for (
unsigned int i = 0; i < n_points; ++i)
517 const unsigned int dimension,
518 const unsigned int set_num,
521 unsigned int new_dim;
540 for (
unsigned int d = 0;
d < new_dim; ++
d)
543 data_sets.back()[r * new_dim +
d] = data_vectors(set_num +
d, i);
559 const char *gmv_cell_type[4] = {
"",
"line 2",
"quad 4",
"hex 8"};
561 const char *ucd_cell_type[4] = {
"pt",
"line",
"quad",
"hex"};
563 const char *tecplot_cell_type[4] = {
"",
"lineseg",
"quadrilateral",
"brick"};
565#ifdef DEAL_II_HAVE_TECPLOT
566 const unsigned int tecplot_binary_cell_type[4] = {0, 0, 1, 3};
571 enum vtk_linear_cell_type
583 enum vtk_quadratic_cell_type
585 VTK_QUADRATIC_EDGE = 21,
586 VTK_QUADRATIC_TRIANGLE = 22,
587 VTK_QUADRATIC_QUAD = 23,
588 VTK_QUADRATIC_TETRA = 24,
589 VTK_QUADRATIC_HEXAHEDRON = 25,
590 VTK_QUADRATIC_WEDGE = 26,
591 VTK_QUADRATIC_PYRAMID = 27
594 enum vtk_lagrange_cell_type
596 VTK_LAGRANGE_CURVE = 68,
597 VTK_LAGRANGE_TRIANGLE = 69,
598 VTK_LAGRANGE_QUADRILATERAL = 70,
599 VTK_LAGRANGE_TETRAHEDRON = 71,
600 VTK_LAGRANGE_HEXAHEDRON = 72,
601 VTK_LAGRANGE_WEDGE = 73,
602 VTK_LAGRANGE_PYRAMID = 74
609 template <
int dim,
int spacedim>
610 std::array<unsigned int, 3>
612 const bool write_higher_order_cells)
614 std::array<unsigned int, 3> vtk_cell_id{};
616 if (write_higher_order_cells)
620 const std::array<unsigned int, 4> cell_type_by_dim{
623 VTK_LAGRANGE_QUADRILATERAL,
624 VTK_LAGRANGE_HEXAHEDRON}};
625 vtk_cell_id[0] = cell_type_by_dim[dim];
630 vtk_cell_id[0] = VTK_LAGRANGE_TRIANGLE;
639 patch.
data.n_cols() == 3)
641 vtk_cell_id[0] = VTK_TRIANGLE;
645 patch.
data.n_cols() == 6)
647 vtk_cell_id[0] = VTK_QUADRATIC_TRIANGLE;
651 patch.
data.n_cols() == 4)
653 vtk_cell_id[0] = VTK_TETRA;
657 patch.
data.n_cols() == 10)
659 vtk_cell_id[0] = VTK_QUADRATIC_TETRA;
663 patch.
data.n_cols() == 6)
665 vtk_cell_id[0] = VTK_WEDGE;
669 patch.
data.n_cols() == 5)
671 vtk_cell_id[0] = VTK_PYRAMID;
674 else if (patch.
reference_cell == ReferenceCells::get_hypercube<dim>())
676 const std::array<unsigned int, 4> cell_type_by_dim{
677 {VTK_VERTEX, VTK_LINE, VTK_QUAD, VTK_HEXAHEDRON}};
678 vtk_cell_id[0] = cell_type_by_dim[dim];
686 if (patch.
reference_cell != ReferenceCells::get_hypercube<dim>() ||
687 write_higher_order_cells)
688 vtk_cell_id[2] = patch.
data.n_cols();
701 template <
int dim,
int spacedim>
704 const unsigned int xstep,
705 const unsigned int ystep,
706 const unsigned int zstep,
707 const unsigned int n_subdivisions)
712 unsigned int point_no = 0;
717 point_no += (n_subdivisions + 1) * (n_subdivisions + 1) * zstep;
721 point_no += (n_subdivisions + 1) * ystep;
734 for (
unsigned int d = 0;
d < spacedim; ++
d)
735 node[
d] = patch.
data(patch.
data.size(0) - spacedim +
d, point_no);
744 const double stepsize = 1. / n_subdivisions,
745 xfrac = xstep * stepsize;
751 const double yfrac = ystep * stepsize;
753 node += ((patch.
vertices[3] * xfrac) +
754 (patch.
vertices[2] * (1 - xfrac))) *
758 const double zfrac = zstep * stepsize;
760 node += (((patch.
vertices[5] * xfrac) +
761 (patch.
vertices[4] * (1 - xfrac))) *
764 (patch.
vertices[6] * (1 - xfrac))) *
777 template <
int dim,
int spacedim>
780 const unsigned int point_no)
786 for (
unsigned int d = 0;
d < spacedim; ++
d)
787 node[
d] = patch.
data(patch.
data.size(0) - spacedim +
d, point_no);
796 "Pyramids need different ordering of the vertices, which is not implemented yet here."));
812 vtk_point_index_from_ijk(
const unsigned i,
815 const std::array<unsigned, 2> &order)
817 const bool ibdy = (i == 0 || i == order[0]);
818 const bool jbdy = (j == 0 || j == order[1]);
820 const int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0);
824 return (i ? (j ? 2 : 1) : (j ? 3 : 0));
832 return (i - 1) + (j ? order[0] - 1 + order[1] - 1 : 0) + offset;
838 (i ? order[0] - 1 : 2 * (order[0] - 1) + order[1] - 1) +
843 offset += 2 * (order[0] - 1 + order[1] - 1);
845 return offset + (i - 1) + (order[0] - 1) * ((j - 1));
856 vtk_point_index_from_ijk(
const unsigned i,
859 const std::array<unsigned, 3> &order)
861 const bool ibdy = (i == 0 || i == order[0]);
862 const bool jbdy = (j == 0 || j == order[1]);
863 const bool kbdy = (k == 0 || k == order[2]);
865 const int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0) + (kbdy ? 1 : 0);
869 return (i ? (j ? 2 : 1) : (j ? 3 : 0)) + (k ? 4 : 0);
877 return (i - 1) + (j ? order[0] - 1 + order[1] - 1 : 0) +
878 (k ? 2 * (order[0] - 1 + order[1] - 1) : 0) + offset;
883 (i ? order[0] - 1 : 2 * (order[0] - 1) + order[1] - 1) +
884 (k ? 2 * (order[0] - 1 + order[1] - 1) : 0) + offset;
887 offset += 4 * (order[0] - 1) + 4 * (order[1] - 1);
888 return (k - 1) + (order[2] - 1) * (i ? (j ? 3 : 1) : (j ? 2 : 0)) +
892 offset += 4 * (order[0] - 1 + order[1] - 1 + order[2] - 1);
897 return (j - 1) + ((order[1] - 1) * (k - 1)) +
898 (i ? (order[1] - 1) * (order[2] - 1) : 0) + offset;
900 offset += 2 * (order[1] - 1) * (order[2] - 1);
903 return (i - 1) + ((order[0] - 1) * (k - 1)) +
904 (j ? (order[2] - 1) * (order[0] - 1) : 0) + offset;
906 offset += 2 * (order[2] - 1) * (order[0] - 1);
908 return (i - 1) + ((order[0] - 1) * (j - 1)) +
909 (k ? (order[0] - 1) * (order[1] - 1) : 0) + offset;
914 2 * ((order[1] - 1) * (order[2] - 1) + (order[2] - 1) * (order[0] - 1) +
915 (order[0] - 1) * (order[1] - 1));
916 return offset + (i - 1) +
917 (order[0] - 1) * ((j - 1) + (order[1] - 1) * ((k - 1)));
921 vtk_point_index_from_ijk(
const unsigned,
924 const std::array<unsigned, 0> &)
931 vtk_point_index_from_ijk(
const unsigned,
934 const std::array<unsigned, 1> &)
941 template <
int dim,
int spacedim>
944 unsigned int & n_nodes,
949 for (
const auto &patch : patches)
966 template <
int dim,
int spacedim>
969 const bool write_higher_order_cells,
970 unsigned int &n_nodes,
972 unsigned int &n_points_and_n_cells)
976 n_points_and_n_cells = 0;
978 for (
const auto &patch : patches)
985 if (write_higher_order_cells)
988 n_points_and_n_cells +=
994 n_points_and_n_cells +=
1001 n_nodes += patch.
data.n_cols();
1003 n_points_and_n_cells += patch.
data.n_cols() + 1;
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 const unsigned int ,
1059 const unsigned int ,
1060 const unsigned int )
1063 ExcMessage(
"The derived class you are using needs to "
1064 "reimplement this function if you want to call "
1075 write_cell_single(
const unsigned int index,
1076 const unsigned int start,
1077 const unsigned int n_points)
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;
1129 const FlagsType flags;
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 unsigned int x_offset,
1157 const unsigned int y_offset,
1158 const unsigned int z_offset);
1166 template <
typename data>
1168 write_dataset(
const unsigned int index,
const std::vector<data> &
values);
1174 class GmvStream :
public StreamBase<DataOutBase::GmvFlags>
1181 write_point(
const unsigned int index,
const Point<dim> &);
1193 write_cell(
const unsigned int index,
1194 const unsigned int start,
1195 const unsigned int x_offset,
1196 const unsigned int y_offset,
1197 const unsigned int z_offset);
1203 class TecplotStream :
public StreamBase<DataOutBase::TecplotFlags>
1210 write_point(
const unsigned int index,
const Point<dim> &);
1222 write_cell(
const unsigned int index,
1223 const unsigned int start,
1224 const unsigned int x_offset,
1225 const unsigned int y_offset,
1226 const unsigned int z_offset);
1232 class UcdStream :
public StreamBase<DataOutBase::UcdFlags>
1239 write_point(
const unsigned int index,
const Point<dim> &);
1253 write_cell(
const unsigned int index,
1254 const unsigned int start,
1255 const unsigned int x_offset,
1256 const unsigned int y_offset,
1257 const unsigned int z_offset);
1265 template <
typename data>
1267 write_dataset(
const unsigned int index,
const std::vector<data> &
values);
1273 class VtkStream :
public StreamBase<DataOutBase::VtkFlags>
1280 write_point(
const unsigned int index,
const Point<dim> &);
1292 write_cell(
const unsigned int index,
1293 const unsigned int start,
1294 const unsigned int x_offset,
1295 const unsigned int y_offset,
1296 const unsigned int z_offset);
1302 write_cell_single(
const unsigned int index,
1303 const unsigned int start,
1304 const unsigned int n_points);
1315 write_high_order_cell(
const unsigned int index,
1316 const unsigned int start,
1317 const std::vector<unsigned> &connectivity);
1321 class VtuStream :
public StreamBase<DataOutBase::VtkFlags>
1328 write_point(
const unsigned int index,
const Point<dim> &);
1343 write_cell(
const unsigned int index,
1344 const unsigned int start,
1345 const unsigned int x_offset,
1346 const unsigned int y_offset,
1347 const unsigned int z_offset);
1353 write_cell_single(
const unsigned int index,
1354 const unsigned int start,
1355 const unsigned int n_points);
1366 write_high_order_cell(
const unsigned int index,
1367 const unsigned int start,
1368 const std::vector<unsigned> &connectivity);
1373 template <
typename T>
1384 template <
typename T>
1398 std::vector<int32_t> cells;
1411 DXStream::write_point(
const unsigned int,
const Point<dim> &p)
1413 if (flags.coordinates_binary)
1416 for (
unsigned int d = 0;
d < dim; ++
d)
1418 stream.write(
reinterpret_cast<const char *
>(data), dim *
sizeof(*data));
1422 for (
unsigned int d = 0;
d < dim; ++
d)
1423 stream << p(
d) <<
'\t';
1438 std::array<unsigned int, GeometryInfo<dim>::vertices_per_cell>
1439 set_node_numbers(
const unsigned int ,
1440 const unsigned int ,
1441 const unsigned int ,
1442 const unsigned int )
1451 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell>
1452 set_node_numbers<1>(
const unsigned int start,
1453 const unsigned int d1,
1454 const unsigned int ,
1455 const unsigned int )
1458 std::array<unsigned int, GeometryInfo<1>::vertices_per_cell> nodes;
1460 nodes[1] = start + d1;
1467 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>
1468 set_node_numbers<2>(
const unsigned int start,
1469 const unsigned int d1,
1470 const unsigned int d2,
1471 const unsigned int )
1474 std::array<unsigned int, GeometryInfo<2>::vertices_per_cell> nodes;
1476 nodes[1] = start + d1;
1477 nodes[2] = start + d2;
1478 nodes[3] = start + d2 + d1;
1485 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell>
1486 set_node_numbers<3>(
const unsigned int start,
1487 const unsigned int d1,
1488 const unsigned int d2,
1489 const unsigned int d3)
1491 std::array<unsigned int, GeometryInfo<3>::vertices_per_cell> nodes;
1493 nodes[1] = start + d1;
1494 nodes[2] = start + d2;
1495 nodes[3] = start + d2 + d1;
1496 nodes[4] = start + d3;
1497 nodes[5] = start + d3 + d1;
1498 nodes[6] = start + d3 + d2;
1499 nodes[7] = start + d3 + d2 + d1;
1508 DXStream::write_cell(
unsigned int,
1515 DataOutBaseImplementation::set_node_numbers<dim>(start, d1, d2, d3);
1517 if (flags.int_binary)
1519 std::array<unsigned int, GeometryInfo<dim>::vertices_per_cell> temp;
1520 for (
unsigned int i = 0; i < nodes.size(); ++i)
1522 stream.write(
reinterpret_cast<const char *
>(temp.data()),
1523 temp.size() *
sizeof(temp[0]));
1527 for (
unsigned int i = 0; i < nodes.size() - 1; ++i)
1529 stream << nodes[GeometryInfo<dim>::dx_to_deal[nodes.size() - 1]]
1536 template <
typename data>
1538 DXStream::write_dataset(
const unsigned int,
const std::vector<data> &
values)
1540 if (flags.data_binary)
1542 stream.write(
reinterpret_cast<const char *
>(
values.data()),
1543 values.size() *
sizeof(data));
1547 for (
unsigned int i = 0; i <
values.size(); ++i)
1548 stream <<
'\t' <<
values[i];
1564 GmvStream::write_point(
const unsigned int,
const Point<dim> &p)
1568 stream << p(selected_component) <<
' ';
1575 GmvStream::write_cell(
unsigned int,
1582 const unsigned int start = s + 1;
1583 stream << gmv_cell_type[dim] <<
'\n';
1588 stream <<
'\t' << start + d1;
1591 stream <<
'\t' << start + d2 + d1 <<
'\t' << start + d2;
1594 stream <<
'\t' << start + d3 <<
'\t' << start + d3 + d1 <<
'\t'
1595 << start + d3 + d2 + d1 <<
'\t' << start + d3 + d2;
1604 TecplotStream::TecplotStream(std::ostream & out,
1612 TecplotStream::write_point(
const unsigned int,
const Point<dim> &p)
1616 stream << p(selected_component) <<
'\n';
1623 TecplotStream::write_cell(
unsigned int,
1629 const unsigned int start = s + 1;
1634 stream <<
'\t' << start + d1;
1637 stream <<
'\t' << start + d2 + d1 <<
'\t' << start + d2;
1640 stream <<
'\t' << start + d3 <<
'\t' << start + d3 + d1 <<
'\t'
1641 << start + d3 + d2 + d1 <<
'\t' << start + d3 + d2;
1657 UcdStream::write_point(
const unsigned int index,
const Point<dim> &p)
1659 stream << index + 1 <<
" ";
1661 for (
unsigned int i = 0; i < dim; ++i)
1662 stream << p(i) <<
' ';
1664 for (
unsigned int i = dim; i < 3; ++i)
1673 UcdStream::write_cell(
unsigned int index,
1680 DataOutBaseImplementation::set_node_numbers<dim>(start, d1, d2, d3);
1683 stream << index + 1 <<
"\t0 " << ucd_cell_type[dim];
1684 for (
unsigned int i = 0; i < nodes.size(); ++i)
1691 template <
typename data>
1693 UcdStream::write_dataset(
const unsigned int index,
1694 const std::vector<data> &
values)
1696 stream << index + 1;
1697 for (
unsigned int i = 0; i <
values.size(); ++i)
1698 stream <<
'\t' <<
values[i];
1713 VtkStream::write_point(
const unsigned int,
const Point<dim> &p)
1718 for (
unsigned int i = dim; i < 3; ++i)
1727 VtkStream::write_cell(
unsigned int,
1733 stream << GeometryInfo<dim>::vertices_per_cell <<
'\t' << start;
1736 stream <<
'\t' << start + d1;
1740 stream <<
'\t' << start + d2 + d1 <<
'\t' << start + d2;
1743 stream <<
'\t' << start + d3 <<
'\t' << start + d3 + d1 <<
'\t'
1744 << start + d3 + d2 + d1 <<
'\t' << start + d3 + d2;
1752 VtkStream::write_cell_single(
const unsigned int index,
1753 const unsigned int start,
1754 const unsigned int n_points)
1758 stream <<
'\t' << n_points;
1759 for (
unsigned int i = 0; i < n_points; ++i)
1760 stream <<
'\t' << start + i;
1766 VtkStream::write_high_order_cell(
const unsigned int,
1767 const unsigned int start,
1768 const std::vector<unsigned> &connectivity)
1770 stream << connectivity.size();
1771 for (
const auto &c : connectivity)
1772 stream <<
'\t' << start + c;
1783 VtuStream::write_point(
const unsigned int,
const Point<dim> &p)
1785#if !defined(DEAL_II_WITH_ZLIB)
1789 for (
unsigned int i = dim; i < 3; ++i)
1794 for (
unsigned int i = 0; i < dim; ++i)
1796 for (
unsigned int i = dim; i < 3; ++i)
1803 VtuStream::flush_points()
1805#ifdef DEAL_II_WITH_ZLIB
1816 VtuStream::write_cell(
unsigned int,
1822#if !defined(DEAL_II_WITH_ZLIB)
1826 stream <<
'\t' << start + d1;
1829 stream <<
'\t' << start + d2 + d1 <<
'\t' << start + d2;
1832 stream <<
'\t' << start + d3 <<
'\t' << start + d3 + d1 <<
'\t'
1833 << start + d3 + d2 + d1 <<
'\t' << start + d3 + d2;
1839 cells.push_back(start);
1842 cells.push_back(start + d1);
1845 cells.push_back(start + d2 + d1);
1846 cells.push_back(start + d2);
1849 cells.push_back(start + d3);
1850 cells.push_back(start + d3 + d1);
1851 cells.push_back(start + d3 + d2 + d1);
1852 cells.push_back(start + d3 + d2);
1860 VtuStream::write_cell_single(
const unsigned int index,
1861 const unsigned int start,
1862 const unsigned int n_points)
1866#if !defined(DEAL_II_WITH_ZLIB)
1867 for (
unsigned int i = 0; i < n_points; ++i)
1868 stream <<
'\t' << start + i;
1871 for (
unsigned int i = 0; i < n_points; ++i)
1872 cells.push_back(start + i);
1878 VtuStream::write_high_order_cell(
const unsigned int,
1879 const unsigned int start,
1880 const std::vector<unsigned> &connectivity)
1882#if !defined(DEAL_II_WITH_ZLIB)
1883 for (
const auto &c : connectivity)
1884 stream <<
'\t' << start + c;
1887 for (
const auto &c : connectivity)
1888 cells.push_back(start + c);
1893 VtuStream::flush_cells()
1895#ifdef DEAL_II_WITH_ZLIB
1898 *
this << cells <<
'\n';
1904 template <
typename T>
1908#ifdef DEAL_II_WITH_ZLIB
1911 write_compressed_block(data, flags, stream);
1913 for (
unsigned int i = 0; i < data.size(); ++i)
1914 stream << data[i] <<
' ';
1928 template <
int dim,
int spacedim>
1932 template <
int dim,
int spacedim>
1936 template <
int dim,
int spacedim>
1938 : patch_index(no_neighbor)
1940 , points_are_available(false)
1954 template <
int dim,
int spacedim>
1977 if (data.n_rows() != patch.
data.n_rows())
1980 if (data.n_cols() != patch.
data.n_cols())
1983 for (
unsigned int i = 0; i < data.n_rows(); ++i)
1984 for (
unsigned int j = 0; j < data.n_cols(); ++j)
1985 if (data[i][j] != patch.
data[i][j])
1993 template <
int dim,
int spacedim>
1999 sizeof(neighbors) /
sizeof(neighbors[0]) *
2009 template <
int dim,
int spacedim>
2017 data.swap(other_patch.
data);
2024 template <
int spacedim>
2028 template <
int spacedim>
2032 template <
int spacedim>
2036 template <
int spacedim>
2039 template <
int spacedim>
2041 : patch_index(no_neighbor)
2042 , points_are_available(false)
2050 template <
int spacedim>
2054 const unsigned int dim = 0;
2068 if (
data.n_rows() != patch.
data.n_rows())
2071 if (
data.n_cols() != patch.
data.n_cols())
2074 for (
unsigned int i = 0; i <
data.n_rows(); ++i)
2075 for (
unsigned int j = 0; j <
data.n_cols(); ++j)
2076 if (
data[i][j] != patch.
data[i][j])
2084 template <
int spacedim>
2096 template <
int spacedim>
2108 : write_preamble(write_preamble)
2123 : space_dimension_labels(labels)
2137 const bool bicubic_patch,
2138 const bool external_data)
2140 , bicubic_patch(bicubic_patch)
2141 , external_data(external_data)
2146 const bool xdmf_hdf5_output)
2147 : filter_duplicate_vertices(filter_duplicate_vertices)
2148 , xdmf_hdf5_output(xdmf_hdf5_output)
2156 "Filter duplicate vertices",
2159 "Whether to remove duplicate vertex values. deal.II duplicates "
2160 "vertices once for each adjacent cell so that it can output "
2161 "discontinuous quantities for which there may be more than one "
2162 "value for each vertex position. Setting this flag to "
2163 "'true' will merge all of these values by selecting a "
2164 "random one and outputting this as 'the' value for the vertex. "
2165 "As long as the data to be output corresponds to continuous "
2166 "fields, merging vertices has no effect. On the other hand, "
2167 "if the data to be output corresponds to discontinuous fields "
2168 "(either because you are using a discontinuous finite element, "
2169 "or because you are using a DataPostprocessor that yields "
2170 "discontinuous data, or because the data to be output has been "
2171 "produced by entirely different means), then the data in the "
2172 "output file no longer faithfully represents the underlying data "
2173 "because the discontinuous field has been replaced by a "
2174 "continuous one. Note also that the filtering can not occur "
2175 "on processor boundaries. Thus, a filtered discontinuous field "
2176 "looks like a continuous field inside of a subdomain, "
2177 "but like a discontinuous field at the subdomain boundary."
2179 "In any case, filtering results in drastically smaller output "
2180 "files (smaller by about a factor of 2^dim).");
2185 "Whether the data will be used in an XDMF/HDF5 combination.");
2200 const bool int_binary,
2201 const bool coordinates_binary,
2202 const bool data_binary)
2203 : write_neighbors(write_neighbors)
2204 , int_binary(int_binary)
2205 , coordinates_binary(coordinates_binary)
2206 , data_binary(data_binary)
2207 , data_double(false)
2217 "A boolean field indicating whether neighborship "
2218 "information between cells is to be written to the "
2219 "OpenDX output file");
2223 "Output format of integer numbers, which is "
2224 "either a text representation (ascii) or binary integer "
2225 "values of 32 or 64 bits length");
2229 "Output format of vertex coordinates, which is "
2230 "either a text representation (ascii) or binary "
2231 "floating point values of 32 or 64 bits length");
2235 "Output format of data values, which is "
2236 "either a text representation (ascii) or binary "
2237 "floating point values of 32 or 64 bits length");
2257 "A flag indicating whether a comment should be "
2258 "written to the beginning of the output file "
2259 "indicating date and time of creation as well "
2260 "as the creating program");
2274 const int azimuth_angle,
2275 const int polar_angle,
2276 const unsigned int line_thickness,
2278 const bool draw_colorbar)
2281 , height_vector(height_vector)
2282 , azimuth_angle(azimuth_angle)
2283 , polar_angle(polar_angle)
2284 , line_thickness(line_thickness)
2286 , draw_colorbar(draw_colorbar)
2297 "A flag indicating whether POVRAY should use smoothed "
2298 "triangles instead of the usual ones");
2302 "Whether POVRAY should use bicubic patches");
2306 "Whether camera and lighting information should "
2307 "be put into an external file \"data.inc\" or into "
2308 "the POVRAY input file");
2324 const unsigned int color_vector,
2326 const unsigned int size,
2327 const double line_width,
2328 const double azimut_angle,
2329 const double turn_angle,
2330 const double z_scaling,
2331 const bool draw_mesh,
2332 const bool draw_cells,
2333 const bool shade_cells,
2335 : height_vector(height_vector)
2336 , color_vector(color_vector)
2339 , line_width(line_width)
2340 , azimut_angle(azimut_angle)
2341 , turn_angle(turn_angle)
2342 , z_scaling(z_scaling)
2343 , draw_mesh(draw_mesh)
2344 , draw_cells(draw_cells)
2345 , shade_cells(shade_cells)
2346 , color_function(color_function)
2385 double sum = xmax + xmin;
2386 double sum13 = xmin + 3 * xmax;
2387 double sum22 = 2 * xmin + 2 * xmax;
2388 double sum31 = 3 * xmin + xmax;
2389 double dif = xmax - xmin;
2390 double rezdif = 1.0 / dif;
2394 if (x < (sum31) / 4)
2396 else if (x < (sum22) / 4)
2398 else if (x < (sum13) / 4)
2409 rgb_values.
green = 0;
2410 rgb_values.
blue = (x - xmin) * 4. * rezdif;
2414 rgb_values.
green = (4 * x - 3 * xmin - xmax) * rezdif;
2415 rgb_values.
blue = (sum22 - 4. * x) * rezdif;
2418 rgb_values.
red = (4 * x - 2 *
sum) * rezdif;
2419 rgb_values.
green = (xmin + 3 * xmax - 4 * x) * rezdif;
2420 rgb_values.
blue = 0;
2424 rgb_values.
green = (4 * x - xmin - 3 * xmax) * rezdif;
2425 rgb_values.
blue = (4. * x - sum13) * rezdif;
2432 rgb_values.
red = rgb_values.
green = rgb_values.
blue = 1;
2446 (x - xmin) / (xmax - xmin);
2459 1 - (x - xmin) / (xmax - xmin);
2471 "Number of the input vector that is to be used to "
2472 "generate height information");
2476 "Number of the input vector that is to be used to "
2477 "generate color information");
2481 "Whether width or height should be scaled to match "
2486 "The size (width or height) to which the eps output "
2487 "file is to be scaled");
2491 "The width in which the postscript renderer is to "
2496 "Angle of the viewing position against the vertical "
2501 "Angle of the viewing direction against the y-axis");
2505 "Scaling for the z-direction relative to the scaling "
2506 "used in x- and y-directions");
2510 "Whether the mesh lines, or only the surface should be "
2515 "Whether only the mesh lines, or also the interior of "
2516 "cells should be plotted. If this flag is false, then "
2517 "one can see through the mesh");
2521 "Whether the interior of cells shall be shaded");
2525 "default|grey scale|reverse grey scale"),
2526 "Name of a color function used to colorize mesh lines "
2527 "and/or cell interiors");
2537 if (prm.
get(
"Scale to width or height") ==
"width")
2549 if (prm.
get(
"Color function") ==
"default")
2551 else if (prm.
get(
"Color function") ==
"grey scale")
2553 else if (prm.
get(
"Color function") ==
"reverse grey scale")
2564 : zone_name(zone_name)
2565 , solution_time(solution_time)
2578 VtkFlags::VtkFlags(
const double time,
2579 const unsigned int cycle,
2580 const bool print_date_and_time,
2582 const bool write_higher_order_cells)
2585 , print_date_and_time(print_date_and_time)
2586 , compression_level(compression_level)
2587 , write_higher_order_cells(write_higher_order_cells)
2595 if (format_name ==
"none")
2598 if (format_name ==
"dx")
2601 if (format_name ==
"ucd")
2604 if (format_name ==
"gnuplot")
2607 if (format_name ==
"povray")
2610 if (format_name ==
"eps")
2613 if (format_name ==
"gmv")
2616 if (format_name ==
"tecplot")
2619 if (format_name ==
"tecplot_binary")
2622 if (format_name ==
"vtk")
2625 if (format_name ==
"vtu")
2628 if (format_name ==
"deal.II intermediate")
2631 if (format_name ==
"hdf5")
2635 ExcMessage(
"The given file format name is not recognized: <" +
2636 format_name +
">"));
2647 return "none|dx|ucd|gnuplot|povray|eps|gmv|tecplot|tecplot_binary|vtk|vtu|hdf5|svg|deal.II intermediate";
2655 switch (output_format)
2694 template <
int dim,
int spacedim,
typename StreamType>
2699 unsigned int count = 0;
2701 for (
const auto &patch : patches)
2704 if (patch.
reference_cell != ReferenceCells::get_hypercube<dim>())
2706 for (
unsigned int point_no = 0; point_no < patch.
data.n_cols();
2708 out.write_point(count++, compute_arbitrary_node(patch, point_no));
2713 const unsigned int n = n_subdivisions + 1;
2716 const unsigned int n1 = (dim > 0) ? n : 1;
2717 const unsigned int n2 = (dim > 1) ? n : 1;
2718 const unsigned int n3 = (dim > 2) ? n : 1;
2720 for (
unsigned int i3 = 0; i3 < n3; ++i3)
2721 for (
unsigned int i2 = 0; i2 < n2; ++i2)
2722 for (
unsigned int i1 = 0; i1 < n1; ++i1)
2725 compute_hypercube_node(patch, i1, i2, i3, n_subdivisions));
2731 template <
int dim,
int spacedim,
typename StreamType>
2736 unsigned int count = 0;
2737 unsigned int first_vertex_of_patch = 0;
2738 for (
const auto &patch : patches)
2741 if (patch.
reference_cell != ReferenceCells::get_hypercube<dim>())
2743 out.write_cell_single(count++,
2744 first_vertex_of_patch,
2745 patch.
data.n_cols());
2746 first_vertex_of_patch += patch.
data.n_cols();
2751 const unsigned int n = n_subdivisions + 1;
2753 const unsigned int n1 = (dim > 0) ? n_subdivisions : 1;
2754 const unsigned int n2 = (dim > 1) ? n_subdivisions : 1;
2755 const unsigned int n3 = (dim > 2) ? n_subdivisions : 1;
2757 const unsigned int d1 = 1;
2758 const unsigned int d2 = n;
2759 const unsigned int d3 = n * n;
2760 for (
unsigned int i3 = 0; i3 < n3; ++i3)
2761 for (
unsigned int i2 = 0; i2 < n2; ++i2)
2762 for (
unsigned int i1 = 0; i1 < n1; ++i1)
2764 const unsigned int offset =
2765 first_vertex_of_patch + i3 * d3 + i2 * d2 + i1 * d1;
2767 out.template write_cell<dim>(count++, offset, d1, d2, d3);
2770 first_vertex_of_patch +=
2771 Utilities::fixed_power<dim>(n_subdivisions + 1);
2778 template <
int dim,
int spacedim,
typename StreamType>
2784 unsigned int first_vertex_of_patch = 0;
2785 unsigned int count = 0;
2787 std::vector<unsigned> connectivity;
2789 std::array<unsigned, dim> cell_order;
2791 for (
const auto &patch : patches)
2795 connectivity.resize(patch.
data.n_cols());
2797 for (
unsigned int i = 0; i < patch.
data.n_cols(); ++i)
2798 connectivity[i] = i;
2800 out.template write_high_order_cell<dim>(count++,
2801 first_vertex_of_patch,
2804 first_vertex_of_patch += patch.
data.n_cols();
2809 const unsigned int n = n_subdivisions + 1;
2811 cell_order.fill(n_subdivisions);
2812 connectivity.resize(Utilities::fixed_power<dim>(n));
2815 const unsigned int n1 = (dim > 0) ? n_subdivisions : 0;
2816 const unsigned int n2 = (dim > 1) ? n_subdivisions : 0;
2817 const unsigned int n3 = (dim > 2) ? n_subdivisions : 0;
2819 const unsigned int d1 = 1;
2820 const unsigned int d2 = n;
2821 const unsigned int d3 = n * n;
2822 for (
unsigned int i3 = 0; i3 <= n3; ++i3)
2823 for (
unsigned int i2 = 0; i2 <= n2; ++i2)
2824 for (
unsigned int i1 = 0; i1 <= n1; ++i1)
2826 const unsigned int local_index =
2827 i3 * d3 + i2 * d2 + i1 * d1;
2828 const unsigned int connectivity_index =
2829 vtk_point_index_from_ijk(i1, i2, i3, cell_order);
2830 connectivity[connectivity_index] = local_index;
2833 out.template write_high_order_cell<dim>(count++,
2834 first_vertex_of_patch,
2838 first_vertex_of_patch += Utilities::fixed_power<dim>(n);
2846 template <
int dim,
int spacedim,
class StreamType>
2849 unsigned int n_data_sets,
2850 const bool double_precision,
2854 unsigned int count = 0;
2856 for (
const auto &patch : patches)
2859 const unsigned int n = n_subdivisions + 1;
2861 Assert((patch.
data.n_rows() == n_data_sets &&
2863 (patch.
data.n_rows() == n_data_sets + spacedim &&
2866 (n_data_sets + spacedim) :
2868 patch.
data.n_rows()));
2869 Assert(patch.
data.n_cols() == Utilities::fixed_power<dim>(n),
2872 std::vector<float> floats(n_data_sets);
2873 std::vector<double> doubles(n_data_sets);
2876 for (
unsigned int i = 0; i < Utilities::fixed_power<dim>(n);
2878 if (double_precision)
2880 for (
unsigned int data_set = 0; data_set < n_data_sets;
2882 doubles[data_set] = patch.
data(data_set, i);
2883 out.write_dataset(count, doubles);
2887 for (
unsigned int data_set = 0; data_set < n_data_sets;
2889 floats[data_set] = patch.
data(data_set, i);
2890 out.write_dataset(count, floats);
2914 camera_vertical[0] = camera_horizontal[1] * camera_direction[2] -
2915 camera_horizontal[2] * camera_direction[1];
2916 camera_vertical[1] = camera_horizontal[2] * camera_direction[0] -
2917 camera_horizontal[0] * camera_direction[2];
2918 camera_vertical[2] = camera_horizontal[0] * camera_direction[1] -
2919 camera_horizontal[1] * camera_direction[0];
2923 phi /= (
point[0] - camera_position[0]) * camera_direction[0] +
2924 (
point[1] - camera_position[1]) * camera_direction[1] +
2925 (
point[2] - camera_position[2]) * camera_direction[2];
2929 camera_position[0] + phi * (
point[0] - camera_position[0]);
2931 camera_position[1] + phi * (
point[1] - camera_position[1]);
2933 camera_position[2] + phi * (
point[2] - camera_position[2]);
2936 projection_decomposition[0] = (projection[0] - camera_position[0] -
2937 camera_focus * camera_direction[0]) *
2938 camera_horizontal[0];
2939 projection_decomposition[0] += (projection[1] - camera_position[1] -
2940 camera_focus * camera_direction[1]) *
2941 camera_horizontal[1];
2942 projection_decomposition[0] += (projection[2] - camera_position[2] -
2943 camera_focus * camera_direction[2]) *
2944 camera_horizontal[2];
2946 projection_decomposition[1] = (projection[0] - camera_position[0] -
2947 camera_focus * camera_direction[0]) *
2949 projection_decomposition[1] += (projection[1] - camera_position[1] -
2950 camera_focus * camera_direction[1]) *
2952 projection_decomposition[1] += (projection[2] - camera_position[2] -
2953 camera_focus * camera_direction[2]) *
2956 return projection_decomposition;
2970 for (
int i = 0; i < 2; ++i)
2972 for (
int j = 0; j < 2 - i; ++j)
2974 if (points[j][2] > points[j + 1][2])
2977 points[j] = points[j + 1];
2978 points[j + 1] = temp;
2985 v_inter = points[1];
2992 A[0][0] = v_max[0] - v_min[0];
2993 A[0][1] = v_inter[0] - v_min[0];
2994 A[1][0] = v_max[1] - v_min[1];
2995 A[1][1] = v_inter[1] - v_min[1];
3001 bool col_change =
false;
3010 double temp =
A[1][0];
3015 for (
unsigned int k = 0; k < 1; k++)
3017 for (
unsigned int i = k + 1; i < 2; i++)
3019 x =
A[i][k] /
A[k][k];
3021 for (
unsigned int j = k + 1; j < 2; j++)
3022 A[i][j] =
A[i][j] -
A[k][j] * x;
3024 b[i] =
b[i] -
b[k] * x;
3028 b[1] =
b[1] /
A[1][1];
3030 for (
int i = 0; i >= 0; i--)
3034 for (
unsigned int j = i + 1; j < 2; j++)
3037 b[i] =
sum /
A[i][i];
3047 double c =
b[0] * (v_max[2] - v_min[2]) +
b[1] * (v_inter[2] - v_min[2]) +
3051 A[0][0] = v_max[0] - v_min[0];
3052 A[0][1] = v_inter[0] - v_min[0];
3053 A[1][0] = v_max[1] - v_min[1];
3054 A[1][1] = v_inter[1] - v_min[1];
3056 b[0] = 1.0 - v_min[0];
3068 double temp =
A[1][0];
3073 for (
unsigned int k = 0; k < 1; k++)
3075 for (
unsigned int i = k + 1; i < 2; i++)
3077 x =
A[i][k] /
A[k][k];
3079 for (
unsigned int j = k + 1; j < 2; j++)
3080 A[i][j] =
A[i][j] -
A[k][j] * x;
3082 b[i] =
b[i] -
b[k] * x;
3086 b[1] =
b[1] /
A[1][1];
3088 for (
int i = 0; i >= 0; i--)
3092 for (
unsigned int j = i + 1; j < 2; j++)
3095 b[i] =
sum /
A[i][i];
3105 gradient[0] =
b[0] * (v_max[2] - v_min[2]) +
3106 b[1] * (v_inter[2] - v_min[2]) - c + v_min[2];
3109 A[0][0] = v_max[0] - v_min[0];
3110 A[0][1] = v_inter[0] - v_min[0];
3111 A[1][0] = v_max[1] - v_min[1];
3112 A[1][1] = v_inter[1] - v_min[1];
3115 b[1] = 1.0 - v_min[1];
3126 double temp =
A[1][0];
3131 for (
unsigned int k = 0; k < 1; k++)
3133 for (
unsigned int i = k + 1; i < 2; i++)
3135 x =
A[i][k] /
A[k][k];
3137 for (
unsigned int j = k + 1; j < 2; j++)
3138 A[i][j] =
A[i][j] -
A[k][j] * x;
3140 b[i] =
b[i] -
b[k] * x;
3144 b[1] =
b[1] /
A[1][1];
3146 for (
int i = 0; i >= 0; i--)
3150 for (
unsigned int j = i + 1; j < 2; j++)
3153 b[i] =
sum /
A[i][i];
3163 gradient[1] =
b[0] * (v_max[2] - v_min[2]) +
3164 b[1] * (v_inter[2] - v_min[2]) - c + v_min[2];
3167 double gradient_norm =
3173 gradient[1] * (v_min[1] - v_max[1]);
3177 gradient_parameters[0] = v_min[0];
3178 gradient_parameters[1] = v_min[1];
3183 gradient_parameters[4] = v_min[2];
3184 gradient_parameters[5] = v_max[2];
3186 return gradient_parameters;
3192 template <
int dim,
int spacedim>
3196 const std::vector<std::string> & data_names,
3198 std::tuple<
unsigned int,
3211#ifndef DEAL_II_WITH_MPI
3220 if (patches.size() == 0)
3224 const unsigned int n_data_sets = data_names.size();
3226 UcdStream ucd_out(out, flags);
3229 unsigned int n_nodes;
3231 compute_sizes<dim, spacedim>(patches, n_nodes,
n_cells);
3237 <<
"# This file was generated by the deal.II library." <<
'\n'
3241 <<
"# For a description of the UCD format see the AVS Developer's guide."
3247 out << n_nodes <<
' ' <<
n_cells <<
' ' << n_data_sets <<
' ' << 0
3260 if (n_data_sets != 0)
3262 out << n_data_sets <<
" ";
3263 for (
unsigned int i = 0; i < n_data_sets; ++i)
3268 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
3269 out << data_names[data_set]
3273 write_data(patches, n_data_sets,
true, ucd_out);
3283 template <
int dim,
int spacedim>
3287 const std::vector<std::string> & data_names,
3289 std::tuple<
unsigned int,
3301#ifndef DEAL_II_WITH_MPI
3310 if (patches.size() == 0)
3314 DXStream dx_out(out, flags);
3317 unsigned int offset = 0;
3319 const unsigned int n_data_sets = data_names.size();
3322 unsigned int n_nodes;
3324 compute_sizes<dim, spacedim>(patches, n_nodes,
n_cells);
3326 out <<
"object \"vertices\" class array type float rank 1 shape "
3327 << spacedim <<
" items " << n_nodes;
3331 out <<
" lsb ieee data 0" <<
'\n';
3332 offset += n_nodes * spacedim *
sizeof(float);
3336 out <<
" data follows" <<
'\n';
3345 out <<
"object \"cells\" class array type int rank 1 shape "
3350 out <<
" lsb binary data " << offset <<
'\n';
3355 out <<
" data follows" <<
'\n';
3361 out <<
"attribute \"element type\" string \"";
3368 out <<
"\"" <<
'\n' <<
"attribute \"ref\" string \"positions\"" <<
'\n';
3375 out <<
"object \"neighbors\" class array type int rank 1 shape "
3379 for (
const auto &patch : patches)
3382 const unsigned int n1 = (dim > 0) ? n : 1;
3383 const unsigned int n2 = (dim > 1) ? n : 1;
3384 const unsigned int n3 = (dim > 2) ? n : 1;
3385 unsigned int cells_per_patch = Utilities::fixed_power<dim>(n);
3386 unsigned int dx = 1;
3387 unsigned int dy = n;
3388 unsigned int dz = n * n;
3390 const unsigned int patch_start =
3393 for (
unsigned int i3 = 0; i3 < n3; ++i3)
3394 for (
unsigned int i2 = 0; i2 < n2; ++i2)
3395 for (
unsigned int i1 = 0; i1 < n1; ++i1)
3397 const unsigned int nx = i1 *
dx;
3398 const unsigned int ny = i2 * dy;
3399 const unsigned int nz = i3 * dz;
3411 const unsigned int nn = patch.
neighbors[0];
3415 << (nn * cells_per_patch + ny + nz +
dx * (n - 1));
3421 out <<
'\t' << patch_start + nx -
dx + ny + nz;
3426 const unsigned int nn = patch.
neighbors[1];
3429 out << (nn * cells_per_patch + ny + nz);
3435 out <<
'\t' << patch_start + nx +
dx + ny + nz;
3442 const unsigned int nn = patch.
neighbors[2];
3446 << (nn * cells_per_patch + nx + nz + dy * (n - 1));
3452 out <<
'\t' << patch_start + nx + ny - dy + nz;
3457 const unsigned int nn = patch.
neighbors[3];
3460 out << (nn * cells_per_patch + nx + nz);
3466 out <<
'\t' << patch_start + nx + ny + dy + nz;
3474 const unsigned int nn = patch.
neighbors[4];
3478 << (nn * cells_per_patch + nx + ny + dz * (n - 1));
3484 out <<
'\t' << patch_start + nx + ny + nz - dz;
3489 const unsigned int nn = patch.
neighbors[5];
3492 out << (nn * cells_per_patch + nx + ny);
3498 out <<
'\t' << patch_start + nx + ny + nz + dz;
3506 if (n_data_sets != 0)
3508 out <<
"object \"data\" class array type float rank 1 shape "
3509 << n_data_sets <<
" items " << n_nodes;
3513 out <<
" lsb ieee data " << offset <<
'\n';
3514 offset += n_data_sets * n_nodes *
3515 ((flags.
data_double) ?
sizeof(
double) :
sizeof(float));
3519 out <<
" data follows" <<
'\n';
3524 out <<
"attribute \"dep\" string \"positions\"" <<
'\n';
3528 out <<
"object \"data\" class constantarray type float rank 0 items "
3529 << n_nodes <<
" data follows" <<
'\n'
3535 out <<
"object \"deal data\" class field" <<
'\n'
3536 <<
"component \"positions\" value \"vertices\"" <<
'\n'
3537 <<
"component \"connections\" value \"cells\"" <<
'\n'
3538 <<
"component \"data\" value \"data\"" <<
'\n';
3541 out <<
"component \"neighbors\" value \"neighbors\"" <<
'\n';
3548 out <<
"end" <<
'\n';
3566 template <
int dim,
int spacedim>
3570 const std::vector<std::string> & data_names,
3572 std::tuple<
unsigned int,
3581#ifndef DEAL_II_WITH_MPI
3591 if (patches.size() == 0)
3595 const unsigned int n_data_sets = data_names.size();
3599 out <<
"# This file was generated by the deal.II library." <<
'\n'
3603 <<
"# For a description of the GNUPLOT format see the GNUPLOT manual."
3609 GnuplotFlags::ExcNotEnoughSpaceDimensionLabels());
3610 for (
unsigned int spacedim_n = 0; spacedim_n < spacedim; ++spacedim_n)
3615 for (
const auto &data_name : data_names)
3616 out <<
'<' << data_name <<
"> ";
3622 for (
const auto &patch : patches)
3625 const unsigned int n = n_subdivisions + 1;
3627 const unsigned int n1 = (dim > 0) ? n : 1;
3628 const unsigned int n2 = (dim > 1) ? n : 1;
3629 const unsigned int n3 = (dim > 2) ? n : 1;
3630 unsigned int d1 = 1;
3631 unsigned int d2 = n;
3632 unsigned int d3 = n * n;
3634 Assert((patch.
data.n_rows() == n_data_sets &&
3636 (patch.
data.n_rows() == n_data_sets + spacedim &&
3639 (n_data_sets + spacedim) :
3641 patch.
data.n_rows()));
3642 Assert(patch.
data.n_cols() == Utilities::fixed_power<dim>(n),
3648 for (
unsigned int i2 = 0; i2 < n2; ++i2)
3650 for (
unsigned int i1 = 0; i1 < n1; ++i1)
3653 out << compute_hypercube_node(
3654 patch, i1, i2, 0, n_subdivisions)
3657 for (
unsigned int data_set = 0; data_set < n_data_sets;
3659 out << patch.
data(data_set, i1 * d1 + i2 * d2) <<
' ';
3675 for (
unsigned int i3 = 0; i3 < n3; ++i3)
3676 for (
unsigned int i2 = 0; i2 < n2; ++i2)
3677 for (
unsigned int i1 = 0; i1 < n1; ++i1)
3681 compute_hypercube_node(patch, i1, i2, i3, n_subdivisions);
3683 if (i1 < n_subdivisions)
3687 for (
unsigned int data_set = 0; data_set < n_data_sets;
3690 << patch.
data(data_set,
3691 i1 * d1 + i2 * d2 + i3 * d3);
3695 out << compute_hypercube_node(
3696 patch, i1 + 1, i2, i3, n_subdivisions);
3698 for (
unsigned int data_set = 0; data_set < n_data_sets;
3701 << patch.
data(data_set,
3702 (i1 + 1) * d1 + i2 * d2 + i3 * d3);
3706 out <<
'\n' <<
'\n';
3710 if (i2 < n_subdivisions)
3714 for (
unsigned int data_set = 0; data_set < n_data_sets;
3717 << patch.
data(data_set,
3718 i1 * d1 + i2 * d2 + i3 * d3);
3722 out << compute_hypercube_node(
3723 patch, i1, i2 + 1, i3, n_subdivisions);
3725 for (
unsigned int data_set = 0; data_set < n_data_sets;
3728 << patch.
data(data_set,
3729 i1 * d1 + (i2 + 1) * d2 + i3 * d3);
3733 out <<
'\n' <<
'\n';
3737 if (i3 < n_subdivisions)
3741 for (
unsigned int data_set = 0; data_set < n_data_sets;
3744 << patch.
data(data_set,
3745 i1 * d1 + i2 * d2 + i3 * d3);
3749 out << compute_hypercube_node(
3750 patch, i1, i2, i3 + 1, n_subdivisions);
3752 for (
unsigned int data_set = 0; data_set < n_data_sets;
3755 << patch.
data(data_set,
3756 i1 * d1 + i2 * d2 + (i3 + 1) * d3);
3759 out <<
'\n' <<
'\n';
3774 template <
int dim,
int spacedim>
3778 const std::vector<std::string> & data_names,
3780 std::tuple<
unsigned int,
3789#ifndef DEAL_II_WITH_MPI
3798 if (patches.size() == 0)
3805 const unsigned int n_data_sets = data_names.size();
3810 out <<
"/* This file was generated by the deal.II library." <<
'\n'
3814 <<
" For a description of the POVRAY format see the POVRAY manual."
3819 out <<
"#include \"colors.inc\" " <<
'\n'
3820 <<
"#include \"textures.inc\" " <<
'\n';
3825 out <<
"#include \"data.inc\" " <<
'\n';
3831 <<
"camera {" <<
'\n'
3832 <<
" location <1,4,-7>" <<
'\n'
3833 <<
" look_at <0,0,0>" <<
'\n'
3834 <<
" angle 30" <<
'\n'
3839 <<
"light_source {" <<
'\n'
3840 <<
" <1,4,-7>" <<
'\n'
3841 <<
" color Grey" <<
'\n'
3844 <<
"light_source {" <<
'\n'
3845 <<
" <0,20,0>" <<
'\n'
3846 <<
" color White" <<
'\n'
3853 double hmin = patches[0].data(0, 0);
3854 double hmax = patches[0].data(0, 0);
3856 for (
const auto &patch : patches)
3860 Assert((patch.
data.n_rows() == n_data_sets &&
3862 (patch.
data.n_rows() == n_data_sets + spacedim &&
3865 (n_data_sets + spacedim) :
3867 patch.
data.n_rows()));
3869 Utilities::fixed_power<dim>(n_subdivisions + 1),
3872 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
3873 for (
unsigned int j = 0; j < n_subdivisions + 1; ++j)
3875 const int dl = i * (n_subdivisions + 1) + j;
3876 if (patch.
data(0, dl) < hmin)
3877 hmin = patch.
data(0, dl);
3878 if (patch.
data(0, dl) > hmax)
3879 hmax = patch.
data(0, dl);
3883 out <<
"#declare HMIN=" << hmin <<
";" <<
'\n'
3884 <<
"#declare HMAX=" << hmax <<
";" <<
'\n'
3890 out <<
"#declare Tex=texture{" <<
'\n'
3891 <<
" pigment {" <<
'\n'
3892 <<
" gradient y" <<
'\n'
3893 <<
" scale y*(HMAX-HMIN)*" << 0.1 <<
'\n'
3894 <<
" color_map {" <<
'\n'
3895 <<
" [0.00 color Light_Purple] " <<
'\n'
3896 <<
" [0.95 color Light_Purple] " <<
'\n'
3897 <<
" [1.00 color White] " <<
'\n'
3905 out <<
'\n' <<
"mesh {" <<
'\n';
3909 for (
const auto &patch : patches)
3912 const unsigned int n = n_subdivisions + 1;
3913 const unsigned int d1 = 1;
3914 const unsigned int d2 = n;
3916 Assert((patch.
data.n_rows() == n_data_sets &&
3918 (patch.
data.n_rows() == n_data_sets + spacedim &&
3921 (n_data_sets + spacedim) :
3923 patch.
data.n_rows()));
3924 Assert(patch.
data.n_cols() == Utilities::fixed_power<dim>(n),
3928 std::vector<Point<spacedim>> ver(n * n);
3930 for (
unsigned int i2 = 0; i2 < n; ++i2)
3931 for (
unsigned int i1 = 0; i1 < n; ++i1)
3934 ver[i1 * d1 + i2 * d2] =
3935 compute_hypercube_node(patch, i1, i2, 0, n_subdivisions);
3942 std::vector<Point<3>> nrml;
3952 for (
unsigned int i = 0; i < n; ++i)
3953 for (
unsigned int j = 0; j < n; ++j)
3955 const unsigned int il = (i == 0) ? i : (i - 1);
3956 const unsigned int ir =
3957 (i == n_subdivisions) ? i : (i + 1);
3958 const unsigned int jl = (j == 0) ? j : (j - 1);
3959 const unsigned int jr =
3960 (j == n_subdivisions) ? j : (j + 1);
3963 ver[ir * d1 + j * d2](0) - ver[il * d1 + j * d2](0);
3964 h1(1) = patch.
data(0, ir * d1 + j * d2) -
3965 patch.
data(0, il * d1 + j * d2);
3967 ver[ir * d1 + j * d2](1) - ver[il * d1 + j * d2](1);
3970 ver[i * d1 + jr * d2](0) - ver[i * d1 + jl * d2](0);
3971 h2(1) = patch.
data(0, i * d1 + jr * d2) -
3972 patch.
data(0, i * d1 + jl * d2);
3974 ver[i * d1 + jr * d2](1) - ver[i * d1 + jl * d2](1);
3976 nrml[i * d1 + j * d2](0) = h1(1) * h2(2) - h1(2) * h2(1);
3977 nrml[i * d1 + j * d2](1) = h1(2) * h2(0) - h1(0) * h2(2);
3978 nrml[i * d1 + j * d2](2) = h1(0) * h2(1) - h1(1) * h2(0);
3983 std::pow(nrml[i * d1 + j * d2](1), 2.) +
3984 std::pow(nrml[i * d1 + j * d2](2), 2.));
3986 if (nrml[i * d1 + j * d2](1) < 0)
3989 for (
unsigned int k = 0; k < 3; ++k)
3990 nrml[i * d1 + j * d2](k) /=
norm;
3995 for (
unsigned int i = 0; i < n_subdivisions; ++i)
3996 for (
unsigned int j = 0; j < n_subdivisions; ++j)
3999 const int dl = i * d1 + j * d2;
4005 out <<
"smooth_triangle {" <<
'\n'
4006 <<
"\t<" << ver[dl](0) <<
"," << patch.
data(0, dl)
4007 <<
"," << ver[dl](1) <<
">, <" << nrml[dl](0) <<
", "
4008 << nrml[dl](1) <<
", " << nrml[dl](2) <<
">," <<
'\n';
4009 out <<
" \t<" << ver[dl + d1](0) <<
","
4010 << patch.
data(0, dl + d1) <<
"," << ver[dl + d1](1)
4011 <<
">, <" << nrml[dl + d1](0) <<
", "
4012 << nrml[dl + d1](1) <<
", " << nrml[dl + d1](2)
4014 out <<
"\t<" << ver[dl + d1 + d2](0) <<
","
4015 << patch.
data(0, dl + d1 + d2) <<
","
4016 << ver[dl + d1 + d2](1) <<
">, <"
4017 << nrml[dl + d1 + d2](0) <<
", "
4018 << nrml[dl + d1 + d2](1) <<
", "
4019 << nrml[dl + d1 + d2](2) <<
">}" <<
'\n';
4022 out <<
"smooth_triangle {" <<
'\n'
4023 <<
"\t<" << ver[dl](0) <<
"," << patch.
data(0, dl)
4024 <<
"," << ver[dl](1) <<
">, <" << nrml[dl](0) <<
", "
4025 << nrml[dl](1) <<
", " << nrml[dl](2) <<
">," <<
'\n';
4026 out <<
"\t<" << ver[dl + d1 + d2](0) <<
","
4027 << patch.
data(0, dl + d1 + d2) <<
","
4028 << ver[dl + d1 + d2](1) <<
">, <"
4029 << nrml[dl + d1 + d2](0) <<
", "
4030 << nrml[dl + d1 + d2](1) <<
", "
4031 << nrml[dl + d1 + d2](2) <<
">," <<
'\n';
4032 out <<
"\t<" << ver[dl + d2](0) <<
","
4033 << patch.
data(0, dl + d2) <<
"," << ver[dl + d2](1)
4034 <<
">, <" << nrml[dl + d2](0) <<
", "
4035 << nrml[dl + d2](1) <<
", " << nrml[dl + d2](2)
4041 out <<
"triangle {" <<
'\n'
4042 <<
"\t<" << ver[dl](0) <<
"," << patch.
data(0, dl)
4043 <<
"," << ver[dl](1) <<
">," <<
'\n';
4044 out <<
"\t<" << ver[dl + d1](0) <<
","
4045 << patch.
data(0, dl + d1) <<
"," << ver[dl + d1](1)
4047 out <<
"\t<" << ver[dl + d1 + d2](0) <<
","
4048 << patch.
data(0, dl + d1 + d2) <<
","
4049 << ver[dl + d1 + d2](1) <<
">}" <<
'\n';
4052 out <<
"triangle {" <<
'\n'
4053 <<
"\t<" << ver[dl](0) <<
"," << patch.
data(0, dl)
4054 <<
"," << ver[dl](1) <<
">," <<
'\n';
4055 out <<
"\t<" << ver[dl + d1 + d2](0) <<
","
4056 << patch.
data(0, dl + d1 + d2) <<
","
4057 << ver[dl + d1 + d2](1) <<
">," <<
'\n';
4058 out <<
"\t<" << ver[dl + d2](0) <<
","
4059 << patch.
data(0, dl + d2) <<
"," << ver[dl + d2](1)
4067 Assert(n_subdivisions == 3,
4070 <<
"bicubic_patch {" <<
'\n'
4071 <<
" type 0" <<
'\n'
4072 <<
" flatness 0" <<
'\n'
4073 <<
" u_steps 0" <<
'\n'
4074 <<
" v_steps 0" <<
'\n';
4075 for (
int i = 0; i < 16; ++i)
4077 out <<
"\t<" << ver[i](0) <<
"," << patch.
data(0, i) <<
","
4078 << ver[i](1) <<
">";
4083 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n';
4090 out <<
" texture {Tex}" <<
'\n' <<
"}" <<
'\n' <<
'\n';
4101 template <
int dim,
int spacedim>
4105 const std::vector<std::string> & ,
4107 std::tuple<
unsigned int,
4119 template <
int spacedim>
4123 const std::vector<std::string> & ,
4125 std::tuple<
unsigned int,
4134#ifndef DEAL_II_WITH_MPI
4143 if (patches.size() == 0)
4153 std::multiset<EpsCell2d> cells;
4162 double heights[4] = {0, 0, 0, 0};
4166 for (
const auto &patch : patches)
4169 const unsigned int n = n_subdivisions + 1;
4170 const unsigned int d1 = 1;
4171 const unsigned int d2 = n;
4173 for (
unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
4174 for (
unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
4178 compute_hypercube_node(patch, i1, i2, 0, n_subdivisions);
4180 compute_hypercube_node(patch, i1 + 1, i2, 0, n_subdivisions);
4182 compute_hypercube_node(patch, i1, i2 + 1, 0, n_subdivisions);
4183 points[3] = compute_hypercube_node(
4184 patch, i1 + 1, i2 + 1, 0, n_subdivisions);
4190 patch.
data.n_rows() == 0,
4193 patch.
data.n_rows()));
4195 patch.
data.n_rows() != 0 ?
4199 heights[1] = patch.
data.n_rows() != 0 ?
4201 (i1 + 1) * d1 + i2 * d2) *
4204 heights[2] = patch.
data.n_rows() != 0 ?
4206 i1 * d1 + (i2 + 1) * d2) *
4209 heights[3] = patch.
data.n_rows() != 0 ?
4211 (i1 + 1) * d1 + (i2 + 1) * d2) *
4218 for (
unsigned int i = 0; i < 4; ++i)
4219 heights[i] = points[i](2);
4244 for (
unsigned int vertex = 0; vertex < 4; ++vertex)
4246 const double x = points[vertex](0), y = points[vertex](1),
4247 z = -heights[vertex];
4249 eps_cell.vertices[vertex](0) = -cz * x + sz * y;
4250 eps_cell.vertices[vertex](1) =
4251 -cx * sz * x - cx * cz * y - sx * z;
4275 (points[0] + points[1] + points[2] + points[3]) / 4;
4276 const double center_height =
4277 -(heights[0] + heights[1] + heights[2] + heights[3]) / 4;
4280 eps_cell.depth = -sx * sz * center_point(0) -
4281 sx * cz * center_point(1) + cx * center_height;
4286 patch.
data.n_rows() == 0,
4289 patch.
data.n_rows()));
4290 const double color_values[4] = {
4291 patch.
data.n_rows() != 0 ?
4295 patch.
data.n_rows() != 0 ?
4299 patch.
data.n_rows() != 0 ?
4303 patch.
data.n_rows() != 0 ?
4305 (i1 + 1) * d1 + (i2 + 1) * d2) :
4309 eps_cell.color_value = (color_values[0] + color_values[1] +
4310 color_values[3] + color_values[2]) /
4315 std::min(min_color_value, eps_cell.color_value);
4317 std::max(max_color_value, eps_cell.color_value);
4321 cells.insert(eps_cell);
4327 double x_min = cells.begin()->vertices[0](0);
4328 double x_max = x_min;
4329 double y_min = cells.begin()->vertices[0](1);
4330 double y_max = y_min;
4332 for (
const auto &cell : cells)
4333 for (
const auto &vertex : cell.vertices)
4335 x_min =
std::min(x_min, vertex(0));
4336 x_max =
std::max(x_max, vertex(0));
4337 y_min =
std::min(y_min, vertex(1));
4338 y_max =
std::max(y_max, vertex(1));
4343 const double scale =
4345 (flags.
size_type == EpsFlags::width ? x_max - x_min : y_min - y_max));
4347 const Point<2> offset(x_min, y_min);
4352 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4353 <<
"%%Title: deal.II Output" <<
'\n'
4354 <<
"%%Creator: the deal.II library" <<
'\n'
4357 <<
"%%BoundingBox: "
4361 <<
static_cast<unsigned int>((x_max - x_min) *
scale + 0.5) <<
' '
4362 <<
static_cast<unsigned int>((y_max - y_min) *
scale + 0.5) <<
'\n';
4371 out <<
"/m {moveto} bind def" <<
'\n'
4372 <<
"/l {lineto} bind def" <<
'\n'
4373 <<
"/s {setrgbcolor} bind def" <<
'\n'
4374 <<
"/sg {setgray} bind def" <<
'\n'
4375 <<
"/lx {lineto closepath stroke} bind def" <<
'\n'
4376 <<
"/lf {lineto closepath fill} bind def" <<
'\n';
4378 out <<
"%%EndProlog" <<
'\n' <<
'\n';
4380 out << flags.
line_width <<
" setlinewidth" <<
'\n';
4388 if (max_color_value == min_color_value)
4389 max_color_value = min_color_value + 1;
4393 for (
const auto &cell : cells)
4406 out << rgb_values.
red <<
" sg ";
4408 out << rgb_values.
red <<
' ' << rgb_values.
green <<
' '
4409 << rgb_values.
blue <<
" s ";
4414 out << (cell.vertices[0] - offset) *
scale <<
" m "
4415 << (cell.vertices[1] - offset) *
scale <<
" l "
4416 << (cell.vertices[3] - offset) *
scale <<
" l "
4417 << (cell.vertices[2] - offset) *
scale <<
" lf" <<
'\n';
4422 << (cell.vertices[0] - offset) *
scale <<
" m "
4423 << (cell.vertices[1] - offset) *
scale <<
" l "
4424 << (cell.vertices[3] - offset) *
scale <<
" l "
4425 << (cell.vertices[2] - offset) *
scale <<
" lx" <<
'\n';
4427 out <<
"showpage" <<
'\n';
4436 template <
int dim,
int spacedim>
4440 const std::vector<std::string> & data_names,
4442 std::tuple<
unsigned int,
4458#ifndef DEAL_II_WITH_MPI
4467 if (patches.size() == 0)
4471 GmvStream gmv_out(out, flags);
4472 const unsigned int n_data_sets = data_names.size();
4475 Assert((patches[0].data.n_rows() == n_data_sets &&
4476 !patches[0].points_are_available) ||
4477 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4478 patches[0].points_are_available),
4480 (n_data_sets + spacedim) :
4482 patches[0].data.n_rows()));
4486 out <<
"gmvinput ascii" <<
'\n' <<
'\n';
4489 unsigned int n_nodes;
4491 compute_sizes<dim, spacedim>(patches, n_nodes,
n_cells);
4506 void (*fun_ptr)(
const std::vector<Patch<dim, spacedim>> &,
4508 &write_gmv_reorder_data_vectors<dim, spacedim>;
4516 out <<
"nodes " << n_nodes <<
'\n';
4517 for (
unsigned int d = 0;
d < spacedim; ++
d)
4519 gmv_out.selected_component =
d;
4525 for (
unsigned int d = spacedim;
d < 3; ++
d)
4527 for (
unsigned int i = 0; i < n_nodes; ++i)
4534 out <<
"cells " <<
n_cells <<
'\n';
4539 out <<
"variable" <<
'\n';
4543 reorder_task.
join();
4547 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
4549 out << data_names[data_set] <<
" 1" <<
'\n';
4551 data_vectors[data_set].
end(),
4552 std::ostream_iterator<double>(out,
" "));
4553 out <<
'\n' <<
'\n';
4559 out <<
"endvars" <<
'\n';
4562 out <<
"endgmv" <<
'\n';
4573 template <
int dim,
int spacedim>
4577 const std::vector<std::string> & data_names,
4579 std::tuple<
unsigned int,
4593#ifndef DEAL_II_WITH_MPI
4602 if (patches.size() == 0)
4606 TecplotStream tecplot_out(out, flags);
4608 const unsigned int n_data_sets = data_names.size();
4611 Assert((patches[0].data.n_rows() == n_data_sets &&
4612 !patches[0].points_are_available) ||
4613 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4614 patches[0].points_are_available),
4616 (n_data_sets + spacedim) :
4618 patches[0].data.n_rows()));
4621 unsigned int n_nodes;
4623 compute_sizes<dim, spacedim>(patches, n_nodes,
n_cells);
4629 <<
"# This file was generated by the deal.II library." <<
'\n'
4633 <<
"# For a description of the Tecplot format see the Tecplot documentation."
4638 out <<
"Variables=";
4646 out <<
"\"x\", \"y\"";
4649 out <<
"\"x\", \"y\", \"z\"";
4655 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
4656 out <<
", \"" << data_names[data_set] <<
"\"";
4662 out <<
"t=\"" << flags.
zone_name <<
"\" ";
4665 out <<
"strandid=1, solutiontime=" << flags.
solution_time <<
", ";
4667 out <<
"f=feblock, n=" << n_nodes <<
", e=" <<
n_cells
4668 <<
", et=" << tecplot_cell_type[dim] <<
'\n';
4687 void (*fun_ptr)(
const std::vector<Patch<dim, spacedim>> &,
4689 &write_gmv_reorder_data_vectors<dim, spacedim>;
4697 for (
unsigned int d = 0;
d < spacedim; ++
d)
4699 tecplot_out.selected_component =
d;
4710 reorder_task.
join();
4713 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
4716 data_vectors[data_set].
end(),
4717 std::ostream_iterator<double>(out,
"\n"));
4735#ifdef DEAL_II_HAVE_TECPLOT
4742 TecplotMacros(
const unsigned int n_nodes = 0,
4743 const unsigned int n_vars = 0,
4744 const unsigned int n_cells = 0,
4745 const unsigned int n_vert = 0);
4748 nd(
const unsigned int i,
const unsigned int j);
4750 cd(
const unsigned int i,
const unsigned int j);
4751 std::vector<float> nodalData;
4752 std::vector<int> connData;
4755 unsigned int n_nodes;
4756 unsigned int n_vars;
4758 unsigned int n_vert;
4762 inline TecplotMacros::TecplotMacros(
const unsigned int n_nodes,
4763 const unsigned int n_vars,
4765 const unsigned int n_vert)
4771 nodalData.resize(n_nodes * n_vars);
4772 connData.resize(
n_cells * n_vert);
4777 inline TecplotMacros::~TecplotMacros()
4783 TecplotMacros::nd(
const unsigned int i,
const unsigned int j)
4785 return nodalData[i * n_nodes + j];
4791 TecplotMacros::cd(
const unsigned int i,
const unsigned int j)
4793 return connData[i + j * n_vert];
4804 template <
int dim,
int spacedim>
4808 const std::vector<std::string> & data_names,
4810 std::tuple<
unsigned int,
4814 & nonscalar_data_ranges,
4823#ifndef DEAL_II_HAVE_TECPLOT
4826 write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
4834 write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
4841 char *file_name = (
char *)flags.tecplot_binary_file_name;
4843 if (file_name ==
nullptr)
4848 ExcMessage(
"Specify the name of the tecplot_binary"
4849 " file through the TecplotFlags interface."));
4850 write_tecplot(patches, data_names, nonscalar_data_ranges, flags, out);
4857# ifndef DEAL_II_WITH_MPI
4866 if (patches.size() == 0)
4870 const unsigned int n_data_sets = data_names.size();
4873 Assert((patches[0].data.n_rows() == n_data_sets &&
4874 !patches[0].points_are_available) ||
4875 (patches[0].data.n_rows() == n_data_sets + spacedim &&
4876 patches[0].points_are_available),
4878 (n_data_sets + spacedim) :
4880 patches[0].data.n_rows()));
4883 unsigned int n_nodes;
4885 compute_sizes<dim, spacedim>(patches, n_nodes,
n_cells);
4887 const unsigned int vars_per_node = (spacedim + n_data_sets),
4890 TecplotMacros tm(n_nodes, vars_per_node,
n_cells, nodes_per_cell);
4892 int is_double = 0, tec_debug = 0, cell_type = tecplot_binary_cell_type[dim];
4894 std::string tec_var_names;
4898 tec_var_names =
"x y";
4901 tec_var_names =
"x y z";
4907 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
4909 tec_var_names +=
" ";
4910 tec_var_names += data_names[data_set];
4926 void (*fun_ptr)(
const std::vector<Patch<dim, spacedim>> &,
4928 &write_gmv_reorder_data_vectors<dim, spacedim>;
4934 for (
unsigned int d = 1;
d <= spacedim; ++
d)
4936 unsigned int entry = 0;
4938 for (
const auto &patch : patches)
4946 for (
unsigned int j = 0; j < n_subdivisions + 1; ++j)
4947 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
4949 const double x_frac = i * 1. / n_subdivisions,
4950 y_frac = j * 1. / n_subdivisions;
4952 tm.nd((
d - 1), entry) =
static_cast<float>(
4954 (patch.
vertices[0](
d - 1) * (1 - x_frac))) *
4957 (patch.
vertices[2](
d - 1) * (1 - x_frac))) *
4966 for (
unsigned int j = 0; j < n_subdivisions + 1; ++j)
4967 for (
unsigned int k = 0; k < n_subdivisions + 1; ++k)
4968 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
4970 const double x_frac = i * 1. / n_subdivisions,
4971 y_frac = k * 1. / n_subdivisions,
4972 z_frac = j * 1. / n_subdivisions;
4975 tm.nd((
d - 1), entry) =
static_cast<float>(
4976 ((((patch.
vertices[1](
d - 1) * x_frac) +
4977 (patch.
vertices[0](
d - 1) * (1 - x_frac))) *
4980 (patch.
vertices[2](
d - 1) * (1 - x_frac))) *
4984 (patch.
vertices[4](
d - 1) * (1 - x_frac))) *
4987 (patch.
vertices[6](
d - 1) * (1 - x_frac))) *
5005 reorder_task.
join();
5008 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
5009 for (
unsigned int entry = 0; entry < data_vectors[data_set].size();
5011 tm.nd((spacedim + data_set), entry) =
5012 static_cast<float>(data_vectors[data_set][entry]);
5018 unsigned int first_vertex_of_patch = 0;
5019 unsigned int elem = 0;
5021 for (
const auto &patch : patches)
5024 const unsigned int n = n_subdivisions + 1;
5025 const unsigned int d1 = 1;
5026 const unsigned int d2 = n;
5027 const unsigned int d3 = n * n;
5033 for (
unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
5034 for (
unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
5037 first_vertex_of_patch + (i1)*d1 + (i2)*d2 + 1;
5039 first_vertex_of_patch + (i1 + 1) * d1 + (i2)*d2 + 1;
5040 tm.cd(2, elem) = first_vertex_of_patch + (i1 + 1) * d1 +
5043 first_vertex_of_patch + (i1)*d1 + (i2 + 1) * d2 + 1;
5052 for (
unsigned int i3 = 0; i3 < n_subdivisions; ++i3)
5053 for (
unsigned int i2 = 0; i2 < n_subdivisions; ++i2)
5054 for (
unsigned int i1 = 0; i1 < n_subdivisions; ++i1)
5059 tm.cd(0, elem) = first_vertex_of_patch + (i1)*d1 +
5060 (i2)*d2 + (i3)*d3 + 1;
5061 tm.cd(1, elem) = first_vertex_of_patch + (i1 + 1) * d1 +
5062 (i2)*d2 + (i3)*d3 + 1;
5063 tm.cd(2, elem) = first_vertex_of_patch + (i1 + 1) * d1 +
5064 (i2 + 1) * d2 + (i3)*d3 + 1;
5065 tm.cd(3, elem) = first_vertex_of_patch + (i1)*d1 +
5066 (i2 + 1) * d2 + (i3)*d3 + 1;
5067 tm.cd(4, elem) = first_vertex_of_patch + (i1)*d1 +
5068 (i2)*d2 + (i3 + 1) * d3 + 1;
5069 tm.cd(5, elem) = first_vertex_of_patch + (i1 + 1) * d1 +
5070 (i2)*d2 + (i3 + 1) * d3 + 1;
5071 tm.cd(6, elem) = first_vertex_of_patch + (i1 + 1) * d1 +
5072 (i2 + 1) * d2 + (i3 + 1) * d3 + 1;
5073 tm.cd(7, elem) = first_vertex_of_patch + (i1)*d1 +
5074 (i2 + 1) * d2 + (i3 + 1) * d3 + 1;
5087 first_vertex_of_patch += Utilities::fixed_power<dim>(n);
5092 int ierr = 0, num_nodes =
static_cast<int>(n_nodes),
5093 num_cells =
static_cast<int>(
n_cells);
5095 char dot[2] = {
'.', 0};
5099 char *var_names =
const_cast<char *
>(tec_var_names.c_str());
5100 ierr = TECINI(
nullptr, var_names, file_name, dot, &tec_debug, &is_double);
5104 char FEBLOCK[] = {
'F',
'E',
'B',
'L',
'O',
'C',
'K', 0};
5106 TECZNE(
nullptr, &num_nodes, &num_cells, &cell_type, FEBLOCK,
nullptr);
5110 int total = (vars_per_node * num_nodes);
5112 ierr = TECDAT(&total, tm.nodalData.data(), &is_double);
5116 ierr = TECNOD(tm.connData.data());
5129 template <
int dim,
int spacedim>
5133 const std::vector<std::string> & data_names,
5135 std::tuple<
unsigned int,
5139 & nonscalar_data_ranges,
5145#ifndef DEAL_II_WITH_MPI
5154 if (patches.size() == 0)
5158 VtkStream vtk_out(out, flags);
5160 const unsigned int n_data_sets = data_names.size();
5162 if (patches[0].points_are_available)
5174 out <<
"# vtk DataFile Version 3.0" <<
'\n'
5175 <<
"#This file was generated by the deal.II library";
5183 out <<
'\n' <<
"ASCII" <<
'\n';
5185 out <<
"DATASET UNSTRUCTURED_GRID\n" <<
'\n';
5192 const unsigned int n_metadata =
5197 out <<
"FIELD FieldData " << n_metadata <<
"\n";
5201 out <<
"CYCLE 1 1 int\n" << flags.
cycle <<
"\n";
5205 out <<
"TIME 1 1 double\n" << flags.
time <<
"\n";
5211 unsigned int n_nodes,
n_cells, n_points_and_n_cells;
5212 compute_sizes(patches,
5216 n_points_and_n_cells);
5232 void (*fun_ptr)(
const std::vector<Patch<dim, spacedim>> &,
5234 &write_gmv_reorder_data_vectors<dim, spacedim>;
5242 out <<
"POINTS " << n_nodes <<
" double" <<
'\n';
5247 out <<
"CELLS " <<
n_cells <<
' ' << n_points_and_n_cells <<
'\n';
5255 out <<
"CELL_TYPES " <<
n_cells <<
'\n';
5259 for (
const auto &patch : patches)
5261 const auto vtk_cell_id =
5264 for (
unsigned int i = 0; i < vtk_cell_id[1]; ++i)
5265 out <<
' ' << vtk_cell_id[0];
5274 reorder_task.
join();
5279 out <<
"POINT_DATA " << n_nodes <<
'\n';
5283 std::vector<bool> data_set_written(n_data_sets,
false);
5284 for (
const auto &nonscalar_data_range : nonscalar_data_ranges)
5291 std::get<0>(nonscalar_data_range),
5293 std::get<0>(nonscalar_data_range)));
5294 AssertThrow(std::get<1>(nonscalar_data_range) < n_data_sets,
5298 AssertThrow(std::get<1>(nonscalar_data_range) + 1 -
5299 std::get<0>(nonscalar_data_range) <=
5302 "Can't declare a vector with more than 3 components "
5306 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5307 i <= std::get<1>(nonscalar_data_range);
5309 data_set_written[i] =
true;
5315 if (!std::get<2>(nonscalar_data_range).empty())
5316 out << std::get<2>(nonscalar_data_range);
5319 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5320 i < std::get<1>(nonscalar_data_range);
5322 out << data_names[i] <<
"__";
5323 out << data_names[std::get<1>(nonscalar_data_range)];
5326 out <<
" double" <<
'\n';
5329 for (
unsigned int n = 0; n < n_nodes; ++n)
5331 switch (std::get<1>(nonscalar_data_range) -
5332 std::get<0>(nonscalar_data_range))
5335 out << data_vectors(std::get<0>(nonscalar_data_range), n)
5340 out << data_vectors(std::get<0>(nonscalar_data_range), n)
5342 << data_vectors(std::get<0>(nonscalar_data_range) + 1, n)
5346 out << data_vectors(std::get<0>(nonscalar_data_range), n)
5348 << data_vectors(std::get<0>(nonscalar_data_range) + 1, n)
5350 << data_vectors(std::get<0>(nonscalar_data_range) + 2, n)
5363 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
5364 if (data_set_written[data_set] ==
false)
5366 out <<
"SCALARS " << data_names[data_set] <<
" double 1" <<
'\n'
5367 <<
"LOOKUP_TABLE default" <<
'\n';
5369 data_vectors[data_set].
end(),
5370 std::ostream_iterator<double>(out,
" "));
5386 out <<
"<?xml version=\"1.0\" ?> \n";
5388 out <<
"# vtk DataFile Version 3.0" <<
'\n'
5389 <<
"#This file was generated by the deal.II library";
5398 out <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\"";
5399#ifdef DEAL_II_WITH_ZLIB
5400 out <<
" compressor=\"vtkZLibDataCompressor\"";
5402#ifdef DEAL_II_WORDS_BIGENDIAN
5403 out <<
" byte_order=\"BigEndian\"";
5405 out <<
" byte_order=\"LittleEndian\"";
5409 out <<
"<UnstructuredGrid>";
5419 out <<
" </UnstructuredGrid>\n";
5420 out <<
"</VTKFile>\n";
5425 template <
int dim,
int spacedim>
5429 const std::vector<std::string> & data_names,
5431 std::tuple<
unsigned int,
5435 & nonscalar_data_ranges,
5440 write_vtu_main(patches, data_names, nonscalar_data_ranges, flags, out);
5447 template <
int dim,
int spacedim>
5451 const std::vector<std::string> & data_names,
5453 std::tuple<
unsigned int,
5457 & nonscalar_data_ranges,
5463#ifndef DEAL_II_WITH_MPI
5472 if (patches.size() == 0)
5477 out <<
"<Piece NumberOfPoints=\"0\" NumberOfCells=\"0\" >\n"
5479 <<
"<DataArray type=\"UInt8\" Name=\"types\"></DataArray>\n"
5481 <<
" <PointData Scalars=\"scalars\">\n";
5482 std::vector<bool> data_set_written(data_names.size(),
false);
5483 for (
const auto &nonscalar_data_range : nonscalar_data_ranges)
5486 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5487 i <= std::get<1>(nonscalar_data_range);
5489 data_set_written[i] =
true;
5493 out <<
" <DataArray type=\"Float32\" Name=\"";
5495 if (!std::get<2>(nonscalar_data_range).empty())
5496 out << std::get<2>(nonscalar_data_range);
5499 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5500 i < std::get<1>(nonscalar_data_range);
5502 out << data_names[i] <<
"__";
5503 out << data_names[std::get<1>(nonscalar_data_range)];
5506 out <<
"\" NumberOfComponents=\"3\"></DataArray>\n";
5509 for (
unsigned int data_set = 0; data_set < data_names.size();
5511 if (data_set_written[data_set] ==
false)
5513 out <<
" <DataArray type=\"Float32\" Name=\""
5514 << data_names[data_set] <<
"\"></DataArray>\n";
5517 out <<
" </PointData>\n";
5518 out <<
"</Piece>\n";
5532 const unsigned int n_metadata =
5536 out <<
"<FieldData>\n";
5541 <<
"<DataArray type=\"Float32\" Name=\"CYCLE\" NumberOfTuples=\"1\" format=\"ascii\">"
5542 << flags.
cycle <<
"</DataArray>\n";
5547 <<
"<DataArray type=\"Float32\" Name=\"TIME\" NumberOfTuples=\"1\" format=\"ascii\">"
5548 << flags.
time <<
"</DataArray>\n";
5552 out <<
"</FieldData>\n";
5556 VtuStream vtu_out(out, flags);
5558 const unsigned int n_data_sets = data_names.size();
5561 if (patches[0].points_are_available)
5570#ifdef DEAL_II_WITH_ZLIB
5571 const char *ascii_or_binary =
"binary";
5573 const char * ascii_or_binary =
"ascii";
5578 unsigned int n_nodes,
n_cells, n_points_and_n_cells;
5579 compute_sizes(patches,
5583 n_points_and_n_cells);
5599 void (*fun_ptr)(
const std::vector<Patch<dim, spacedim>> &,
5601 &write_gmv_reorder_data_vectors<dim, spacedim, float>;
5610 out <<
"<Piece NumberOfPoints=\"" << n_nodes <<
"\" NumberOfCells=\""
5612 out <<
" <Points>\n";
5613 out <<
" <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\""
5614 << ascii_or_binary <<
"\">\n";
5616 out <<
" </DataArray>\n";
5617 out <<
" </Points>\n\n";
5620 out <<
" <Cells>\n";
5621 out <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\""
5622 << ascii_or_binary <<
"\">\n";
5627 out <<
" </DataArray>\n";
5631 out <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\""
5632 << ascii_or_binary <<
"\">\n";
5634 std::vector<int32_t> offsets;
5639#ifdef DEAL_II_WITH_ZLIB
5640 std::vector<uint8_t> cell_types;
5642 std::vector<unsigned int> cell_types;
5646 unsigned int first_vertex_of_patch = 0;
5648 for (
const auto &patch : patches)
5650 const auto vtk_cell_id =
5653 for (
unsigned int i = 0; i < vtk_cell_id[1]; ++i)
5655 cell_types.push_back(vtk_cell_id[0]);
5656 first_vertex_of_patch += vtk_cell_id[2];
5657 offsets.push_back(first_vertex_of_patch);
5663 out <<
" </DataArray>\n";
5667 out <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\""
5668 << ascii_or_binary <<
"\">\n";
5671 vtu_out << cell_types;
5673 out <<
" </DataArray>\n";
5674 out <<
" </Cells>\n";
5682 reorder_task.
join();
5687 out <<
" <PointData Scalars=\"scalars\">\n";
5691 std::vector<bool> data_set_written(n_data_sets,
false);
5692 for (
const auto &range : nonscalar_data_ranges)
5694 const auto first_component = std::get<0>(range);
5695 const auto last_component = std::get<1>(range);
5696 const auto &name = std::get<2>(range);
5697 const bool is_tensor =
5698 (std::get<3>(range) ==
5700 const unsigned int n_components = (is_tensor ? 9 : 3);
5707 AssertThrow((last_component + 1 - first_component <= 9),
5709 "Can't declare a tensor with more than 9 components "
5714 AssertThrow((last_component + 1 - first_component <= 3),
5716 "Can't declare a vector with more than 3 components "
5721 for (
unsigned int i = first_component; i <= last_component; ++i)
5722 data_set_written[i] =
true;
5726 out <<
" <DataArray type=\"Float32\" Name=\"";
5732 for (
unsigned int i = first_component; i < last_component; ++i)
5733 out << data_names[i] <<
"__";
5734 out << data_names[last_component];
5737 out <<
"\" NumberOfComponents=\"" << n_components <<
"\" format=\""
5738 << ascii_or_binary <<
"\">\n";
5741 std::vector<float> data;
5742 data.reserve(n_nodes * n_components);
5744 for (
unsigned int n = 0; n < n_nodes; ++n)
5748 switch (last_component - first_component)
5751 data.push_back(data_vectors(first_component, n));
5757 data.push_back(data_vectors(first_component, n));
5758 data.push_back(data_vectors(first_component + 1, n));
5763 data.push_back(data_vectors(first_component, n));
5764 data.push_back(data_vectors(first_component + 1, n));
5765 data.push_back(data_vectors(first_component + 2, n));
5778 const unsigned int size = last_component - first_component + 1;
5782 vtk_data[0][0] = data_vectors(first_component, n);
5787 for (
unsigned int c = 0; c < size; ++c)
5791 vtk_data[ind[0]][ind[1]] =
5792 data_vectors(first_component + c, n);
5798 for (
unsigned int c = 0; c < size; ++c)
5802 vtk_data[ind[0]][ind[1]] =
5803 data_vectors(first_component + c, n);
5814 for (
unsigned int i = 0; i < 3; ++i)
5815 for (
unsigned int j = 0; j < 3; ++j)
5816 data.push_back(vtk_data[i][j]);
5821 out <<
" </DataArray>\n";
5826 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
5827 if (data_set_written[data_set] ==
false)
5829 out <<
" <DataArray type=\"Float32\" Name=\""
5830 << data_names[data_set] <<
"\" format=\"" << ascii_or_binary
5833 std::vector<float> data(data_vectors[data_set].
begin(),
5834 data_vectors[data_set].
end());
5836 out <<
" </DataArray>\n";
5839 out <<
" </PointData>\n";
5842 out <<
" </Piece>\n";
5856 const std::vector<std::string> &piece_names,
5857 const std::vector<std::string> &data_names,
5859 std::tuple<
unsigned int,
5863 &nonscalar_data_ranges)
5867 const unsigned int n_data_sets = data_names.size();
5869 out <<
"<?xml version=\"1.0\"?>\n";
5872 out <<
"#This file was generated by the deal.II library"
5877 <<
"<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
5878 out <<
" <PUnstructuredGrid GhostLevel=\"0\">\n";
5879 out <<
" <PPointData Scalars=\"scalars\">\n";
5882 std::vector<bool> data_set_written(n_data_sets,
false);
5883 for (
const auto &nonscalar_data_range : nonscalar_data_ranges)
5885 const auto first_component = std::get<0>(nonscalar_data_range);
5886 const auto last_component = std::get<1>(nonscalar_data_range);
5887 const bool is_tensor =
5888 (std::get<3>(nonscalar_data_range) ==
5890 const unsigned int n_components = (is_tensor ? 9 : 3);
5897 AssertThrow((last_component + 1 - first_component <= 9),
5899 "Can't declare a tensor with more than 9 components "
5904 Assert((last_component + 1 - first_component <= 3),
5906 "Can't declare a vector with more than 3 components "
5911 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5912 i <= std::get<1>(nonscalar_data_range);
5914 data_set_written[i] =
true;
5918 out <<
" <PDataArray type=\"Float32\" Name=\"";
5920 if (!std::get<2>(nonscalar_data_range).empty())
5921 out << std::get<2>(nonscalar_data_range);
5924 for (
unsigned int i = std::get<0>(nonscalar_data_range);
5925 i < std::get<1>(nonscalar_data_range);
5927 out << data_names[i] <<
"__";
5928 out << data_names[std::get<1>(nonscalar_data_range)];
5931 out <<
"\" NumberOfComponents=\"" << n_components
5932 <<
"\" format=\"ascii\"/>\n";
5935 for (
unsigned int data_set = 0; data_set < n_data_sets; ++data_set)
5936 if (data_set_written[data_set] ==
false)
5938 out <<
" <PDataArray type=\"Float32\" Name=\""
5939 << data_names[data_set] <<
"\" format=\"ascii\"/>\n";
5942 out <<
" </PPointData>\n";
5944 out <<
" <PPoints>\n";
5945 out <<
" <PDataArray type=\"Float32\" NumberOfComponents=\"3\"/>\n";
5946 out <<
" </PPoints>\n";
5948 for (
const auto &piece_name : piece_names)
5949 out <<
" <Piece Source=\"" << piece_name <<
"\"/>\n";
5951 out <<
" </PUnstructuredGrid>\n";
5952 out <<
"</VTKFile>\n";
5965 const std::vector<std::pair<double, std::string>> ×_and_names)
5969 out <<
"<?xml version=\"1.0\"?>\n";
5972 out <<
"#This file was generated by the deal.II library"
5977 <<
"<VTKFile type=\"Collection\" version=\"0.1\" ByteOrder=\"LittleEndian\">\n";
5978 out <<
" <Collection>\n";
5980 std::streamsize ss = out.precision();
5983 for (
const auto &time_and_name : times_and_names)
5984 out <<
" <DataSet timestep=\"" << time_and_name.first
5985 <<
"\" group=\"\" part=\"0\" file=\"" << time_and_name.second
5988 out <<
" </Collection>\n";
5989 out <<
"</VTKFile>\n";
6001 const std::vector<std::string> &piece_names)
6003 out <<
"!NBLOCKS " << piece_names.size() <<
'\n';
6004 for (
const auto &piece_name : piece_names)
6005 out << piece_name <<
'\n';
6014 const std::vector<std::vector<std::string>> &piece_names)
6018 if (piece_names.size() == 0)
6021 const double nblocks = piece_names[0].size();
6023 ExcMessage(
"piece_names should be a vector of nonempty vectors."));
6025 out <<
"!NBLOCKS " << nblocks <<
'\n';
6026 for (
const auto &domain : piece_names)
6028 Assert(domain.size() == nblocks,
6030 "piece_names should be a vector of equal sized vectors."));
6031 for (
const auto &subdomain : domain)
6032 out << subdomain <<
'\n';
6043 const std::vector<std::pair<
double, std::vector<std::string>>>
6044 ×_and_piece_names)
6048 if (times_and_piece_names.size() == 0)
6051 const double nblocks = times_and_piece_names[0].second.size();
6055 "time_and_piece_names should contain nonempty vectors of filenames for every timestep."));
6057 for (
const auto &domain : times_and_piece_names)
6058 out <<
"!TIME " << domain.first <<
'\n';
6060 out <<
"!NBLOCKS " << nblocks <<
'\n';
6061 for (
const auto &domain : times_and_piece_names)
6063 Assert(domain.second.size() == nblocks,
6065 "piece_names should be a vector of equal sized vectors."));
6066 for (
const auto &subdomain : domain.second)
6067 out << subdomain <<
'\n';
6075 template <
int dim,
int spacedim>
6079 const std::vector<std::string> &,
6081 std::tuple<
unsigned int,
6091 template <
int spacedim>
6095 const std::vector<std::string> & ,
6097 std::tuple<
unsigned int,
6105 const unsigned int height = flags.
height;
6106 unsigned int width = flags.
width;
6109 unsigned int margin_in_percent = 0;
6111 margin_in_percent = 5;
6115 double x_dimension, y_dimension, z_dimension;
6117 const auto &first_patch = patches[0];
6119 unsigned int n_subdivisions = first_patch.n_subdivisions;
6120 unsigned int n = n_subdivisions + 1;
6121 const unsigned int d1 = 1;
6122 const unsigned int d2 = n;
6125 std::array<Point<spacedim>, 4> projected_points;
6128 std::array<Point<2>, 4> projection_decompositions;
6131 compute_hypercube_node(first_patch, 0, 0, 0, n_subdivisions);
6133 if (first_patch.data.n_rows() != 0)