34 #include <boost/archive/binary_oarchive.hpp>
36 #ifdef DEAL_II_GMSH_WITH_API
55 const bool write_faces,
56 const bool write_diameter,
57 const bool write_measure,
58 const bool write_all_faces)
60 , write_faces(write_faces)
61 , write_diameter(write_diameter)
62 , write_measure(write_measure)
63 , write_all_faces(write_all_faces)
72 "Write the mesh connectivity as DX grid cells");
76 "Write faces of cells. These may be boundary faces "
77 "or all faces between mesh cells, according to "
78 "\"Write all faces\"");
82 "If cells are written, additionally write their"
83 " diameter as data for visualization");
87 "Write the volume of each cell as data");
91 "Write all faces, not only boundary");
105 Msh::Msh(
const bool write_faces,
const bool write_lines)
106 : write_faces(write_faces)
107 , write_lines(write_lines)
127 const bool write_faces,
128 const bool write_lines)
129 : write_preamble(write_preamble)
130 , write_faces(write_faces)
131 , write_lines(write_lines)
156 const unsigned int n_extra_curved_line_points,
157 const bool curved_inner_cells,
158 const bool write_additional_boundary_lines)
159 : write_cell_numbers(write_cell_numbers)
160 , n_extra_curved_line_points(n_extra_curved_line_points)
161 , curved_inner_cells(curved_inner_cells)
162 , write_additional_boundary_lines(write_additional_boundary_lines)
184 const unsigned int size,
185 const double line_width,
186 const bool color_lines_on_user_flag,
187 const unsigned int n_boundary_face_points,
188 const bool color_lines_level)
191 , line_width(line_width)
192 , color_lines_on_user_flag(color_lines_on_user_flag)
193 , n_boundary_face_points(n_boundary_face_points)
194 , color_lines_level(color_lines_level)
204 "Depending on this parameter, either the "
206 "of the eps is scaled to \"Size\"");
210 "Size of the output in points");
214 "Width of the lines drawn in points");
218 "Draw lines with user flag set in different color");
222 "Number of points on boundary edges. "
223 "Increase this beyond 2 to see curved boundaries.");
227 "Draw different colors according to grid level.");
234 if (param.
get(
"Size by") == std::string(
"width"))
236 else if (param.
get(
"Size by") == std::string(
"height"))
248 const unsigned int size,
249 const double line_width,
250 const bool color_lines_on_user_flag,
251 const unsigned int n_boundary_face_points)
255 color_lines_on_user_flag,
256 n_boundary_face_points)
274 const unsigned int size,
275 const double line_width,
276 const bool color_lines_on_user_flag,
277 const unsigned int n_boundary_face_points,
278 const bool write_cell_numbers,
279 const bool write_cell_number_level,
280 const bool write_vertex_numbers,
281 const bool color_lines_level)
285 color_lines_on_user_flag,
286 n_boundary_face_points,
288 , write_cell_numbers(write_cell_numbers)
289 , write_cell_number_level(write_cell_number_level)
290 , write_vertex_numbers(write_vertex_numbers)
300 "(2d only) Write cell numbers"
301 " into the centers of cells");
305 "(2d only) if \"Cell number\" is true, write "
306 "numbers in the form level.number");
310 "Write numbers for each vertex");
318 write_cell_numbers = param.
get_bool(
"Cell number");
319 write_cell_number_level = param.
get_bool(
"Level number");
320 write_vertex_numbers = param.
get_bool(
"Vertex number");
326 const unsigned int size,
327 const double line_width,
328 const bool color_lines_on_user_flag,
329 const unsigned int n_boundary_face_points,
330 const double azimut_angle,
331 const double turn_angle)
335 color_lines_on_user_flag,
336 n_boundary_face_points)
337 , azimut_angle(azimut_angle)
338 , turn_angle(turn_angle)
348 "Azimuth of the viw point, that is, the angle "
349 "in the plane from the x-axis.");
353 "Elevation of the view point above the xy-plane.");
361 azimut_angle = 90 - param.
get_double(
"Elevation");
368 : draw_boundary(true)
371 , n_boundary_face_points(0)
377 , boundary_thickness(3)
411 const unsigned int boundary_line_thickness,
414 const int azimuth_angle,
415 const int polar_angle,
417 const bool convert_level_number_to_height,
418 const bool label_level_number,
419 const bool label_cell_index,
420 const bool label_material_id,
421 const bool label_subdomain_id,
422 const bool draw_colorbar,
423 const bool draw_legend,
424 const bool label_boundary_id)
427 , line_thickness(line_thickness)
428 , boundary_line_thickness(boundary_line_thickness)
430 , background(background)
431 , azimuth_angle(azimuth_angle)
432 , polar_angle(polar_angle)
434 , convert_level_number_to_height(convert_level_number_to_height)
435 , level_height_factor(0.3f)
436 , cell_font_scaling(1.f)
437 , label_level_number(label_level_number)
438 , label_cell_index(label_cell_index)
439 , label_material_id(label_material_id)
440 , label_subdomain_id(label_subdomain_id)
441 , label_level_subdomain_id(false)
442 , label_boundary_id(label_boundary_id)
443 , draw_colorbar(draw_colorbar)
444 , draw_legend(draw_legend)
448 : draw_bounding_box(false)
561 switch (output_format)
604 if (format_name ==
"none" || format_name ==
"false")
607 if (format_name ==
"dx")
610 if (format_name ==
"ucd")
613 if (format_name ==
"gnuplot")
616 if (format_name ==
"eps")
619 if (format_name ==
"xfig")
622 if (format_name ==
"msh")
625 if (format_name ==
"svg")
628 if (format_name ==
"mathgl")
631 if (format_name ==
"vtk")
634 if (format_name ==
"vtu")
647 return "none|dx|gnuplot|eps|ucd|xfig|msh|svg|mathgl|vtk|vtu";
780 template <
int dim,
int spacedim>
783 std::ostream &out)
const
799 std::vector<unsigned int> renumber(
vertices.size());
802 unsigned int new_number = 0;
803 for (
unsigned int i = 0; i <
vertices.size(); ++i)
805 renumber[i] = new_number++;
809 out <<
"object \"vertices\" class array type float rank 1 shape " << dim
810 <<
" items " << n_vertices <<
" data follows" <<
'\n';
812 for (
unsigned int i = 0; i <
vertices.size(); ++i)
821 const unsigned int n_faces =
829 out <<
"object \"cells\" class array type int rank 1 shape "
830 << n_vertices_per_cell <<
" items " <<
n_cells <<
" data follows"
841 out <<
"attribute \"element type\" string \"";
849 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
854 out <<
"object \"material\" class array type int rank 0 items " <<
n_cells
855 <<
" data follows" <<
'\n';
857 out <<
' ' << cell->material_id();
858 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
860 out <<
"object \"level\" class array type int rank 0 items " <<
n_cells
861 <<
" data follows" <<
'\n';
863 out <<
' ' << cell->level();
864 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
868 out <<
"object \"measure\" class array type float rank 0 items "
869 <<
n_cells <<
" data follows" <<
'\n';
871 out <<
'\t' << cell->measure();
873 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
879 out <<
"object \"diameter\" class array type float rank 0 items "
880 <<
n_cells <<
" data follows" <<
'\n';
882 out <<
'\t' << cell->diameter();
884 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
891 out <<
"object \"faces\" class array type int rank 1 shape "
892 << n_vertices_per_face <<
" items " << n_faces <<
" data follows"
897 for (
const unsigned int f : cell->face_indices())
902 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
905 << renumber[face->vertex_index(
910 out <<
"attribute \"element type\" string \"";
916 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
922 out <<
"object \"boundary\" class array type int rank 0 items " << n_faces
923 <<
" data follows" <<
'\n';
930 <<
static_cast<std::make_signed_t<types::boundary_id>
>(
931 cell->face(f)->boundary_id());
935 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
939 out <<
"object \"face measure\" class array type float rank 0 items "
940 << n_faces <<
" data follows" <<
'\n';
944 out <<
' ' << cell->face(f)->measure();
947 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
952 out <<
"object \"face diameter\" class array type float rank 0 items "
953 << n_faces <<
" data follows" <<
'\n';
957 out <<
' ' << cell->face(f)->diameter();
960 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
975 out <<
"object \"deal data\" class field" <<
'\n'
976 <<
"component \"positions\" value \"vertices\"" <<
'\n'
977 <<
"component \"connections\" value \"cells\"" <<
'\n';
981 out <<
"object \"cell data\" class field" <<
'\n'
982 <<
"component \"positions\" value \"vertices\"" <<
'\n'
983 <<
"component \"connections\" value \"cells\"" <<
'\n';
984 out <<
"component \"material\" value \"material\"" <<
'\n';
985 out <<
"component \"level\" value \"level\"" <<
'\n';
987 out <<
"component \"measure\" value \"measure\"" <<
'\n';
989 out <<
"component \"diameter\" value \"diameter\"" <<
'\n';
994 out <<
"object \"face data\" class field" <<
'\n'
995 <<
"component \"positions\" value \"vertices\"" <<
'\n'
996 <<
"component \"connections\" value \"faces\"" <<
'\n';
997 out <<
"component \"boundary\" value \"boundary\"" <<
'\n';
999 out <<
"component \"measure\" value \"face measure\"" <<
'\n';
1001 out <<
"component \"diameter\" value \"face diameter\"" <<
'\n';
1004 out <<
'\n' <<
"object \"grid data\" class group" <<
'\n';
1006 out <<
"member \"cells\" value \"cell data\"" <<
'\n';
1008 out <<
"member \"faces\" value \"face data\"" <<
'\n';
1009 out <<
"end" <<
'\n';
1020 template <
int dim,
int spacedim>
1023 std::ostream &out)
const
1051 out <<
"@f$NOD" <<
'\n' << n_vertices <<
'\n';
1056 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1061 for (
unsigned int d = spacedim + 1;
d <= 3; ++
d)
1067 out <<
"@f$ENDNOD" <<
'\n'
1074 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
1075 {0, 1, 5, 4, 2, 3, 7, 6}};
1081 out << cell->active_cell_index() + 1 <<
' '
1082 << cell->reference_cell().gmsh_element_type() <<
' '
1083 << cell->material_id() <<
' ' << cell->subdomain_id() <<
' '
1084 << cell->n_vertices() <<
' ';
1088 for (
const unsigned int vertex : cell->vertex_indices())
1090 if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
1091 out << cell->vertex_index(
1092 dim == 3 ? local_vertex_numbering[vertex] :
1096 else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
1097 out << cell->vertex_index(vertex) + 1 <<
' ';
1115 out <<
"@f$ENDELM\n";
1125 template <
int dim,
int spacedim>
1128 std::ostream &out)
const
1146 std::time_t time1 = std::time(
nullptr);
1147 std::tm *time = std::localtime(&time1);
1149 <<
"# This file was generated by the deal.II library." <<
'\n'
1150 <<
"# Date = " << time->tm_year + 1900 <<
"/" << time->tm_mon + 1
1151 <<
"/" << time->tm_mday <<
'\n'
1152 <<
"# Time = " << time->tm_hour <<
":" << std::setw(2) << time->tm_min
1153 <<
":" << std::setw(2) << time->tm_sec <<
'\n'
1155 <<
"# For a description of the UCD format see the AVS Developer's guide."
1161 out << n_vertices <<
' '
1171 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1176 for (
unsigned int d = spacedim + 1;
d <= 3; ++
d)
1185 out << cell->active_cell_index() + 1 <<
' ' << cell->material_id() <<
' ';
1242 template <
int dim,
int spacedim>
1260 const int spacedim = 2;
1266 out <<
"#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
1267 <<
"A4\n100.00\nSingle"
1270 <<
"-3" << std::endl
1271 <<
"# generated by deal.II GridOut class" << std::endl
1272 <<
"# reduce first number to scale up image" << std::endl
1273 <<
"1200 2" << std::endl;
1276 unsigned int colno = 32;
1277 out <<
"0 " << colno++ <<
" #ff0000" << std::endl;
1278 out <<
"0 " << colno++ <<
" #ff8000" << std::endl;
1279 out <<
"0 " << colno++ <<
" #ffd000" << std::endl;
1280 out <<
"0 " << colno++ <<
" #ffff00" << std::endl;
1281 out <<
"0 " << colno++ <<
" #c0ff00" << std::endl;
1282 out <<
"0 " << colno++ <<
" #80ff00" << std::endl;
1283 out <<
"0 " << colno++ <<
" #00f000" << std::endl;
1284 out <<
"0 " << colno++ <<
" #00f0c0" << std::endl;
1285 out <<
"0 " << colno++ <<
" #00f0ff" << std::endl;
1286 out <<
"0 " << colno++ <<
" #00c0ff" << std::endl;
1287 out <<
"0 " << colno++ <<
" #0080ff" << std::endl;
1288 out <<
"0 " << colno++ <<
" #0040ff" << std::endl;
1289 out <<
"0 " << colno++ <<
" #0000c0" << std::endl;
1290 out <<
"0 " << colno++ <<
" #5000ff" << std::endl;
1291 out <<
"0 " << colno++ <<
" #8000ff" << std::endl;
1292 out <<
"0 " << colno++ <<
" #b000ff" << std::endl;
1293 out <<
"0 " << colno++ <<
" #ff00ff" << std::endl;
1294 out <<
"0 " << colno++ <<
" #ff80ff" << std::endl;
1296 for (
unsigned int i = 0; i < 8; ++i)
1297 out <<
"0 " << colno++ <<
" #" << std::hex << 32 * i + 31 << 32 * i + 31
1298 << 32 * i + 31 << std::dec << std::endl;
1300 for (
unsigned int i = 1; i < 16; ++i)
1301 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << std::dec
1302 <<
"00" << std::endl;
1304 for (
unsigned int i = 1; i < 16; ++i)
1305 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << 16 * i + 15
1306 << std::dec <<
"00" << std::endl;
1308 for (
unsigned int i = 1; i < 16; ++i)
1309 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << std::dec
1310 <<
"0000" << std::endl;
1312 for (
unsigned int i = 1; i < 16; ++i)
1313 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 <<
"00"
1314 << 16 * i + 15 << std::dec << std::endl;
1316 for (
unsigned int i = 1; i < 16; ++i)
1317 out <<
"0 " << colno++ <<
" #0000" << std::hex << 16 * i + 15 << std::dec
1320 for (
unsigned int i = 1; i < 16; ++i)
1321 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << 16 * i + 15
1322 << std::dec << std::endl;
1344 out << cell->material_id() + 32;
1347 out << cell->level() + 8;
1350 out << cell->subdomain_id() + 32;
1353 out << cell->level_subdomain_id() + 32;
1362 (900 + cell->material_id()))
1368 << nv + 1 << std::endl;
1374 for (
unsigned int k = 0; k <= nv; ++k)
1378 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim); ++
d)
1382 out <<
'\t' << ((
d == 0) ? val : -val);
1387 static const unsigned int face_reorder[4] = {2, 1, 3, 0};
1389 for (
const unsigned int f : face_reorder)
1417 for (
unsigned int k = 0;
1418 k < GeometryInfo<dim>::vertices_per_face;
1422 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim);
1428 out <<
'\t' << ((
d == 0) ? val : -val);
1445 #ifdef DEAL_II_GMSH_WITH_API
1446 template <
int dim,
int spacedim>
1449 const std::string &filename)
const
1452 const std::array<int, 8> dealii_to_gmsh_type = {{15, 1, 2, 3, 4, 7, 6, 5}};
1455 const std::array<std::vector<unsigned int>, 8> dealii_to_gmsh = {
1462 {{0, 1, 2, 3, 4, 5}},
1463 {{0, 1, 3, 2, 4, 5, 7, 6}}}};
1468 std::vector<double> coords(3 *
vertices.size());
1469 std::vector<std::size_t> nodes(
vertices.size());
1475 for (
unsigned int d = 0;
d < spacedim; ++
d)
1476 coords[i * 3 +
d] = p[
d];
1488 using IdPair = std::pair<types::material_id, types::manifold_id>;
1489 std::map<IdPair, int> id_pair_to_entity_tag;
1490 std::vector<IdPair> all_pairs;
1492 std::set<IdPair> set_of_pairs;
1495 set_of_pairs.insert({cell->material_id(), cell->manifold_id()});
1496 for (
const auto &f : cell->face_iterators())
1498 (f->boundary_id() != 0 &&
1500 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1502 for (
const auto l : cell->line_indices())
1504 const auto &f = cell->line(
l);
1506 (f->boundary_id() != 0 &&
1508 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1511 all_pairs = {set_of_pairs.begin(), set_of_pairs.end()};
1514 for (
const auto &p : set_of_pairs)
1515 id_pair_to_entity_tag[p] = entity++;
1518 const auto n_entity_tags = id_pair_to_entity_tag.size();
1521 std::vector<std::vector<std::vector<std::size_t>>> element_ids(
1522 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1523 std::vector<std::vector<std::vector<std::size_t>>> element_nodes(
1524 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1527 std::size_t element_id = 1;
1529 const auto add_element = [&](
const auto &element,
const int &entity_tag) {
1530 const auto type = element->reference_cell();
1535 for (
const auto v : element->vertex_indices())
1536 element_nodes[entity_tag - 1][type].emplace_back(
1537 element->vertex_index(dealii_to_gmsh[type][v]) + 1);
1540 element_ids[entity_tag - 1][type].emplace_back(element_id);
1548 std::set<std::pair<int, int>> dim_entity_tag;
1550 auto maybe_add_element =
1551 [&](
const auto &element,
1553 const auto struct_dim = element->structure_dimension;
1557 const bool non_default_boundary_or_material_id =
1558 (boundary_or_material_id != 0 &&
1560 const bool non_default_manifold =
1562 if (struct_dim == dim || non_default_boundary_or_material_id ||
1563 non_default_manifold)
1565 const auto entity_tag =
1566 id_pair_to_entity_tag[{boundary_or_material_id,
manifold_id}];
1567 add_element(element, entity_tag);
1568 dim_entity_tag.insert({struct_dim, entity_tag});
1575 maybe_add_element(cell, cell->material_id());
1576 for (
const auto &face : cell->face_iterators())
1577 maybe_add_element(face, face->boundary_id());
1579 for (
const auto l : cell->line_indices())
1580 maybe_add_element(cell->line(
l), cell->line(
l)->boundary_id());
1585 gmsh::option::setNumber(
"General.Verbosity", 0);
1586 gmsh::model::add(
"Grid generated in deal.II");
1587 for (
const auto &p : dim_entity_tag)
1589 gmsh::model::addDiscreteEntity(p.first, p.second);
1590 gmsh::model::mesh::addNodes(p.first, p.second, nodes, coords);
1593 for (
unsigned int entity_tag = 0; entity_tag < n_entity_tags; ++entity_tag)
1594 for (
unsigned int t = 1; t < 8; ++t)
1596 const auto all_element_ids = element_ids[entity_tag][t];
1597 const auto all_element_nodes = element_nodes[entity_tag][t];
1598 const auto gmsh_t = dealii_to_gmsh_type[t];
1599 if (all_element_ids.size() > 0)
1600 gmsh::model::mesh::addElementsByType(entity_tag + 1,
1608 for (
const auto &it : dim_entity_tag)
1610 const auto &
d = it.first;
1611 const auto &entity_tag = it.second;
1612 const auto &
boundary_id = all_pairs[entity_tag - 1].first;
1613 const auto &
manifold_id = all_pairs[entity_tag - 1].second;
1615 std::string physical_name;
1626 std::string sep = physical_name !=
"" ?
", " :
"";
1629 sep +
"ManifoldID:" +
1631 const auto physical_tag =
1632 gmsh::model::addPhysicalGroup(
d, {entity_tag}, -1);
1633 if (physical_name !=
"")
1634 gmsh::model::setPhysicalName(
d, physical_tag, physical_name);
1638 gmsh::write(filename);
1663 const float camera_focus)
1666 cross_product_3d(camera_horizontal, camera_direction);
1669 camera_focus / ((
point - camera_position) * camera_direction);
1672 camera_position + phi * (
point - camera_position);
1674 return {(projection - camera_position - camera_focus * camera_direction) *
1676 (projection - camera_position - camera_focus * camera_direction) *
1683 template <
int dim,
int spacedim>
1686 std::ostream & )
const
1689 ExcMessage(
"Mesh output in SVG format is not implemented for anything "
1690 "other than two-dimensional meshes in two-dimensional "
1691 "space. That's because three-dimensional meshes are best "
1692 "viewed in programs that allow changing the viewpoint, "
1693 "but SVG format does not allow this: It is an inherently "
1694 "2d format, and for three-dimensional meshes would "
1695 "require choosing one, fixed viewpoint."
1697 "You probably want to output your mesh in a format such "
1698 "as VTK, VTU, or gnuplot."));
1707 unsigned int min_level, max_level;
1715 Assert(height != 0 || width != 0,
1716 ExcMessage(
"You have to set at least one of width and height"));
1718 unsigned int margin_in_percent = 0;
1720 margin_in_percent = 8;
1723 unsigned int cell_label_font_size;
1736 float x_max_perspective, x_min_perspective;
1737 float y_max_perspective, y_min_perspective;
1739 float x_dimension_perspective, y_dimension_perspective;
1743 double x_min =
tria.
begin()->vertex(0)[0];
1744 double x_max = x_min;
1745 double y_min =
tria.
begin()->vertex(0)[1];
1746 double y_max = y_min;
1748 double x_dimension, y_dimension;
1750 min_level = max_level =
tria.
begin()->level();
1753 std::set<unsigned int> materials;
1756 std::set<unsigned int> levels;
1759 std::set<unsigned int> subdomains;
1762 std::set<int> level_subdomains;
1770 for (
unsigned int vertex_index = 0; vertex_index < cell->n_vertices();
1773 if (cell->vertex(vertex_index)[0] < x_min)
1774 x_min = cell->vertex(vertex_index)[0];
1775 if (cell->vertex(vertex_index)[0] > x_max)
1776 x_max = cell->vertex(vertex_index)[0];
1778 if (cell->vertex(vertex_index)[1] < y_min)
1779 y_min = cell->vertex(vertex_index)[1];
1780 if (cell->vertex(vertex_index)[1] > y_max)
1781 y_max = cell->vertex(vertex_index)[1];
1784 if (
static_cast<unsigned int>(cell->level()) < min_level)
1785 min_level = cell->level();
1786 if (
static_cast<unsigned int>(cell->level()) > max_level)
1787 max_level = cell->level();
1789 materials.insert(cell->material_id());
1790 levels.insert(cell->level());
1791 if (cell->is_active())
1792 subdomains.insert(cell->subdomain_id() + 2);
1793 level_subdomains.insert(cell->level_subdomain_id() + 2);
1796 x_dimension = x_max - x_min;
1797 y_dimension = y_max - y_min;
1800 const unsigned int n_materials = materials.size();
1803 const unsigned int n_levels = levels.size();
1806 const unsigned int n_subdomains = subdomains.size();
1809 const unsigned int n_level_subdomains = level_subdomains.size();
1823 n = n_level_subdomains;
1832 camera_position[0] = 0;
1833 camera_position[1] = 0;
1834 camera_position[2] = 2. *
std::max(x_dimension, y_dimension);
1837 camera_direction[0] = 0;
1838 camera_direction[1] = 0;
1839 camera_direction[2] = -1;
1842 camera_horizontal[0] = 1;
1843 camera_horizontal[1] = 0;
1844 camera_horizontal[2] = 0;
1846 camera_focus = .5 *
std::max(x_dimension, y_dimension);
1852 const double angle_factor = 3.14159265 / 180.;
1855 camera_position_temp[1] =
1858 camera_position_temp[2] =
1862 camera_direction_temp[1] =
1865 camera_direction_temp[2] =
1869 camera_horizontal_temp[1] =
1872 camera_horizontal_temp[2] =
1876 camera_position[1] = camera_position_temp[1];
1877 camera_position[2] = camera_position_temp[2];
1879 camera_direction[1] = camera_direction_temp[1];
1880 camera_direction[2] = camera_direction_temp[2];
1882 camera_horizontal[1] = camera_horizontal_temp[1];
1883 camera_horizontal[2] = camera_horizontal_temp[2];
1886 camera_position_temp[0] =
1889 camera_position_temp[1] =
1893 camera_direction_temp[0] =
1896 camera_direction_temp[1] =
1900 camera_horizontal_temp[0] =
1903 camera_horizontal_temp[1] =
1907 camera_position[0] = camera_position_temp[0];
1908 camera_position[1] = camera_position_temp[1];
1910 camera_direction[0] = camera_direction_temp[0];
1911 camera_direction[1] = camera_direction_temp[1];
1913 camera_horizontal[0] = camera_horizontal_temp[0];
1914 camera_horizontal[1] = camera_horizontal_temp[1];
1917 camera_position[0] = x_min + .5 * x_dimension;
1918 camera_position[1] = y_min + .5 * y_dimension;
1920 camera_position[0] += 2. *
std::max(x_dimension, y_dimension) *
1923 camera_position[1] -= 2. *
std::max(x_dimension, y_dimension) *
1934 float min_level_min_vertex_distance = 0;
1939 (
static_cast<float>(
tria.
begin()->level()) /
1940 static_cast<float>(n_levels)) *
1941 std::max(x_dimension, y_dimension);
1944 projection_decomposition = svg_project_point(
1945 point, camera_position, camera_direction, camera_horizontal, camera_focus);
1947 x_max_perspective = projection_decomposition[0];
1948 x_min_perspective = projection_decomposition[0];
1950 y_max_perspective = projection_decomposition[1];
1951 y_min_perspective = projection_decomposition[1];
1955 point[0] = cell->vertex(0)[0];
1956 point[1] = cell->vertex(0)[1];
1963 (
static_cast<float>(cell->level()) /
static_cast<float>(n_levels)) *
1964 std::max(x_dimension, y_dimension);
1967 projection_decomposition = svg_project_point(
point,
1973 if (x_max_perspective < projection_decomposition[0])
1974 x_max_perspective = projection_decomposition[0];
1975 if (x_min_perspective > projection_decomposition[0])
1976 x_min_perspective = projection_decomposition[0];
1978 if (y_max_perspective < projection_decomposition[1])
1979 y_max_perspective = projection_decomposition[1];
1980 if (y_min_perspective > projection_decomposition[1])
1981 y_min_perspective = projection_decomposition[1];
1983 point[0] = cell->vertex(1)[0];
1984 point[1] = cell->vertex(1)[1];
1986 projection_decomposition = svg_project_point(
point,
1992 if (x_max_perspective < projection_decomposition[0])
1993 x_max_perspective = projection_decomposition[0];
1994 if (x_min_perspective > projection_decomposition[0])
1995 x_min_perspective = projection_decomposition[0];
1997 if (y_max_perspective < projection_decomposition[1])
1998 y_max_perspective = projection_decomposition[1];
1999 if (y_min_perspective > projection_decomposition[1])
2000 y_min_perspective = projection_decomposition[1];
2002 point[0] = cell->vertex(2)[0];
2003 point[1] = cell->vertex(2)[1];
2005 projection_decomposition = svg_project_point(
point,
2011 if (x_max_perspective < projection_decomposition[0])
2012 x_max_perspective = projection_decomposition[0];
2013 if (x_min_perspective > projection_decomposition[0])
2014 x_min_perspective = projection_decomposition[0];
2016 if (y_max_perspective < projection_decomposition[1])
2017 y_max_perspective = projection_decomposition[1];
2018 if (y_min_perspective > projection_decomposition[1])
2019 y_min_perspective = projection_decomposition[1];
2021 if (cell->n_vertices() == 4)
2023 point[0] = cell->vertex(3)[0];
2024 point[1] = cell->vertex(3)[1];
2026 projection_decomposition = svg_project_point(
point,
2032 if (x_max_perspective < projection_decomposition[0])
2033 x_max_perspective = projection_decomposition[0];
2034 if (x_min_perspective > projection_decomposition[0])
2035 x_min_perspective = projection_decomposition[0];
2037 if (y_max_perspective < projection_decomposition[1])
2038 y_max_perspective = projection_decomposition[1];
2039 if (y_min_perspective > projection_decomposition[1])
2040 y_min_perspective = projection_decomposition[1];
2043 if (
static_cast<unsigned int>(cell->level()) == min_level)
2044 min_level_min_vertex_distance = cell->minimum_vertex_distance();
2047 x_dimension_perspective = x_max_perspective - x_min_perspective;
2048 y_dimension_perspective = y_max_perspective - y_min_perspective;
2052 width =
static_cast<unsigned int>(
2053 .5 + height * (x_dimension_perspective / y_dimension_perspective));
2054 else if (height == 0)
2055 height =
static_cast<unsigned int>(
2056 .5 + width * (y_dimension_perspective / x_dimension_perspective));
2057 unsigned int additional_width = 0;
2059 unsigned int font_size =
2060 static_cast<unsigned int>(.5 + (height / 100.) * 1.75);
2061 cell_label_font_size =
static_cast<unsigned int>(
2063 min_level_min_vertex_distance /
std::min(x_dimension, y_dimension)));
2070 additional_width =
static_cast<unsigned int>(
2075 additional_width =
static_cast<unsigned int>(
2076 .5 + height * .175);
2088 out <<
"<svg width=\"" << width + additional_width <<
"\" height=\"" << height
2089 <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" <<
'\n'
2096 <<
" <linearGradient id=\"background_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\""
2097 << height <<
"\">" <<
'\n'
2098 <<
" <stop offset=\"0\" style=\"stop-color:white\"/>" <<
'\n'
2099 <<
" <stop offset=\"1\" style=\"stop-color:lightsteelblue\"/>" <<
'\n'
2100 <<
" </linearGradient>" <<
'\n';
2106 out <<
"<!-- internal style sheet -->" <<
'\n'
2107 <<
"<style type=\"text/css\"><![CDATA[" <<
'\n';
2111 out <<
" rect.background{fill:url(#background_gradient)}" <<
'\n';
2113 out <<
" rect.background{fill:white}" <<
'\n';
2115 out <<
" rect.background{fill:none}" <<
'\n';
2118 out <<
" rect{fill:none; stroke:rgb(25,25,25); stroke-width:"
2120 <<
" text{font-family:Helvetica; text-anchor:middle; fill:rgb(25,25,25)}"
2122 <<
" line{stroke:rgb(25,25,25); stroke-width:"
2124 <<
" path{fill:none; stroke:rgb(25,25,25); stroke-width:"
2126 <<
" circle{fill:white; stroke:black; stroke-width:2}" <<
'\n'
2132 unsigned int labeling_index = 0;
2133 auto materials_it = materials.begin();
2134 auto levels_it = levels.begin();
2135 auto subdomains_it = subdomains.begin();
2136 auto level_subdomains_it = level_subdomains.begin();
2138 for (
unsigned int index = 0; index < n; ++index)
2143 h = .6 - (index / (n - 1.)) * .6;
2151 unsigned int i =
static_cast<unsigned int>(h * 6);
2153 double f = h * 6 - i;
2160 r = 255, g =
static_cast<unsigned int>(.5 + 255 * t);
2163 r =
static_cast<unsigned int>(.5 + 255 * q), g = 255;
2166 g = 255,
b =
static_cast<unsigned int>(.5 + 255 * t);
2169 g =
static_cast<unsigned int>(.5 + 255 * q),
b = 255;
2172 r =
static_cast<unsigned int>(.5 + 255 * t),
b = 255;
2175 r = 255,
b =
static_cast<unsigned int>(.5 + 255 * q);
2184 labeling_index = *materials_it++;
2187 labeling_index = *levels_it++;
2190 labeling_index = *subdomains_it++;
2193 labeling_index = *level_subdomains_it++;
2199 out <<
" path.p" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2200 <<
',' <<
b <<
"); "
2201 <<
"stroke:rgb(25,25,25); stroke-width:"
2204 out <<
" path.ps" << labeling_index <<
"{fill:rgb("
2205 <<
static_cast<unsigned int>(.5 + .75 * r) <<
','
2206 <<
static_cast<unsigned int>(.5 + .75 * g) <<
','
2207 <<
static_cast<unsigned int>(.5 + .75 *
b) <<
"); "
2208 <<
"stroke:rgb(20,20,20); stroke-width:"
2211 out <<
" rect.r" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2212 <<
',' <<
b <<
"); "
2213 <<
"stroke:rgb(25,25,25); stroke-width:"
2220 out <<
"]]></style>" <<
'\n' <<
'\n';
2223 out <<
" <rect class=\"background\" width=\"" << width <<
"\" height=\""
2224 << height <<
"\"/>" <<
'\n';
2228 unsigned int x_offset = 0;
2231 x_offset =
static_cast<unsigned int>(.5 + (height / 100.) *
2232 (margin_in_percent / 2.));
2234 x_offset =
static_cast<unsigned int>(.5 + height * .025);
2237 <<
" <text x=\"" << x_offset <<
"\" y=\""
2238 <<
static_cast<unsigned int>(.5 + height * .0525) <<
'\"'
2239 <<
" style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:"
2240 <<
static_cast<unsigned int>(.5 + height * .045) <<
"px\">"
2242 <<
"</text>" <<
'\n';
2261 out <<
" <!-- cells -->" <<
'\n';
2263 for (
unsigned int level_index = min_level; level_index <= max_level;
2276 out <<
" class=\"p";
2278 if (!cell->is_active() &&
2285 out << cell->material_id();
2288 out << static_cast<unsigned int>(cell->level());
2291 if (cell->is_active())
2292 out << cell->subdomain_id() + 2;
2297 out << cell->level_subdomain_id() + 2;
2308 point[0] = cell->vertex(0)[0];
2309 point[1] = cell->vertex(0)[1];
2315 (
static_cast<float>(cell->level()) /
2316 static_cast<float>(n_levels)) *
2317 std::max(x_dimension, y_dimension);
2320 projection_decomposition = svg_project_point(
point,
2326 out << static_cast<unsigned int>(
2328 ((projection_decomposition[0] - x_min_perspective) /
2329 x_dimension_perspective) *
2330 (width - (width / 100.) * 2. * margin_in_percent) +
2331 ((width / 100.) * margin_in_percent))
2333 <<
static_cast<unsigned int>(
2334 .5 + height - (height / 100.) * margin_in_percent -
2335 ((projection_decomposition[1] - y_min_perspective) /
2336 y_dimension_perspective) *
2337 (height - (height / 100.) * 2. * margin_in_percent));
2341 point[0] = cell->vertex(1)[0];
2342 point[1] = cell->vertex(1)[1];
2344 projection_decomposition = svg_project_point(
point,
2350 out << static_cast<unsigned int>(
2352 ((projection_decomposition[0] - x_min_perspective) /
2353 x_dimension_perspective) *
2354 (width - (width / 100.) * 2. * margin_in_percent) +
2355 ((width / 100.) * margin_in_percent))
2357 <<
static_cast<unsigned int>(
2358 .5 + height - (height / 100.) * margin_in_percent -
2359 ((projection_decomposition[1] - y_min_perspective) /
2360 y_dimension_perspective) *
2361 (height - (height / 100.) * 2. * margin_in_percent));
2365 if (cell->n_vertices() == 4)
2367 point[0] = cell->vertex(3)[0];
2368 point[1] = cell->vertex(3)[1];
2370 projection_decomposition = svg_project_point(
point,
2376 out << static_cast<unsigned int>(
2378 ((projection_decomposition[0] - x_min_perspective) /
2379 x_dimension_perspective) *
2380 (width - (width / 100.) * 2. * margin_in_percent) +
2381 ((width / 100.) * margin_in_percent))
2383 <<
static_cast<unsigned int>(
2384 .5 + height - (height / 100.) * margin_in_percent -
2385 ((projection_decomposition[1] - y_min_perspective) /
2386 y_dimension_perspective) *
2387 (height - (height / 100.) * 2. * margin_in_percent));
2392 point[0] = cell->vertex(2)[0];
2393 point[1] = cell->vertex(2)[1];
2395 projection_decomposition = svg_project_point(
point,
2401 out << static_cast<unsigned int>(
2403 ((projection_decomposition[0] - x_min_perspective) /
2404 x_dimension_perspective) *
2405 (width - (width / 100.) * 2. * margin_in_percent) +
2406 ((width / 100.) * margin_in_percent))
2408 <<
static_cast<unsigned int>(
2409 .5 + height - (height / 100.) * margin_in_percent -
2410 ((projection_decomposition[1] - y_min_perspective) /
2411 y_dimension_perspective) *
2412 (height - (height / 100.) * 2. * margin_in_percent));
2416 point[0] = cell->vertex(0)[0];
2417 point[1] = cell->vertex(0)[1];
2419 projection_decomposition = svg_project_point(
point,
2425 out << static_cast<unsigned int>(
2427 ((projection_decomposition[0] - x_min_perspective) /
2428 x_dimension_perspective) *
2429 (width - (width / 100.) * 2. * margin_in_percent) +
2430 ((width / 100.) * margin_in_percent))
2432 <<
static_cast<unsigned int>(
2433 .5 + height - (height / 100.) * margin_in_percent -
2434 ((projection_decomposition[1] - y_min_perspective) /
2435 y_dimension_perspective) *
2436 (height - (height / 100.) * 2. * margin_in_percent));
2438 out <<
"\"/>" <<
'\n';
2445 point[0] = cell->center()[0];
2446 point[1] = cell->center()[1];
2452 (
static_cast<float>(cell->level()) /
2453 static_cast<float>(n_levels)) *
2454 std::max(x_dimension, y_dimension);
2457 const double distance_to_camera =
2458 std::sqrt(std::pow(
point[0] - camera_position[0], 2.) +
2459 std::pow(
point[1] - camera_position[1], 2.) +
2460 std::pow(
point[2] - camera_position[2], 2.));
2461 const double distance_factor =
2462 distance_to_camera / (2. *
std::max(x_dimension, y_dimension));
2464 projection_decomposition = svg_project_point(
point,
2470 const unsigned int font_size_this_cell =
2471 static_cast<unsigned int>(
2473 cell_label_font_size *
2474 std::pow(.5, cell->level() - 4. + 3.5 * distance_factor));
2478 <<
static_cast<unsigned int>(
2480 ((projection_decomposition[0] - x_min_perspective) /
2481 x_dimension_perspective) *
2482 (width - (width / 100.) * 2. * margin_in_percent) +
2483 ((width / 100.) * margin_in_percent))
2485 <<
static_cast<unsigned int>(
2486 .5 + height - (height / 100.) * margin_in_percent -
2487 ((projection_decomposition[1] - y_min_perspective) /
2488 y_dimension_perspective) *
2489 (height - (height / 100.) * 2. * margin_in_percent) +
2490 0.5 * font_size_this_cell)
2491 <<
"\" style=\"font-size:" << font_size_this_cell <<
"px\">";
2495 out << cell->level();
2502 out << cell->index();
2510 out << static_cast<std::make_signed_t<types::material_id>>(
2511 cell->material_id());
2519 if (cell->is_active())
2520 out <<
static_cast<std::make_signed_t<types::subdomain_id>
>(
2521 cell->subdomain_id());
2533 out << static_cast<std::make_signed_t<types::subdomain_id>>(
2534 cell->level_subdomain_id());
2537 out <<
"</text>" <<
'\n';
2544 for (
auto faceIndex : cell->face_indices())
2546 if (cell->at_boundary(faceIndex))
2548 point[0] = cell->face(faceIndex)->vertex(0)[0];
2549 point[1] = cell->face(faceIndex)->vertex(0)[1];
2555 (
static_cast<float>(cell->level()) /
2556 static_cast<float>(n_levels)) *
2557 std::max(x_dimension, y_dimension);
2560 projection_decomposition =
2561 svg_project_point(
point,
2567 out <<
" <line x1=\""
2568 <<
static_cast<unsigned int>(
2570 ((projection_decomposition[0] -
2571 x_min_perspective) /
2572 x_dimension_perspective) *
2574 (width / 100.) * 2. * margin_in_percent) +
2575 ((width / 100.) * margin_in_percent))
2577 <<
static_cast<unsigned int>(
2579 (height / 100.) * margin_in_percent -
2580 ((projection_decomposition[1] -
2581 y_min_perspective) /
2582 y_dimension_perspective) *
2584 (height / 100.) * 2. * margin_in_percent));
2586 point[0] = cell->face(faceIndex)->vertex(1)[0];
2587 point[1] = cell->face(faceIndex)->vertex(1)[1];
2593 (
static_cast<float>(cell->level()) /
2594 static_cast<float>(n_levels)) *
2595 std::max(x_dimension, y_dimension);
2598 projection_decomposition =
2599 svg_project_point(
point,
2606 <<
static_cast<unsigned int>(
2608 ((projection_decomposition[0] -
2609 x_min_perspective) /
2610 x_dimension_perspective) *
2612 (width / 100.) * 2. * margin_in_percent) +
2613 ((width / 100.) * margin_in_percent))
2615 <<
static_cast<unsigned int>(
2617 (height / 100.) * margin_in_percent -
2618 ((projection_decomposition[1] -
2619 y_min_perspective) /
2620 y_dimension_perspective) *
2622 (height / 100.) * 2. * margin_in_percent))
2628 const double distance_to_camera = std::sqrt(
2629 std::pow(
point[0] - camera_position[0], 2.) +
2630 std::pow(
point[1] - camera_position[1], 2.) +
2631 std::pow(
point[2] - camera_position[2], 2.));
2632 const double distance_factor =
2633 distance_to_camera /
2634 (2. *
std::max(x_dimension, y_dimension));
2636 const unsigned int font_size_this_edge =
2637 static_cast<unsigned int>(
2638 .5 + .5 * cell_label_font_size *
2640 cell->level() - 4. +
2641 3.5 * distance_factor));
2643 point[0] = cell->face(faceIndex)->center()[0];
2644 point[1] = cell->face(faceIndex)->center()[1];
2650 (
static_cast<float>(cell->level()) /
2651 static_cast<float>(n_levels)) *
2652 std::max(x_dimension, y_dimension);
2655 projection_decomposition =
2656 svg_project_point(
point,
2662 const unsigned int xc =
static_cast<unsigned int>(
2664 ((projection_decomposition[0] - x_min_perspective) /
2665 x_dimension_perspective) *
2667 (width / 100.) * 2. * margin_in_percent) +
2668 ((width / 100.) * margin_in_percent));
2669 const unsigned int yc =
static_cast<unsigned int>(
2670 .5 + height - (height / 100.) * margin_in_percent -
2671 ((projection_decomposition[1] - y_min_perspective) /
2672 y_dimension_perspective) *
2674 (height / 100.) * 2. * margin_in_percent));
2676 out <<
" <circle cx=\"" << xc <<
"\" cy=\"" << yc
2677 <<
"\" r=\"" << font_size_this_edge <<
"\" />"
2680 out <<
" <text x=\"" << xc <<
"\" y=\"" << yc
2681 <<
"\" style=\"font-size:" << font_size_this_edge
2682 <<
"px\" dominant-baseline=\"middle\">"
2683 <<
static_cast<int>(
2684 cell->face(faceIndex)->boundary_id())
2685 <<
"</text>" <<
'\n';
2697 out <<
'\n' <<
" <!-- legend -->" <<
'\n';
2699 additional_width = 0;
2701 additional_width =
static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2709 unsigned int line_offset = 0;
2710 out <<
" <rect x=\"" << width + additional_width <<
"\" y=\""
2711 <<
static_cast<unsigned int>(.5 + (height / 100.) * margin_in_percent)
2713 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2714 (40. - margin_in_percent))
2715 <<
"\" height=\"" <<
static_cast<unsigned int>(.5 + height * .215)
2718 out <<
" <text x=\""
2719 << width + additional_width +
2720 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2722 <<
static_cast<unsigned int>(.5 +
2723 (height / 100.) * margin_in_percent +
2724 (++line_offset) * 1.5 * font_size)
2725 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2726 << font_size <<
"px\">"
2728 <<
"</text>" <<
'\n';
2732 out <<
" <text x=\""
2733 << width + additional_width +
2734 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2736 <<
static_cast<unsigned int>(.5 +
2737 (height / 100.) * margin_in_percent +
2738 (++line_offset) * 1.5 * font_size)
2739 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2740 << font_size <<
"px\">"
2748 out <<
"</text>" <<
'\n';
2753 out <<
" <text x=\""
2754 << width + additional_width +
2755 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2757 <<
static_cast<unsigned int>(.5 +
2758 (height / 100.) * margin_in_percent +
2759 (++line_offset) * 1.5 * font_size)
2760 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2761 << font_size <<
"px\">"
2768 out <<
"</text>" <<
'\n';
2773 out <<
" <text x=\""
2774 << width + additional_width +
2775 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2777 <<
static_cast<unsigned int>(.5 +
2778 (height / 100.) * margin_in_percent +
2779 (++line_offset) * 1.5 * font_size)
2780 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2781 << font_size <<
"px\">"
2788 out <<
"</text>" <<
'\n';
2793 out <<
" <text x= \""
2794 << width + additional_width +
2795 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2797 <<
static_cast<unsigned int>(.5 +
2798 (height / 100.) * margin_in_percent +
2799 (++line_offset) * 1.5 * font_size)
2800 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2801 << font_size <<
"px\">"
2807 out <<
"</text>" <<
'\n';
2812 out <<
" <text x= \""
2813 << width + additional_width +
2814 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2816 <<
static_cast<unsigned int>(.5 +
2817 (height / 100.) * margin_in_percent +
2818 (++line_offset) * 1.5 * font_size)
2819 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2820 << font_size <<
"px\">"
2821 <<
"level_subdomain_id"
2822 <<
"</text>" <<
'\n';
2827 out <<
" <text x=\""
2828 << width + additional_width +
2829 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2831 <<
static_cast<unsigned int>(.5 +
2832 (height / 100.) * margin_in_percent +
2833 (++line_offset) * 1.5 * font_size)
2834 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2835 << font_size <<
"px\">"
2837 <<
"</text>" <<
'\n';
2839 out <<
" <text x= \""
2840 << width + additional_width +
2841 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2843 <<
static_cast<unsigned int>(.5 +
2844 (height / 100.) * margin_in_percent +
2845 (++line_offset) * 1.5 * font_size)
2846 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2847 << font_size <<
"px\">"
2849 <<
"</text>" <<
'\n';
2857 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2858 <<
static_cast<unsigned int>(
2859 .5 + (height / 100.) * margin_in_percent + 13.75 * font_size)
2860 <<
"\" style=\"text-anchor:start; font-size:" << font_size <<
"px\">"
2869 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
2871 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2872 <<
static_cast<unsigned int>(
2873 .5 + (height / 100.) * (margin_in_percent + 29.) -
2875 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2876 << font_size <<
"px\">";
2881 out <<
"material_id";
2884 out <<
"level_number";
2887 out <<
"subdomain_id";
2890 out <<
"level_subdomain_id";
2896 out <<
"</text>" <<
'\n';
2898 unsigned int element_height =
static_cast<unsigned int>(
2899 ((height / 100.) * (71. - 2. * margin_in_percent)) / n);
2900 unsigned int element_width =
2901 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2903 int labeling_index = 0;
2904 auto materials_it = materials.begin();
2905 auto levels_it = levels.begin();
2906 auto subdomains_it = subdomains.begin();
2907 auto level_subdomains_it = level_subdomains.begin();
2909 for (
unsigned int index = 0; index < n; ++index)
2914 labeling_index = *materials_it++;
2917 labeling_index = *levels_it++;
2920 labeling_index = *subdomains_it++;
2923 labeling_index = *level_subdomains_it++;
2929 out <<
" <rect class=\"r" << labeling_index <<
"\" x=\""
2930 << width + additional_width <<
"\" y=\""
2931 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2932 (margin_in_percent + 29)) +
2933 (n - index - 1) * element_height
2934 <<
"\" width=\"" << element_width <<
"\" height=\""
2935 << element_height <<
"\"/>" <<
'\n';
2937 out <<
" <text x=\""
2938 << width + additional_width + 1.5 * element_width <<
"\" y=\""
2939 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2940 (margin_in_percent + 29)) +
2941 (n - index - 1 + .5) * element_height +
2942 static_cast<unsigned int>(.5 + font_size * .35)
2944 <<
" style=\"text-anchor:start; font-size:"
2945 <<
static_cast<unsigned int>(.5 + font_size) <<
"px";
2947 if (index == 0 || index == n - 1)
2948 out <<
"; font-weight:bold";
2950 out <<
"\">" << labeling_index;
2957 out <<
"</text>" <<
'\n';
2965 out <<
'\n' <<
"</svg>";
2981 template <
int dim,
int spacedim>
2984 std::ostream &out)
const
2991 const std::time_t time1 = std::time(
nullptr);
2992 const std::tm *time = std::localtime(&time1);
2996 <<
"\n# This file was generated by the deal.II library."
2997 <<
"\n# Date = " << time->tm_year + 1900 <<
"/" << std::setfill(
'0')
2998 << std::setw(2) << time->tm_mon + 1 <<
"/" << std::setfill(
'0')
2999 << std::setw(2) << time->tm_mday <<
"\n# Time = " << std::setfill(
'0')
3000 << std::setw(2) << time->tm_hour <<
":" << std::setfill(
'0')
3001 << std::setw(2) << time->tm_min <<
":" << std::setfill(
'0')
3002 << std::setw(2) << time->tm_sec <<
"\n#"
3003 <<
"\n# For a description of the MathGL script format see the MathGL manual. "
3005 <<
"\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
3006 <<
"\n# be quickly viewed in a graphical environment using \'mglview\'. "
3012 const std::string axes =
"xyz";
3027 out <<
"\nsetsize 800 800";
3028 out <<
"\nrotate 0 0";
3031 out <<
"\nsetsize 800 800";
3032 out <<
"\nrotate 60 40";
3041 <<
"\n# Vertex ordering."
3042 <<
"\n# list <vertex order> <vertex indices>"
3051 out <<
"\nlist f 0 1 2 3" <<
'\n';
3055 <<
"\nlist f 0 2 4 6 | 1 3 5 7 | 0 4 1 5 | 2 6 3 7 | 0 1 2 3 | 4 5 6 7"
3064 <<
"\n# List of vertices."
3065 <<
"\n# list <id> <vertices>"
3073 for (
unsigned int i = 0; i < dim; ++i)
3080 out <<
"\nlist " << axes[i] << cell->active_cell_index() <<
" ";
3082 out << cell->vertex(j)[i] <<
" ";
3089 <<
"\n# List of cells to quadplot."
3090 <<
"\n# quadplot <vertex order> <id> <style>"
3094 out <<
"\nquadplot f ";
3095 for (
unsigned int j = 0; j < dim; ++j)
3096 out << axes[j] << i <<
" ";
3121 template <
int dim,
int spacedim,
typename ITERATOR,
typename END>
3123 generate_triangulation_patches(
3129 for (; cell !=
end; ++cell)
3134 patch.
data.reinit(5, cell->n_vertices());
3136 for (
const unsigned int v : cell->vertex_indices())
3138 patch.
vertices[v] = cell->vertex(v);
3139 patch.
data(0, v) = cell->level();
3141 static_cast<std::make_signed_t<types::manifold_id>
>(
3142 cell->manifold_id());
3144 static_cast<std::make_signed_t<types::material_id>
>(
3145 cell->material_id());
3146 if (cell->is_active())
3148 static_cast<std::make_signed_t<types::subdomain_id>
>(
3149 cell->subdomain_id());
3151 patch.
data(3, v) = -1;
3153 static_cast<std::make_signed_t<types::subdomain_id>
>(
3154 cell->level_subdomain_id());
3156 patches.push_back(patch);
3162 std::vector<std::string>
3163 triangulation_patch_data_names()
3165 std::vector<std::string> v(5);
3170 v[4] =
"level_subdomain";
3177 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3180 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3182 std::vector<bool> flags;
3187 for (
const auto l : face->line_indices())
3189 const auto line = face->line(
l);
3190 if (line->user_flag_set() || line->has_children())
3193 line->set_user_flag();
3194 if (line->at_boundary())
3195 res.emplace_back(line);
3206 template <
int dim,
int spacedim>
3207 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3219 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3222 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3224 std::vector<bool> flags;
3229 for (
const auto l : face->line_indices())
3231 const auto line = face->line(
l);
3232 if (line->user_flag_set() || line->has_children())
3235 line->set_user_flag();
3237 (line->boundary_id() != 0 &&
3239 res.emplace_back(line);
3249 template <
int dim,
int spacedim>
3250 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3261 template <
int dim,
int spacedim>
3262 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3265 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3272 res.push_back(face);
3283 template <
int dim,
int spacedim>
3284 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3287 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3294 (face->boundary_id() != 0 &&
3296 res.push_back(face);
3304 template <
int dim,
int spacedim>
3307 std::ostream &out)
const
3314 const auto n_vertices =
vertices.size();
3316 out <<
"# vtk DataFile Version 3.0\n"
3317 <<
"Triangulation generated with deal.II\n"
3319 <<
"DATASET UNSTRUCTURED_GRID\n"
3320 <<
"POINTS " << n_vertices <<
" double\n";
3326 for (
unsigned int d = spacedim + 1;
d <= 3; ++
d)
3332 get_relevant_face_iterators(
tria) :
3333 get_boundary_face_iterators(
tria);
3335 get_relevant_edge_iterators(
tria) :
3336 get_boundary_edge_iterators(
tria);
3342 "At least one of the flags (output_cells, output_faces, output_edges) has to be enabled!"));
3359 cells_size += cell->n_vertices() + 1;
3362 for (
const auto &face : faces)
3363 cells_size += face->n_vertices() + 1;
3366 for (
const auto &edge : edges)
3367 cells_size += edge->n_vertices() + 1;
3371 out <<
"\nCELLS " <<
n_cells <<
' ' << cells_size <<
'\n';
3386 static const std::array<int, 8> deal_to_vtk_cell_type = {
3387 {1, 3, 5, 9, 10, 14, 13, 12}};
3388 static const std::array<unsigned int, 8> vtk_to_deal_hypercube = {
3389 {0, 1, 3, 2, 4, 5, 7, 6}};
3395 out << cell->n_vertices();
3396 for (
const unsigned int i : cell->vertex_indices())
3405 out << cell->vertex_index(vtk_to_deal_hypercube[i]);
3409 out << cell->vertex_index(i);
3412 static const std::array<unsigned int, 5> permutation_table{
3414 out << cell->vertex_index(permutation_table[i]);
3422 for (
const auto &face : faces)
3424 out << face->n_vertices();
3425 for (
const unsigned int i : face->vertex_indices())
3429 face->n_vertices() ?
3430 vtk_to_deal_hypercube[i] :
3436 for (
const auto &edge : edges)
3439 for (
const unsigned int i : edge->vertex_indices())
3440 out <<
' ' << edge->vertex_index(i);
3445 out <<
"\nCELL_TYPES " <<
n_cells <<
'\n';
3449 out << deal_to_vtk_cell_type[static_cast<int>(cell->reference_cell())]
3455 for (
const auto &face : faces)
3456 out << deal_to_vtk_cell_type[static_cast<int>(face->reference_cell())]
3462 for (
const auto &edge : edges)
3463 out << deal_to_vtk_cell_type[static_cast<int>(edge->reference_cell())]
3466 out <<
"\n\nCELL_DATA " <<
n_cells <<
'\n'
3467 <<
"SCALARS MaterialID int 1\n"
3468 <<
"LOOKUP_TABLE default\n";
3475 out << static_cast<std::make_signed_t<types::material_id>>(
3476 cell->material_id())
3483 for (
const auto &face : faces)
3485 out << static_cast<std::make_signed_t<types::boundary_id>>(
3486 face->boundary_id())
3493 for (
const auto &edge : edges)
3495 out << static_cast<std::make_signed_t<types::boundary_id>>(
3496 edge->boundary_id())
3501 out <<
"\n\nSCALARS ManifoldID int 1\n"
3502 <<
"LOOKUP_TABLE default\n";
3509 out << static_cast<std::make_signed_t<types::manifold_id>>(
3510 cell->manifold_id())
3517 for (
const auto &face : faces)
3519 out << static_cast<std::make_signed_t<types::manifold_id>>(
3520 face->manifold_id())
3527 for (
const auto &edge : edges)
3529 out << static_cast<std::make_signed_t<types::manifold_id>>(
3530 edge->manifold_id())
3543 template <
int dim,
int spacedim>
3546 std::ostream &out)
const
3554 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3561 triangulation_patch_data_names(),
3563 std::tuple<
unsigned int,
3571 out <<
" </UnstructuredGrid>\n";
3572 out <<
"<dealiiData encoding=\"base64\">";
3573 std::stringstream outstring;
3574 boost::archive::binary_oarchive ia(outstring);
3578 out <<
"\n</dealiiData>\n";
3579 out <<
"</VTKFile>\n";
3590 template <
int dim,
int spacedim>
3594 const std::string &filename_without_extension,
3595 const bool view_levels,
3596 const bool include_artificial)
const
3598 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3599 const unsigned int n_datasets = 4;
3600 std::vector<std::string> data_names;
3601 data_names.emplace_back(
"level");
3602 data_names.emplace_back(
"subdomain");
3603 data_names.emplace_back(
"level_subdomain");
3604 data_names.emplace_back(
"proc_writing");
3618 if (cell->has_children())
3620 if (!include_artificial &&
3624 else if (!include_artificial)
3626 if (cell->has_children() &&
3629 else if (cell->is_active() &&
3630 cell->level_subdomain_id() ==
3637 patch.
data.reinit(n_datasets, n_q_points);
3641 for (
unsigned int vertex = 0; vertex < n_q_points; ++vertex)
3643 patch.
vertices[vertex] = cell->vertex(vertex);
3644 patch.
data(0, vertex) = cell->level();
3645 if (cell->is_active())
3646 patch.
data(1, vertex) =
static_cast<double>(
3647 static_cast<std::make_signed_t<types::subdomain_id>
>(
3648 cell->subdomain_id()));
3650 patch.
data(1, vertex) = -1.0;
3651 patch.
data(2, vertex) =
static_cast<double>(
3652 static_cast<std::make_signed_t<types::subdomain_id>
>(
3653 cell->level_subdomain_id()));
3659 patches.push_back(patch);
3665 std::string new_file = filename_without_extension +
".vtu";
3669 new_file = filename_without_extension +
".proc" +
3674 if (tr->locally_owned_subdomain() == 0)
3676 std::vector<std::string> filenames;
3681 std::size_t pos = filename_without_extension.find_last_of(
'/');
3682 if (pos == std::string::npos)
3686 const unsigned int n_procs =
3688 for (
unsigned int i = 0; i < n_procs; ++i)
3689 filenames.push_back(filename_without_extension.substr(pos) +
3693 const std::string pvtu_filename =
3694 (filename_without_extension +
".pvtu");
3695 std::ofstream pvtu_output(pvtu_filename);
3714 std::ofstream out(new_file);
3716 std::tuple<
unsigned int,
3722 patches, data_names, vector_data_ranges,
vtu_flags, out);
3778 template <
int dim,
int spacedim>
3783 unsigned int n_faces = 0;
3786 if ((face->at_boundary()) && (face->boundary_id() != 0))
3794 template <
int dim,
int spacedim>
3801 std::vector<bool> line_flags;
3805 .clear_user_flags_line();
3807 unsigned int n_lines = 0;
3810 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
3811 if (cell->line(
l)->at_boundary() && (cell->line(
l)->boundary_id() != 0) &&
3812 (cell->line(
l)->user_flag_set() ==
false))
3815 cell->line(
l)->set_user_flag();
3830 const unsigned int next_element_index,
3831 std::ostream &)
const
3833 return next_element_index;
3839 const unsigned int next_element_index,
3840 std::ostream &)
const
3842 return next_element_index;
3847 const unsigned int next_element_index,
3848 std::ostream &)
const
3850 return next_element_index;
3856 const unsigned int next_element_index,
3857 std::ostream &)
const
3859 return next_element_index;
3864 const unsigned int next_element_index,
3865 std::ostream &)
const
3867 return next_element_index;
3873 const unsigned int next_element_index,
3874 std::ostream &)
const
3876 return next_element_index;
3882 const unsigned int next_element_index,
3883 std::ostream &)
const
3885 return next_element_index;
3890 const unsigned int next_element_index,
3891 std::ostream &)
const
3893 return next_element_index;
3898 template <
int dim,
int spacedim>
3901 const unsigned int next_element_index,
3902 std::ostream &out)
const
3904 unsigned int current_element_index = next_element_index;
3907 if (face->at_boundary() && (face->boundary_id() != 0))
3909 out << current_element_index <<
' '
3910 << face->reference_cell().gmsh_element_type() <<
' ';
3911 out << static_cast<unsigned int>(face->boundary_id()) <<
' '
3912 <<
static_cast<unsigned int>(face->boundary_id()) <<
' '
3913 << face->n_vertices();
3915 for (
const unsigned int vertex : face->vertex_indices())
3919 << face->vertex_index(
3924 out <<
' ' << face->vertex_index(vertex) + 1;
3930 ++current_element_index;
3932 return current_element_index;
3937 template <
int dim,
int spacedim>
3940 const unsigned int next_element_index,
3941 std::ostream &out)
const
3943 unsigned int current_element_index = next_element_index;
3948 std::vector<bool> line_flags;
3952 .clear_user_flags_line();
3955 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
3956 if (cell->line(
l)->at_boundary() && (cell->line(
l)->boundary_id() != 0) &&
3957 (cell->line(
l)->user_flag_set() ==
false))
3959 out << next_element_index <<
' '
3961 out << static_cast<unsigned int>(cell->line(
l)->boundary_id()) <<
' '
3962 <<
static_cast<unsigned int>(cell->line(
l)->boundary_id())
3965 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
3967 << cell->line(
l)->vertex_index(
3975 ++current_element_index;
3976 cell->line(
l)->set_user_flag();
3984 return current_element_index;
3991 const unsigned int next_element_index,
3992 std::ostream &)
const
3994 return next_element_index;
3999 const unsigned int next_element_index,
4000 std::ostream &)
const
4002 return next_element_index;
4007 const unsigned int next_element_index,
4008 std::ostream &)
const
4010 return next_element_index;
4015 const unsigned int next_element_index,
4016 std::ostream &)
const
4018 return next_element_index;
4023 const unsigned int next_element_index,
4024 std::ostream &)
const
4026 return next_element_index;
4032 const unsigned int next_element_index,
4033 std::ostream &)
const
4035 return next_element_index;
4041 const unsigned int next_element_index,
4042 std::ostream &)
const
4044 return next_element_index;
4049 const unsigned int next_element_index,
4050 std::ostream &)
const
4052 return next_element_index;
4057 template <
int dim,
int spacedim>
4060 const unsigned int next_element_index,
4061 std::ostream &out)
const
4063 unsigned int current_element_index = next_element_index;
4067 if (face->at_boundary() && (face->boundary_id() != 0))
4069 out << current_element_index <<
" "
4070 <<
static_cast<unsigned int>(face->boundary_id()) <<
" ";
4083 for (
unsigned int vertex = 0;
4084 vertex < GeometryInfo<dim>::vertices_per_face;
4086 out << face->vertex_index(
4092 ++current_element_index;
4094 return current_element_index;
4099 template <
int dim,
int spacedim>
4102 const unsigned int next_element_index,
4103 std::ostream &out)
const
4105 unsigned int current_element_index = next_element_index;
4110 std::vector<bool> line_flags;
4114 .clear_user_flags_line();
4117 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++
l)
4118 if (cell->line(
l)->at_boundary() && (cell->line(
l)->boundary_id() != 0) &&
4119 (cell->line(
l)->user_flag_set() ==
false))
4121 out << current_element_index <<
" "
4122 <<
static_cast<unsigned int>(cell->line(
l)->boundary_id())
4125 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
4126 out << cell->line(
l)->vertex_index(
4135 ++current_element_index;
4136 cell->line(
l)->set_user_flag();
4143 return current_element_index;
4160 template <
int spacedim>
4164 while (points.size() > 2)
4167 first_difference /= first_difference.
norm();
4169 second_difference /= second_difference.
norm();
4171 if ((first_difference - second_difference).
norm() < 1
e-10)
4172 points.erase(points.begin() + 1);
4180 template <
int spacedim>
4192 out <<
"# cell " << cell <<
'\n';
4194 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4195 << cell->material_id() <<
'\n'
4196 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4197 << cell->material_id() <<
'\n'
4210 template <
int spacedim>
4221 const unsigned int n_additional_points =
4223 const unsigned int n_points = 2 + n_additional_points;
4228 std::vector<
Point<dim - 1>> boundary_points;
4229 if (mapping !=
nullptr)
4231 boundary_points.resize(n_points);
4232 boundary_points[0][0] = 0;
4233 boundary_points[n_points - 1][0] = 1;
4234 for (
unsigned int i = 1; i < n_points - 1; ++i)
4235 boundary_points[i](0) = 1. * i / (n_points - 1);
4237 std::vector<double> dummy_weights(n_points, 1. / n_points);
4238 Quadrature<dim - 1> quadrature(boundary_points, dummy_weights);
4241 ReferenceCells::get_hypercube<dim>(), quadrature);
4244 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
4245 {0, 1, 5, 4, 2, 3, 7, 6}};
4249 out <<
"# cell " << cell <<
'\n';
4251 if (mapping ==
nullptr ||
4262 out << cell->vertex(dim == 3 ?
4263 local_vertex_numbering[i] :
4265 <<
' ' << cell->level() <<
' ' << cell->material_id()
4267 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4268 << cell->material_id() <<
'\n'
4276 for (
const unsigned int face_no :
4279 const typename ::Triangulation<dim,
4280 spacedim>::face_iterator
4281 face = cell->face(face_no);
4282 if (dim != spacedim || face->at_boundary() ||
4288 std::vector<Point<spacedim>> line_points;
4291 const unsigned int offset = face_no * n_points;
4292 for (
unsigned int i = 0; i < n_points; ++i)
4293 line_points.push_back(
4295 cell, q_projector.
point(offset + i)));
4296 internal::remove_colinear_points(line_points);
4299 out <<
point <<
' ' << cell->level() <<
' '
4300 << cell->material_id() <<
'\n';
4302 out <<
'\n' <<
'\n';
4308 out << face->vertex(0) <<
' ' << cell->level() <<
' '
4309 << cell->material_id() <<
'\n'
4310 << face->vertex(1) <<
' ' << cell->level() <<
' '
4311 << cell->material_id() <<
'\n'
4327 template <
int spacedim>
4338 const unsigned int n_additional_points =
4340 const unsigned int n_points = 2 + n_additional_points;
4344 std::unique_ptr<Quadrature<dim>> q_projector;
4345 std::vector<Point<1>> boundary_points;
4346 if (mapping !=
nullptr)
4348 boundary_points.resize(n_points);
4349 boundary_points[0][0] = 0;
4350 boundary_points[n_points - 1][0] = 1;
4351 for (
unsigned int i = 1; i < n_points - 1; ++i)
4352 boundary_points[i](0) = 1. * i / (n_points - 1);
4354 std::vector<double> dummy_weights(n_points, 1. / n_points);
4358 QIterated<dim - 1> quadrature(quadrature1d, 1);
4359 q_projector = std::make_unique<Quadrature<dim>>(
4361 ReferenceCells::get_hypercube<dim>(), quadrature));
4367 out <<
"# cell " << cell <<
'\n';
4369 if (mapping ==
nullptr || n_points == 2 ||
4370 (!cell->has_boundary_lines() &&
4376 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4377 << cell->material_id() <<
'\n'
4378 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4379 << cell->material_id() <<
'\n'
4380 << cell->vertex(5) <<
' ' << cell->level() <<
' '
4381 << cell->material_id() <<
'\n'
4382 << cell->vertex(4) <<
' ' << cell->level() <<
' '
4383 << cell->material_id() <<
'\n'
4384 << cell->vertex(0) <<
' ' << cell->level() <<
' '
4385 << cell->material_id() <<
'\n'
4388 out << cell->vertex(2) <<
' ' << cell->level() <<
' '
4389 << cell->material_id() <<
'\n'
4390 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4391 << cell->material_id() <<
'\n'
4392 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4393 << cell->material_id() <<
'\n'
4394 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4395 << cell->material_id() <<
'\n'
4396 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4397 << cell->material_id() <<
'\n'
4401 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4402 << cell->material_id() <<
'\n'
4403 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4404 << cell->material_id() <<
'\n'
4406 out << cell->vertex(1) <<
' ' << cell->level() <<
' '
4407 << cell->material_id() <<
'\n'
4408 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4409 << cell->material_id() <<
'\n'
4411 out << cell->vertex(5) <<
' ' << cell->level() <<
' '
4412 << cell->material_id() <<
'\n'
4413 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4414 << cell->material_id() <<
'\n'
4416 out << cell->vertex(4) <<
' ' << cell->level() <<
' '
4417 << cell->material_id() <<
'\n'
4418 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4419 << cell->material_id() <<
'\n'
4425 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
4427 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4428 << cell->material_id() <<
'\n';
4432 for (
const unsigned int v : {3, 1})
4434 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4435 << cell->material_id() <<
'\n';
4446 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
4448 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4449 << cell->material_id() <<
'\n';
4453 for (
const unsigned int v : {1, 4})
4455 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4456 << cell->material_id() <<
'\n';
4460 for (
const unsigned int v : {2, 5})
4462 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4463 << cell->material_id() <<
'\n';
4470 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
4472 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4473 << cell->material_id() <<
'\n';
4477 for (
const unsigned int v : {2, 4, 3})
4479 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4480 << cell->material_id() <<
'\n';
4491 for (
const unsigned int face_no :
4494 const typename ::Triangulation<dim,
4495 spacedim>::face_iterator
4496 face = cell->face(face_no);
4498 if (face->at_boundary() &&
4501 const unsigned int offset = face_no * n_points * n_points;
4502 for (
unsigned int i = 0; i < n_points - 1; ++i)
4503 for (
unsigned int j = 0; j < n_points - 1; ++j)
4508 q_projector->point(offset + i * n_points + j));
4509 out << p0 <<
' ' << cell->level() <<
' '
4510 << cell->material_id() <<
'\n';
4514 offset + (i + 1) * n_points + j)))
4515 <<
' ' << cell->level() <<
' '
4516 << cell->material_id() <<
'\n';
4520 offset + (i + 1) * n_points + j + 1)))
4521 <<
' ' << cell->level() <<
' '
4522 << cell->material_id() <<
'\n';
4525 q_projector->point(offset + i * n_points +
4527 <<
' ' << cell->level() <<
' '
4528 << cell->material_id() <<
'\n';
4530 out << p0 <<
' ' << cell->level() <<
' '
4531 << cell->material_id() <<
'\n';
4532 out <<
'\n' <<
'\n';
4537 for (
unsigned int l = 0;
4538 l < GeometryInfo<dim>::lines_per_face;
4541 const typename ::Triangulation<dim, spacedim>::
4542 line_iterator line = face->line(
l);
4545 &
v1 = line->vertex(1);
4546 if (line->at_boundary() ||
4552 std::vector<Point<spacedim>> line_points;
4561 for (
unsigned int i = 0; i < n_points; ++i)
4562 line_points.push_back(
4565 (1 - boundary_points[i][0]) * u0 +
4566 boundary_points[i][0] * u1));
4567 internal::remove_colinear_points(line_points);
4569 out <<
point <<
' ' << cell->level() <<
' '
4570 <<
static_cast<unsigned int>(
4571 cell->material_id())
4575 out <<
v0 <<
' ' << cell->level() <<
' '
4576 << cell->material_id() <<
'\n'
4577 <<
v1 <<
' ' << cell->level() <<
' '
4578 << cell->material_id() <<
'\n';
4580 out <<
'\n' <<
'\n';
4597 template <
int dim,
int spacedim>
4621 const unsigned int l)
4641 write_eps(const ::Triangulation<1, 2> &,
4651 write_eps(const ::Triangulation<1, 3> &,
4661 write_eps(const ::Triangulation<2, 3> &,
4672 template <
int dim,
int spacedim>
4680 using LineList = std::list<LineEntry>;
4721 for (
const unsigned int line_no : cell->line_indices())
4723 typename ::Triangulation<dim, spacedim>::line_iterator
4724 line = cell->line(line_no);
4736 if (!line->has_children() &&
4737 (mapping ==
nullptr || !line->at_boundary()))
4757 line_list.emplace_back(
4758 Point<2>(line->vertex(0)(0), line->vertex(0)(1)),
4759 Point<2>(line->vertex(1)(0), line->vertex(1)(1)),
4760 line->user_flag_set(),
4770 if (mapping !=
nullptr)
4777 std::vector<
Point<dim - 1>> boundary_points(n_points);
4779 for (
unsigned int i = 0; i < n_points; ++i)
4780 boundary_points[i](0) = 1. * (i + 1) / (n_points + 1);
4782 Quadrature<dim - 1> quadrature(boundary_points);
4785 ReferenceCells::get_hypercube<dim>(), quadrature));
4792 for (
const unsigned int face_no :
4795 const typename ::Triangulation<dim, spacedim>::
4796 face_iterator face = cell->face(face_no);
4798 if (face->at_boundary())
4808 const unsigned int offset = face_no * n_points;
4809 for (
unsigned int i = 0; i < n_points; ++i)
4813 cell, q_projector.point(offset + i)));
4814 const Point<2> p1(p1_dim(0), p1_dim(1));
4816 line_list.emplace_back(p0,
4818 face->user_flag_set(),
4825 const Point<2> p1(p1_dim(0), p1_dim(1));
4826 line_list.emplace_back(p0,
4828 face->user_flag_set(),
4863 const double turn_angle = eps_flags_3.
turn_angle;
4865 -std::sin(z_angle * 2. * pi / 360.) *
4866 std::sin(turn_angle * 2. * pi / 360.),
4867 +std::sin(z_angle * 2. * pi / 360.) *
4868 std::cos(turn_angle * 2. * pi / 360.),
4869 -std::cos(z_angle * 2. * pi / 360.));
4877 ((
Point<dim>(0, 0, 1) * view_direction) * view_direction);
4886 ((
Point<dim>(1, 0, 0) * view_direction) * view_direction) -
4887 ((
Point<dim>(1, 0, 0) * unit_vector1) * unit_vector1));
4892 for (
const unsigned int line_no : cell->line_indices())
4894 typename ::Triangulation<dim, spacedim>::line_iterator
4895 line = cell->line(line_no);
4896 line_list.emplace_back(
4897 Point<2>(line->vertex(0) * unit_vector2,
4898 line->vertex(0) * unit_vector1),
4899 Point<2>(line->vertex(1) * unit_vector2,
4900 line->vertex(1) * unit_vector1),
4901 line->user_flag_set(),
4918 double x_max = x_min;
4920 double y_max = y_min;
4921 unsigned int max_level = line_list.begin()->level;
4923 for (LineList::const_iterator line = line_list.begin();
4924 line != line_list.end();
4927 x_min =
std::min(x_min, line->first(0));
4928 x_min =
std::min(x_min, line->second(0));
4930 x_max =
std::max(x_max, line->first(0));
4931 x_max =
std::max(x_max, line->second(0));
4933 y_min =
std::min(y_min, line->first(1));
4934 y_min =
std::min(y_min, line->second(1));
4936 y_max =
std::max(y_max, line->first(1));
4937 y_max =
std::max(y_max, line->second(1));
4939 max_level =
std::max(max_level, line->level);
4947 const double scale =
4948 (eps_flags_base.
size /
4959 std::time_t time1 = std::time(
nullptr);
4960 std::tm *time = std::localtime(&time1);
4961 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4962 <<
"%%Title: deal.II Output" <<
'\n'
4963 <<
"%%Creator: the deal.II library" <<
'\n'
4964 <<
"%%Creation Date: " << time->tm_year + 1900 <<
"/"
4965 << time->tm_mon + 1 <<
"/" << time->tm_mday <<
" - "
4966 << time->tm_hour <<
":" << std::setw(2) << time->tm_min <<
":"
4967 << std::setw(2) << time->tm_sec <<
'\n'
4968 <<
"%%BoundingBox: "
4972 <<
static_cast<unsigned int>(
4975 <<
static_cast<unsigned int>(
4985 out <<
"/m {moveto} bind def" <<
'\n'
4986 <<
"/x {lineto stroke} bind def" <<
'\n'
4987 <<
"/b {0 0 0 setrgbcolor} def" <<
'\n'
4988 <<
"/r {1 0 0 setrgbcolor} def" <<
'\n';
4995 out <<
"/l { neg " << (max_level) <<
" add "
4996 << (0.66666 /
std::max(1U, (max_level - 1)))
4997 <<
" mul 1 0.8 sethsbcolor} def" <<
'\n';
5011 << (
"/R {rmoveto} bind def\n"
5012 "/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n"
5013 "dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n"
5014 "currentdict end definefont\n"
5015 "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5016 "[ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n"
5017 "{show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n"
5018 "{2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n"
5019 "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5020 "5 get stringwidth pop add}\n"
5021 "{pop} ifelse} forall} bind def\n"
5022 "/MCshow { currentpoint stroke m\n"
5023 "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
5027 out <<
"%%EndProlog" <<
'\n' <<
'\n';
5030 out << eps_flags_base.
line_width <<
" setlinewidth" <<
'\n';
5034 const Point<2> offset(x_min, y_min);
5036 for (LineList::const_iterator line = line_list.begin();
5037 line != line_list.end();
5040 out << line->level <<
" l " << (line->first - offset) *
scale <<
" m "
5041 << (line->second - offset) *
scale <<
" x" <<
'\n';
5046 << (line->first - offset) *
scale <<
" m "
5047 << (line->second - offset) *
scale <<
" x" <<
'\n';
5053 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5057 out << (cell->center()(0) - offset(0)) *
scale <<
' '
5058 << (cell->center()(1) - offset(1)) *
scale <<
" m" <<
'\n'
5059 <<
"[ [(Helvetica) 12.0 0.0 true true (";
5063 out << cell->index();
5066 <<
"] -6 MCshow" <<
'\n';
5073 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5079 std::set<unsigned int> treated_vertices;
5081 for (
const unsigned int vertex_no : cell->vertex_indices())
5082 if (treated_vertices.find(cell->vertex_index(vertex_no)) ==
5083 treated_vertices.end())
5085 treated_vertices.insert(cell->vertex_index(vertex_no));
5087 out << (cell->vertex(vertex_no)(0) - offset(0)) *
scale <<
' '
5088 << (cell->vertex(vertex_no)(1) - offset(1)) *
scale
5090 <<
"[ [(Helvetica) 10.0 0.0 true true ("
5091 << cell->vertex_index(vertex_no) <<
")] "
5092 <<
"] -6 MCshow" <<
'\n';
5096 out <<
"showpage" <<
'\n';
5108 template <
int dim,
int spacedim>
5118 template <
int dim,
int spacedim>
5125 switch (output_format)
5175 template <
int dim,
int spacedim>
5186 #include "grid_out.inst"
void write_pvtu_record(std::ostream &out, const std::vector< std::string > &piece_names) const
void attach_triangulation(const Triangulation< dim, spacedim > &)
void add_data_vector(const VectorType &data, const std::vector< std::string > &names, const DataVectorType type=type_automatic, const std::vector< DataComponentInterpretation::DataComponentInterpretation > &data_component_interpretation={})
virtual void build_patches(const unsigned int n_subdivisions=0)
unsigned int n_boundary_faces(const Triangulation< dim, spacedim > &tria) const
GridOutFlags::Vtu vtu_flags
GridOutFlags::Eps< 2 > eps_flags_2
unsigned int write_ucd_lines(const Triangulation< dim, spacedim > &tria, const unsigned int next_element_index, std::ostream &out) const
void parse_parameters(ParameterHandler ¶m)
void write_svg(const Triangulation< 2, 2 > &tria, std::ostream &out) const
void set_flags(const GridOutFlags::DX &flags)
GridOutFlags::Eps< 1 > eps_flags_1
GridOutFlags::XFig xfig_flags
unsigned int write_ucd_faces(const Triangulation< dim, spacedim > &tria, const unsigned int next_element_index, std::ostream &out) const
void write_mathgl(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
std::string default_suffix() const
static void declare_parameters(ParameterHandler ¶m)
static OutputFormat parse_output_format(const std::string &format_name)
void write_vtk(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
GridOutFlags::Gnuplot gnuplot_flags
void write_msh(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
unsigned int write_msh_lines(const Triangulation< dim, spacedim > &tria, const unsigned int next_element_index, std::ostream &out) const
void write_eps(const Triangulation< dim, spacedim > &tria, std::ostream &out, const Mapping< dim, spacedim > *mapping=nullptr) const
static std::string get_output_format_names()
GridOutFlags::Eps< 3 > eps_flags_3
void write(const Triangulation< dim, spacedim > &tria, std::ostream &out, const OutputFormat output_format, const Mapping< dim, spacedim > *mapping=nullptr) const
void write_vtu(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
GridOutFlags::Ucd ucd_flags
void write_dx(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
std::size_t memory_consumption() const
unsigned int n_boundary_lines(const Triangulation< dim, spacedim > &tria) const
GridOutFlags::DX dx_flags
unsigned int write_msh_faces(const Triangulation< dim, spacedim > &tria, const unsigned int next_element_index, std::ostream &out) const
void write_ucd(const Triangulation< dim, spacedim > &tria, std::ostream &out) const
GridOutFlags::Svg svg_flags
OutputFormat default_format
void write_xfig(const Triangulation< dim, spacedim > &tria, std::ostream &out, const Mapping< dim, spacedim > *mapping=nullptr) const
void write_gnuplot(const Triangulation< dim, spacedim > &tria, std::ostream &out, const Mapping< dim, spacedim > *mapping=nullptr) const
GridOutFlags::Vtk vtk_flags
GridOutFlags::Msh msh_flags
void write_mesh_per_processor_as_vtu(const Triangulation< dim, spacedim > &tria, const std::string &filename_without_extension, const bool view_levels=false, const bool include_artificial=false) const
@ vtk
write() calls write_vtk()
@ eps
write() calls write_eps()
@ msh
write() calls write_msh()
@ xfig
write() calls write_xfig()
@ dx
write() calls write_dx()
@ ucd
write() calls write_ucd()
@ gnuplot
write() calls write_gnuplot()
@ mathgl
write() calls write_mathgl()
@ svg
write() calls write_svg()
@ none
Do nothing in write()
@ vtu
write() calls write_vtu()
GridOutFlags::MathGL mathgl_flags
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const =0
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const =0
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)
static Quadrature< dim > project_to_all_faces(const ReferenceCell &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
const Point< dim > & point(const unsigned int i) const
unsigned int gmsh_element_type() const
numbers::NumberTraits< Number >::real_type norm() const
const std::vector< bool > & get_used_vertices() const
void save_user_flags_line(std::ostream &out) const
void save(Archive &ar, const unsigned int version) const
cell_iterator begin(const unsigned int level=0) const
virtual types::subdomain_id locally_owned_subdomain() const
unsigned int n_active_cells() const
unsigned int n_used_vertices() const
cell_iterator end() const
const std::vector< ReferenceCell > & get_reference_cells() const
const std::vector< Point< spacedim > > & get_vertices() const
active_cell_iterator begin_active(const unsigned int level=0) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< active_face_iterator > active_face_iterators() const
IteratorRange< cell_iterator > cell_iterators() const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcInvalidState()
static ::ExceptionBase & ExcInternalError()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
DataComponentInterpretation
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_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_vtu_header(std::ostream &out, const VtkFlags &flags)
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)
void write_vtu_footer(std::ostream &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_cells(const std::vector< Patch< dim, spacedim >> &patches, StreamType &out)
Expression floor(const Expression &x)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
types::global_dof_index size_type
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim >>> &Du)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell Triangle
constexpr const ReferenceCell Hexahedron
constexpr const ReferenceCell Vertex
constexpr const ReferenceCell Line
VectorType::value_type * end(VectorType &V)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
std::string encode_base64(const std::vector< unsigned char > &binary_input)
std::string compress(const std::string &input)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
const types::boundary_id invalid_boundary_id
static constexpr double PI
const types::boundary_id internal_face_boundary_id
const types::subdomain_id artificial_subdomain_id
static const unsigned int invalid_unsigned_int
const types::manifold_id flat_manifold_id
static void declare_parameters(ParameterHandler &prm)
void parse_parameters(const ParameterHandler &prm)
ReferenceCell reference_cell
unsigned int n_subdivisions
std::array< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > vertices
bool points_are_available
std::array< unsigned int, GeometryInfo< dim >::faces_per_cell > neighbors
static void declare_parameters(ParameterHandler ¶m)
void parse_parameters(ParameterHandler ¶m)
DX(const bool write_cells=true, const bool write_faces=false, const bool write_diameter=false, const bool write_measure=false, const bool write_all_faces=true)
static void declare_parameters(ParameterHandler ¶m)
bool color_lines_on_user_flag
unsigned int n_boundary_face_points
void parse_parameters(ParameterHandler ¶m)
EpsFlagsBase(const SizeType size_type=width, const unsigned int size=300, const double line_width=0.5, const bool color_lines_on_user_flag=false, const unsigned int n_boundary_face_points=2, const bool color_lines_level=false)
void parse_parameters(ParameterHandler ¶m)
bool write_cell_number_level
void parse_parameters(ParameterHandler ¶m)
bool write_vertex_numbers
void parse_parameters(ParameterHandler ¶m)
unsigned int n_extra_curved_line_points
void parse_parameters(ParameterHandler ¶m)
Gnuplot(const bool write_cell_number=false, const unsigned int n_extra_curved_line_points=2, const bool curved_inner_cells=false, const bool write_additional_boundary_lines=true)
static void declare_parameters(ParameterHandler ¶m)
bool write_additional_boundary_lines
void parse_parameters(ParameterHandler ¶m)
static void declare_parameters(ParameterHandler ¶m)
Msh(const bool write_faces=false, const bool write_lines=false)
void parse_parameters(ParameterHandler ¶m)
static void declare_parameters(ParameterHandler ¶m)
bool label_level_subdomain_id
unsigned int line_thickness
bool convert_level_number_to_height
Svg(const unsigned int line_thickness=2, const unsigned int boundary_line_thickness=4, const bool margin=true, const Background background=white, const int azimuth_angle=0, const int polar_angle=0, const Coloring coloring=level_number, const bool convert_level_number_to_height=false, const bool label_level_number=false, const bool label_cell_index=false, const bool label_material_id=false, const bool label_subdomain_id=false, const bool draw_colorbar=false, const bool draw_legend=false, const bool label_boundary_id=false)
@ level_subdomain_id
Convert the level subdomain id into the cell color.
@ subdomain_id
Convert the subdomain id into the cell color.
@ material_id
Convert the material id into the cell color (default)
@ level_number
Convert the level number into the cell color.
unsigned int boundary_line_thickness
float level_height_factor
Ucd(const bool write_preamble=false, const bool write_faces=false, const bool write_lines=false)
static void declare_parameters(ParameterHandler ¶m)
void parse_parameters(ParameterHandler ¶m)
bool output_only_relevant
bool serialize_triangulation
unsigned int n_boundary_face_points
@ level_number
Convert the level into the cell color.
@ material_id
Convert the material id into the cell color.
@ level_subdomain_id
Convert the level subdomain id into the cell color.
@ subdomain_id
Convert the global subdomain id into the cell color.
void parse_parameters(ParameterHandler ¶m)
static void declare_parameters(ParameterHandler ¶m)
enum GridOutFlags::XFig::Coloring color_by
const ::Triangulation< dim, spacedim > & tria