33#include <boost/archive/binary_oarchive.hpp>
35#ifdef DEAL_II_GMSH_WITH_API
54 const bool write_faces,
55 const bool write_diameter,
56 const bool write_measure,
57 const bool write_all_faces)
58 : write_cells(write_cells)
59 , write_faces(write_faces)
60 , write_diameter(write_diameter)
61 , write_measure(write_measure)
62 , write_all_faces(write_all_faces)
71 "Write the mesh connectivity as DX grid cells");
75 "Write faces of cells. These may be boundary faces "
76 "or all faces between mesh cells, according to "
77 "\"Write all faces\"");
81 "If cells are written, additionally write their"
82 " diameter as data for visualization");
86 "Write the volume of each cell as data");
90 "Write all faces, not only boundary");
104 Msh::Msh(
const bool write_faces,
const bool write_lines)
105 : write_faces(write_faces)
106 , write_lines(write_lines)
126 const bool write_faces,
127 const bool write_lines)
128 : write_preamble(write_preamble)
129 , write_faces(write_faces)
130 , write_lines(write_lines)
155 const unsigned int n_extra_curved_line_points,
156 const bool curved_inner_cells,
157 const bool write_additional_boundary_lines)
158 : write_cell_numbers(write_cell_numbers)
159 , n_extra_curved_line_points(n_extra_curved_line_points)
160 , curved_inner_cells(curved_inner_cells)
161 , write_additional_boundary_lines(write_additional_boundary_lines)
183 const unsigned int size,
184 const double line_width,
185 const bool color_lines_on_user_flag,
186 const unsigned int n_boundary_face_points,
187 const bool color_lines_level)
188 : size_type(size_type)
190 , line_width(line_width)
191 , color_lines_on_user_flag(color_lines_on_user_flag)
192 , n_boundary_face_points(n_boundary_face_points)
193 , color_lines_level(color_lines_level)
203 "Depending on this parameter, either the "
205 "of the eps is scaled to \"Size\"");
209 "Size of the output in points");
213 "Width of the lines drawn in points");
217 "Draw lines with user flag set in different color");
221 "Number of points on boundary edges. "
222 "Increase this beyond 2 to see curved boundaries.");
226 "Draw different colors according to grid level.");
233 if (param.
get(
"Size by") == std::string(
"width"))
235 else if (param.
get(
"Size by") == std::string(
"height"))
247 const unsigned int size,
248 const double line_width,
249 const bool color_lines_on_user_flag,
250 const unsigned int n_boundary_face_points)
254 color_lines_on_user_flag,
255 n_boundary_face_points)
273 const unsigned int size,
274 const double line_width,
275 const bool color_lines_on_user_flag,
276 const unsigned int n_boundary_face_points,
277 const bool write_cell_numbers,
278 const bool write_cell_number_level,
279 const bool write_vertex_numbers,
280 const bool color_lines_level)
284 color_lines_on_user_flag,
285 n_boundary_face_points,
287 , write_cell_numbers(write_cell_numbers)
288 , write_cell_number_level(write_cell_number_level)
289 , write_vertex_numbers(write_vertex_numbers)
299 "(2d only) Write cell numbers"
300 " into the centers of cells");
304 "(2d only) if \"Cell number\" is true, write "
305 "numbers in the form level.number");
309 "Write numbers for each vertex");
317 write_cell_numbers = param.
get_bool(
"Cell number");
318 write_cell_number_level = param.
get_bool(
"Level number");
319 write_vertex_numbers = param.
get_bool(
"Vertex number");
325 const unsigned int size,
326 const double line_width,
327 const bool color_lines_on_user_flag,
328 const unsigned int n_boundary_face_points,
329 const double azimut_angle,
330 const double turn_angle)
334 color_lines_on_user_flag,
335 n_boundary_face_points)
336 , azimut_angle(azimut_angle)
337 , turn_angle(turn_angle)
347 "Azimuth of the viw point, that is, the angle "
348 "in the plane from the x-axis.");
352 "Elevation of the view point above the xy-plane.");
360 azimut_angle = 90 - param.
get_double(
"Elevation");
367 : draw_boundary(true)
368 , color_by(material_id)
370 , n_boundary_face_points(0)
376 , boundary_thickness(3)
410 const unsigned int boundary_line_thickness,
413 const int azimuth_angle,
414 const int polar_angle,
416 const bool convert_level_number_to_height,
417 const bool label_level_number,
418 const bool label_cell_index,
419 const bool label_material_id,
420 const bool label_subdomain_id,
421 const bool draw_colorbar,
422 const bool draw_legend,
423 const bool label_boundary_id)
426 , line_thickness(line_thickness)
427 , boundary_line_thickness(boundary_line_thickness)
429 , background(background)
430 , azimuth_angle(azimuth_angle)
431 , polar_angle(polar_angle)
433 , convert_level_number_to_height(convert_level_number_to_height)
434 , level_height_factor(0.3f)
435 , cell_font_scaling(1.f)
436 , label_level_number(label_level_number)
437 , label_cell_index(label_cell_index)
438 , label_material_id(label_material_id)
439 , label_subdomain_id(label_subdomain_id)
440 , label_level_subdomain_id(false)
441 , label_boundary_id(label_boundary_id)
442 , draw_colorbar(draw_colorbar)
443 , draw_legend(draw_legend)
447 : draw_bounding_box(false)
466 : default_format(none)
560 switch (output_format)
603 if (format_name ==
"none" || format_name ==
"false")
606 if (format_name ==
"dx")
609 if (format_name ==
"ucd")
612 if (format_name ==
"gnuplot")
615 if (format_name ==
"eps")
618 if (format_name ==
"xfig")
621 if (format_name ==
"msh")
624 if (format_name ==
"svg")
627 if (format_name ==
"mathgl")
630 if (format_name ==
"vtk")
633 if (format_name ==
"vtu")
646 return "none|dx|gnuplot|eps|ucd|xfig|msh|svg|mathgl|vtk|vtu";
779template <
int dim,
int spacedim>
782 std::ostream &out)
const
798 std::vector<unsigned int> renumber(
vertices.size());
801 unsigned int new_number = 0;
802 for (
unsigned int i = 0; i <
vertices.size(); ++i)
804 renumber[i] = new_number++;
808 out <<
"object \"vertices\" class array type float rank 1 shape " << dim
809 <<
" items " << n_vertices <<
" data follows" <<
'\n';
811 for (
unsigned int i = 0; i <
vertices.size(); ++i)
820 const unsigned int n_faces =
828 out <<
"object \"cells\" class array type int rank 1 shape "
829 << n_vertices_per_cell <<
" items " << n_cells <<
" data follows"
840 out <<
"attribute \"element type\" string \"";
848 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
853 out <<
"object \"material\" class array type int rank 0 items " << n_cells
854 <<
" data follows" <<
'\n';
856 out <<
' ' << cell->material_id();
857 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
859 out <<
"object \"level\" class array type int rank 0 items " << n_cells
860 <<
" data follows" <<
'\n';
862 out <<
' ' << cell->level();
863 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
867 out <<
"object \"measure\" class array type float rank 0 items "
868 << n_cells <<
" data follows" <<
'\n';
870 out <<
'\t' << cell->measure();
872 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
878 out <<
"object \"diameter\" class array type float rank 0 items "
879 << n_cells <<
" data follows" <<
'\n';
881 out <<
'\t' << cell->diameter();
883 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
890 out <<
"object \"faces\" class array type int rank 1 shape "
891 << n_vertices_per_face <<
" items " << n_faces <<
" data follows"
896 for (
const unsigned int f : cell->face_indices())
901 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
904 << renumber[face->vertex_index(
909 out <<
"attribute \"element type\" string \"";
915 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
921 out <<
"object \"boundary\" class array type int rank 0 items " << n_faces
922 <<
" data follows" <<
'\n';
929 <<
static_cast<std::make_signed_t<types::boundary_id>
>(
930 cell->face(f)->boundary_id());
934 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
938 out <<
"object \"face measure\" class array type float rank 0 items "
939 << n_faces <<
" data follows" <<
'\n';
943 out <<
' ' << cell->face(f)->measure();
946 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
951 out <<
"object \"face diameter\" class array type float rank 0 items "
952 << n_faces <<
" data follows" <<
'\n';
956 out <<
' ' << cell->face(f)->diameter();
959 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
974 out <<
"object \"deal data\" class field" <<
'\n'
975 <<
"component \"positions\" value \"vertices\"" <<
'\n'
976 <<
"component \"connections\" value \"cells\"" <<
'\n';
980 out <<
"object \"cell data\" class field" <<
'\n'
981 <<
"component \"positions\" value \"vertices\"" <<
'\n'
982 <<
"component \"connections\" value \"cells\"" <<
'\n';
983 out <<
"component \"material\" value \"material\"" <<
'\n';
984 out <<
"component \"level\" value \"level\"" <<
'\n';
986 out <<
"component \"measure\" value \"measure\"" <<
'\n';
988 out <<
"component \"diameter\" value \"diameter\"" <<
'\n';
993 out <<
"object \"face data\" class field" <<
'\n'
994 <<
"component \"positions\" value \"vertices\"" <<
'\n'
995 <<
"component \"connections\" value \"faces\"" <<
'\n';
996 out <<
"component \"boundary\" value \"boundary\"" <<
'\n';
998 out <<
"component \"measure\" value \"face measure\"" <<
'\n';
1000 out <<
"component \"diameter\" value \"face diameter\"" <<
'\n';
1003 out <<
'\n' <<
"object \"grid data\" class group" <<
'\n';
1005 out <<
"member \"cells\" value \"cell data\"" <<
'\n';
1007 out <<
"member \"faces\" value \"face data\"" <<
'\n';
1008 out <<
"end" <<
'\n';
1019template <
int dim,
int spacedim>
1022 std::ostream &out)
const
1050 out <<
"@f$NOD" <<
'\n' << n_vertices <<
'\n';
1055 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1060 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1066 out <<
"@f$ENDNOD" <<
'\n'
1073 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
1074 {0, 1, 5, 4, 2, 3, 7, 6}};
1080 out << cell->active_cell_index() + 1 <<
' '
1081 << cell->reference_cell().gmsh_element_type() <<
' '
1082 << cell->material_id() <<
' ' << cell->subdomain_id() <<
' '
1083 << cell->n_vertices() <<
' ';
1087 for (
const unsigned int vertex : cell->vertex_indices())
1089 if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
1090 out << cell->vertex_index(
1091 dim == 3 ? local_vertex_numbering[vertex] :
1095 else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
1096 out << cell->vertex_index(vertex) + 1 <<
' ';
1114 out <<
"@f$ENDELM\n";
1124template <
int dim,
int spacedim>
1127 std::ostream &out)
const
1145 std::time_t time1 = std::time(
nullptr);
1146 std::tm *time = std::localtime(&time1);
1148 <<
"# This file was generated by the deal.II library." <<
'\n'
1149 <<
"# Date = " << time->tm_year + 1900 <<
"/" << time->tm_mon + 1
1150 <<
"/" << time->tm_mday <<
'\n'
1151 <<
"# Time = " << time->tm_hour <<
":" << std::setw(2) << time->tm_min
1152 <<
":" << std::setw(2) << time->tm_sec <<
'\n'
1154 <<
"# For a description of the UCD format see the AVS Developer's guide."
1160 out << n_vertices <<
' '
1170 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1175 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1184 out << cell->active_cell_index() + 1 <<
' ' << cell->material_id() <<
' ';
1241template <
int dim,
int spacedim>
1259 const int spacedim = 2;
1265 out <<
"#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
1266 <<
"A4\n100.00\nSingle"
1269 <<
"-3" << std::endl
1270 <<
"# generated by deal.II GridOut class" << std::endl
1271 <<
"# reduce first number to scale up image" << std::endl
1272 <<
"1200 2" << std::endl;
1275 unsigned int colno = 32;
1276 out <<
"0 " << colno++ <<
" #ff0000" << std::endl;
1277 out <<
"0 " << colno++ <<
" #ff8000" << std::endl;
1278 out <<
"0 " << colno++ <<
" #ffd000" << std::endl;
1279 out <<
"0 " << colno++ <<
" #ffff00" << std::endl;
1280 out <<
"0 " << colno++ <<
" #c0ff00" << std::endl;
1281 out <<
"0 " << colno++ <<
" #80ff00" << std::endl;
1282 out <<
"0 " << colno++ <<
" #00f000" << std::endl;
1283 out <<
"0 " << colno++ <<
" #00f0c0" << std::endl;
1284 out <<
"0 " << colno++ <<
" #00f0ff" << std::endl;
1285 out <<
"0 " << colno++ <<
" #00c0ff" << std::endl;
1286 out <<
"0 " << colno++ <<
" #0080ff" << std::endl;
1287 out <<
"0 " << colno++ <<
" #0040ff" << std::endl;
1288 out <<
"0 " << colno++ <<
" #0000c0" << std::endl;
1289 out <<
"0 " << colno++ <<
" #5000ff" << std::endl;
1290 out <<
"0 " << colno++ <<
" #8000ff" << std::endl;
1291 out <<
"0 " << colno++ <<
" #b000ff" << std::endl;
1292 out <<
"0 " << colno++ <<
" #ff00ff" << std::endl;
1293 out <<
"0 " << colno++ <<
" #ff80ff" << std::endl;
1295 for (
unsigned int i = 0; i < 8; ++i)
1296 out <<
"0 " << colno++ <<
" #" << std::hex << 32 * i + 31 << 32 * i + 31
1297 << 32 * i + 31 << std::dec << std::endl;
1299 for (
unsigned int i = 1; i < 16; ++i)
1300 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << std::dec
1301 <<
"00" << std::endl;
1303 for (
unsigned int i = 1; i < 16; ++i)
1304 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << 16 * i + 15
1305 << std::dec <<
"00" << std::endl;
1307 for (
unsigned int i = 1; i < 16; ++i)
1308 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << std::dec
1309 <<
"0000" << std::endl;
1311 for (
unsigned int i = 1; i < 16; ++i)
1312 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 <<
"00"
1313 << 16 * i + 15 << std::dec << std::endl;
1315 for (
unsigned int i = 1; i < 16; ++i)
1316 out <<
"0 " << colno++ <<
" #0000" << std::hex << 16 * i + 15 << std::dec
1319 for (
unsigned int i = 1; i < 16; ++i)
1320 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << 16 * i + 15
1321 << std::dec << std::endl;
1343 out << cell->material_id() + 32;
1346 out << cell->level() + 8;
1349 out << cell->subdomain_id() + 32;
1352 out << cell->level_subdomain_id() + 32;
1361 (900 + cell->material_id()))
1367 << nv + 1 << std::endl;
1373 for (
unsigned int k = 0; k <= nv; ++k)
1377 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim); ++d)
1381 out <<
'\t' << ((d == 0) ? val : -val);
1386 static const unsigned int face_reorder[4] = {2, 1, 3, 0};
1388 for (
const unsigned int f : face_reorder)
1416 for (
unsigned int k = 0;
1417 k < GeometryInfo<dim>::vertices_per_face;
1421 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim);
1427 out <<
'\t' << ((d == 0) ? val : -val);
1444#ifdef DEAL_II_GMSH_WITH_API
1445template <
int dim,
int spacedim>
1448 const std::string &filename)
const
1451 const std::array<int, 8> dealii_to_gmsh_type = {{15, 1, 2, 3, 4, 7, 6, 5}};
1454 const std::array<std::vector<unsigned int>, 8> dealii_to_gmsh = {
1461 {{0, 1, 2, 3, 4, 5}},
1462 {{0, 1, 3, 2, 4, 5, 7, 6}}}};
1467 std::vector<double> coords(3 *
vertices.size());
1468 std::vector<std::size_t> nodes(
vertices.size());
1474 for (
unsigned int d = 0; d < spacedim; ++d)
1475 coords[i * 3 + d] = p[d];
1487 using IdPair = std::pair<types::material_id, types::manifold_id>;
1488 std::map<IdPair, int> id_pair_to_entity_tag;
1489 std::vector<IdPair> all_pairs;
1491 std::set<IdPair> set_of_pairs;
1494 set_of_pairs.insert({cell->material_id(), cell->manifold_id()});
1495 for (
const auto &f : cell->face_iterators())
1497 (f->boundary_id() != 0 &&
1499 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1501 for (
const auto l : cell->line_indices())
1503 const auto &f = cell->line(l);
1505 (f->boundary_id() != 0 &&
1507 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1510 all_pairs = {set_of_pairs.begin(), set_of_pairs.end()};
1513 for (
const auto &p : set_of_pairs)
1514 id_pair_to_entity_tag[p] = entity++;
1517 const auto n_entity_tags = id_pair_to_entity_tag.size();
1520 std::vector<std::vector<std::vector<std::size_t>>> element_ids(
1521 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1522 std::vector<std::vector<std::vector<std::size_t>>> element_nodes(
1523 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1526 std::size_t element_id = 1;
1528 const auto add_element = [&](
const auto &element,
const int &entity_tag) {
1529 const auto type = element->reference_cell();
1534 for (
const auto v : element->vertex_indices())
1535 element_nodes[entity_tag - 1][type].emplace_back(
1536 element->vertex_index(dealii_to_gmsh[type][v]) + 1);
1539 element_ids[entity_tag - 1][type].emplace_back(element_id);
1547 std::set<std::pair<int, int>> dim_entity_tag;
1549 auto maybe_add_element =
1550 [&](
const auto &element,
1552 const auto struct_dim = element->structure_dimension;
1553 const auto manifold_id = element->manifold_id();
1556 const bool non_default_boundary_or_material_id =
1557 (boundary_or_material_id != 0 &&
1559 const bool non_default_manifold =
1561 if (struct_dim == dim || non_default_boundary_or_material_id ||
1562 non_default_manifold)
1564 const auto entity_tag =
1565 id_pair_to_entity_tag[{boundary_or_material_id, manifold_id}];
1566 add_element(element, entity_tag);
1567 dim_entity_tag.insert({struct_dim, entity_tag});
1574 maybe_add_element(cell, cell->material_id());
1575 for (
const auto &face : cell->face_iterators())
1576 maybe_add_element(face, face->boundary_id());
1578 for (
const auto l : cell->line_indices())
1579 maybe_add_element(cell->line(l), cell->line(l)->boundary_id());
1584 gmsh::option::setNumber(
"General.Verbosity", 0);
1585 gmsh::model::add(
"Grid generated in deal.II");
1586 for (
const auto &p : dim_entity_tag)
1588 gmsh::model::addDiscreteEntity(p.first, p.second);
1589 gmsh::model::mesh::addNodes(p.first, p.second, nodes, coords);
1592 for (
unsigned int entity_tag = 0; entity_tag < n_entity_tags; ++entity_tag)
1593 for (
unsigned int t = 1; t < 8; ++t)
1595 const auto all_element_ids = element_ids[entity_tag][t];
1596 const auto all_element_nodes = element_nodes[entity_tag][t];
1597 const auto gmsh_t = dealii_to_gmsh_type[t];
1598 if (all_element_ids.size() > 0)
1599 gmsh::model::mesh::addElementsByType(entity_tag + 1,
1607 for (
const auto &it : dim_entity_tag)
1609 const auto &d = it.first;
1610 const auto &entity_tag = it.second;
1611 const auto &boundary_id = all_pairs[entity_tag - 1].first;
1612 const auto &manifold_id = all_pairs[entity_tag - 1].second;
1614 std::string physical_name;
1615 if (d == dim && boundary_id != 0)
1617 static_cast<int>(boundary_id));
1618 else if (d < dim && boundary_id != 0)
1625 std::string sep = physical_name !=
"" ?
", " :
"";
1628 sep +
"ManifoldID:" +
1630 const auto physical_tag =
1631 gmsh::model::addPhysicalGroup(d, {entity_tag}, -1);
1632 if (physical_name !=
"")
1633 gmsh::model::setPhysicalName(d, physical_tag, physical_name);
1637 gmsh::write(filename);
1658 svg_project_point(
const Point<3> &point,
1662 const float camera_focus)
1665 cross_product_3d(camera_horizontal, camera_direction);
1668 camera_focus / ((point - camera_position) * camera_direction);
1671 camera_position + phi * (point - camera_position);
1673 return {(projection - camera_position - camera_focus * camera_direction) *
1675 (projection - camera_position - camera_focus * camera_direction) *
1682template <
int dim,
int spacedim>
1685 std::ostream & )
const
1688 ExcMessage(
"Mesh output in SVG format is not implemented for anything "
1689 "other than two-dimensional meshes in two-dimensional "
1690 "space. That's because three-dimensional meshes are best "
1691 "viewed in programs that allow changing the viewpoint, "
1692 "but SVG format does not allow this: It is an inherently "
1693 "2d format, and for three-dimensional meshes would "
1694 "require choosing one, fixed viewpoint."
1696 "You probably want to output your mesh in a format such "
1697 "as VTK, VTU, or gnuplot."));
1706 unsigned int min_level, max_level;
1714 Assert(height != 0 || width != 0,
1715 ExcMessage(
"You have to set at least one of width and height"));
1717 unsigned int margin_in_percent = 0;
1719 margin_in_percent = 8;
1722 unsigned int cell_label_font_size;
1735 float x_max_perspective, x_min_perspective;
1736 float y_max_perspective, y_min_perspective;
1738 float x_dimension_perspective, y_dimension_perspective;
1742 double x_min = tria.
begin()->vertex(0)[0];
1743 double x_max = x_min;
1744 double y_min = tria.
begin()->vertex(0)[1];
1745 double y_max = y_min;
1747 double x_dimension, y_dimension;
1749 min_level = max_level = tria.
begin()->level();
1752 std::set<unsigned int> materials;
1755 std::set<unsigned int> levels;
1758 std::set<unsigned int> subdomains;
1761 std::set<int> level_subdomains;
1769 for (
unsigned int vertex_index = 0; vertex_index < cell->n_vertices();
1772 if (cell->vertex(vertex_index)[0] < x_min)
1773 x_min = cell->vertex(vertex_index)[0];
1774 if (cell->vertex(vertex_index)[0] > x_max)
1775 x_max = cell->vertex(vertex_index)[0];
1777 if (cell->vertex(vertex_index)[1] < y_min)
1778 y_min = cell->vertex(vertex_index)[1];
1779 if (cell->vertex(vertex_index)[1] > y_max)
1780 y_max = cell->vertex(vertex_index)[1];
1783 if (
static_cast<unsigned int>(cell->level()) < min_level)
1784 min_level = cell->level();
1785 if (
static_cast<unsigned int>(cell->level()) > max_level)
1786 max_level = cell->level();
1788 materials.insert(cell->material_id());
1789 levels.insert(cell->level());
1790 if (cell->is_active())
1791 subdomains.insert(cell->subdomain_id() + 2);
1792 level_subdomains.insert(cell->level_subdomain_id() + 2);
1795 x_dimension = x_max - x_min;
1796 y_dimension = y_max - y_min;
1799 const unsigned int n_materials = materials.size();
1802 const unsigned int n_levels = levels.size();
1805 const unsigned int n_subdomains = subdomains.size();
1808 const unsigned int n_level_subdomains = level_subdomains.size();
1822 n = n_level_subdomains;
1831 camera_position[0] = 0;
1832 camera_position[1] = 0;
1833 camera_position[2] = 2. *
std::max(x_dimension, y_dimension);
1836 camera_direction[0] = 0;
1837 camera_direction[1] = 0;
1838 camera_direction[2] = -1;
1841 camera_horizontal[0] = 1;
1842 camera_horizontal[1] = 0;
1843 camera_horizontal[2] = 0;
1845 camera_focus = .5 *
std::max(x_dimension, y_dimension);
1851 const double angle_factor = 3.14159265 / 180.;
1854 camera_position_temp[1] =
1857 camera_position_temp[2] =
1861 camera_direction_temp[1] =
1864 camera_direction_temp[2] =
1868 camera_horizontal_temp[1] =
1871 camera_horizontal_temp[2] =
1875 camera_position[1] = camera_position_temp[1];
1876 camera_position[2] = camera_position_temp[2];
1878 camera_direction[1] = camera_direction_temp[1];
1879 camera_direction[2] = camera_direction_temp[2];
1881 camera_horizontal[1] = camera_horizontal_temp[1];
1882 camera_horizontal[2] = camera_horizontal_temp[2];
1885 camera_position_temp[0] =
1888 camera_position_temp[1] =
1892 camera_direction_temp[0] =
1895 camera_direction_temp[1] =
1899 camera_horizontal_temp[0] =
1902 camera_horizontal_temp[1] =
1906 camera_position[0] = camera_position_temp[0];
1907 camera_position[1] = camera_position_temp[1];
1909 camera_direction[0] = camera_direction_temp[0];
1910 camera_direction[1] = camera_direction_temp[1];
1912 camera_horizontal[0] = camera_horizontal_temp[0];
1913 camera_horizontal[1] = camera_horizontal_temp[1];
1916 camera_position[0] = x_min + .5 * x_dimension;
1917 camera_position[1] = y_min + .5 * y_dimension;
1919 camera_position[0] += 2. *
std::max(x_dimension, y_dimension) *
1922 camera_position[1] -= 2. *
std::max(x_dimension, y_dimension) *
1929 point[0] = tria.
begin()->vertex(0)[0];
1930 point[1] = tria.
begin()->vertex(0)[1];
1933 float min_level_min_vertex_distance = 0;
1938 (
static_cast<float>(tria.
begin()->level()) /
1939 static_cast<float>(n_levels)) *
1940 std::max(x_dimension, y_dimension);
1943 projection_decomposition = svg_project_point(
1944 point, camera_position, camera_direction, camera_horizontal, camera_focus);
1946 x_max_perspective = projection_decomposition[0];
1947 x_min_perspective = projection_decomposition[0];
1949 y_max_perspective = projection_decomposition[1];
1950 y_min_perspective = projection_decomposition[1];
1954 point[0] = cell->vertex(0)[0];
1955 point[1] = cell->vertex(0)[1];
1962 (
static_cast<float>(cell->level()) /
static_cast<float>(n_levels)) *
1963 std::max(x_dimension, y_dimension);
1966 projection_decomposition = svg_project_point(point,
1972 if (x_max_perspective < projection_decomposition[0])
1973 x_max_perspective = projection_decomposition[0];
1974 if (x_min_perspective > projection_decomposition[0])
1975 x_min_perspective = projection_decomposition[0];
1977 if (y_max_perspective < projection_decomposition[1])
1978 y_max_perspective = projection_decomposition[1];
1979 if (y_min_perspective > projection_decomposition[1])
1980 y_min_perspective = projection_decomposition[1];
1982 point[0] = cell->vertex(1)[0];
1983 point[1] = cell->vertex(1)[1];
1985 projection_decomposition = svg_project_point(point,
1991 if (x_max_perspective < projection_decomposition[0])
1992 x_max_perspective = projection_decomposition[0];
1993 if (x_min_perspective > projection_decomposition[0])
1994 x_min_perspective = projection_decomposition[0];
1996 if (y_max_perspective < projection_decomposition[1])
1997 y_max_perspective = projection_decomposition[1];
1998 if (y_min_perspective > projection_decomposition[1])
1999 y_min_perspective = projection_decomposition[1];
2001 point[0] = cell->vertex(2)[0];
2002 point[1] = cell->vertex(2)[1];
2004 projection_decomposition = svg_project_point(point,
2010 if (x_max_perspective < projection_decomposition[0])
2011 x_max_perspective = projection_decomposition[0];
2012 if (x_min_perspective > projection_decomposition[0])
2013 x_min_perspective = projection_decomposition[0];
2015 if (y_max_perspective < projection_decomposition[1])
2016 y_max_perspective = projection_decomposition[1];
2017 if (y_min_perspective > projection_decomposition[1])
2018 y_min_perspective = projection_decomposition[1];
2020 if (cell->n_vertices() == 4)
2022 point[0] = cell->vertex(3)[0];
2023 point[1] = cell->vertex(3)[1];
2025 projection_decomposition = svg_project_point(point,
2031 if (x_max_perspective < projection_decomposition[0])
2032 x_max_perspective = projection_decomposition[0];
2033 if (x_min_perspective > projection_decomposition[0])
2034 x_min_perspective = projection_decomposition[0];
2036 if (y_max_perspective < projection_decomposition[1])
2037 y_max_perspective = projection_decomposition[1];
2038 if (y_min_perspective > projection_decomposition[1])
2039 y_min_perspective = projection_decomposition[1];
2042 if (
static_cast<unsigned int>(cell->level()) == min_level)
2043 min_level_min_vertex_distance = cell->minimum_vertex_distance();
2046 x_dimension_perspective = x_max_perspective - x_min_perspective;
2047 y_dimension_perspective = y_max_perspective - y_min_perspective;
2051 width =
static_cast<unsigned int>(
2052 .5 + height * (x_dimension_perspective / y_dimension_perspective));
2053 else if (height == 0)
2054 height =
static_cast<unsigned int>(
2055 .5 + width * (y_dimension_perspective / x_dimension_perspective));
2056 unsigned int additional_width = 0;
2058 unsigned int font_size =
2059 static_cast<unsigned int>(.5 + (height / 100.) * 1.75);
2060 cell_label_font_size =
static_cast<unsigned int>(
2062 min_level_min_vertex_distance /
std::min(x_dimension, y_dimension)));
2069 additional_width =
static_cast<unsigned int>(
2074 additional_width =
static_cast<unsigned int>(
2075 .5 + height * .175);
2087 out <<
"<svg width=\"" << width + additional_width <<
"\" height=\"" << height
2088 <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" <<
'\n'
2095 <<
" <linearGradient id=\"background_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\""
2096 << height <<
"\">" <<
'\n'
2097 <<
" <stop offset=\"0\" style=\"stop-color:white\"/>" <<
'\n'
2098 <<
" <stop offset=\"1\" style=\"stop-color:lightsteelblue\"/>" <<
'\n'
2099 <<
" </linearGradient>" <<
'\n';
2105 out <<
"<!-- internal style sheet -->" <<
'\n'
2106 <<
"<style type=\"text/css\"><![CDATA[" <<
'\n';
2110 out <<
" rect.background{fill:url(#background_gradient)}" <<
'\n';
2112 out <<
" rect.background{fill:white}" <<
'\n';
2114 out <<
" rect.background{fill:none}" <<
'\n';
2117 out <<
" rect{fill:none; stroke:rgb(25,25,25); stroke-width:"
2119 <<
" text{font-family:Helvetica; text-anchor:middle; fill:rgb(25,25,25)}"
2121 <<
" line{stroke:rgb(25,25,25); stroke-width:"
2123 <<
" path{fill:none; stroke:rgb(25,25,25); stroke-width:"
2125 <<
" circle{fill:white; stroke:black; stroke-width:2}" <<
'\n'
2131 unsigned int labeling_index = 0;
2132 auto materials_it = materials.begin();
2133 auto levels_it = levels.begin();
2134 auto subdomains_it = subdomains.begin();
2135 auto level_subdomains_it = level_subdomains.begin();
2137 for (
unsigned int index = 0; index < n; ++index)
2142 h = .6 - (index / (n - 1.)) * .6;
2150 unsigned int i =
static_cast<unsigned int>(h * 6);
2152 double f = h * 6 - i;
2159 r = 255, g =
static_cast<unsigned int>(.5 + 255 * t);
2162 r =
static_cast<unsigned int>(.5 + 255 * q), g = 255;
2165 g = 255, b =
static_cast<unsigned int>(.5 + 255 * t);
2168 g =
static_cast<unsigned int>(.5 + 255 * q), b = 255;
2171 r =
static_cast<unsigned int>(.5 + 255 * t), b = 255;
2174 r = 255, b =
static_cast<unsigned int>(.5 + 255 * q);
2183 labeling_index = *materials_it++;
2186 labeling_index = *levels_it++;
2189 labeling_index = *subdomains_it++;
2192 labeling_index = *level_subdomains_it++;
2198 out <<
" path.p" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2199 <<
',' << b <<
"); "
2200 <<
"stroke:rgb(25,25,25); stroke-width:"
2203 out <<
" path.ps" << labeling_index <<
"{fill:rgb("
2204 <<
static_cast<unsigned int>(.5 + .75 * r) <<
','
2205 <<
static_cast<unsigned int>(.5 + .75 * g) <<
','
2206 <<
static_cast<unsigned int>(.5 + .75 * b) <<
"); "
2207 <<
"stroke:rgb(20,20,20); stroke-width:"
2210 out <<
" rect.r" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2211 <<
',' << b <<
"); "
2212 <<
"stroke:rgb(25,25,25); stroke-width:"
2219 out <<
"]]></style>" <<
'\n' <<
'\n';
2222 out <<
" <rect class=\"background\" width=\"" << width <<
"\" height=\""
2223 << height <<
"\"/>" <<
'\n';
2227 unsigned int x_offset = 0;
2230 x_offset =
static_cast<unsigned int>(.5 + (height / 100.) *
2231 (margin_in_percent / 2.));
2233 x_offset =
static_cast<unsigned int>(.5 + height * .025);
2236 <<
" <text x=\"" << x_offset <<
"\" y=\""
2237 <<
static_cast<unsigned int>(.5 + height * .0525) <<
'\"'
2238 <<
" style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:"
2239 <<
static_cast<unsigned int>(.5 + height * .045) <<
"px\">"
2241 <<
"</text>" <<
'\n';
2260 out <<
" <!-- cells -->" <<
'\n';
2262 for (
unsigned int level_index = min_level; level_index <= max_level;
2275 out <<
" class=\"p";
2277 if (!cell->is_active() &&
2284 out << cell->material_id();
2287 out << static_cast<unsigned int>(cell->level());
2290 if (cell->is_active())
2291 out << cell->subdomain_id() + 2;
2296 out << cell->level_subdomain_id() + 2;
2307 point[0] = cell->vertex(0)[0];
2308 point[1] = cell->vertex(0)[1];
2314 (
static_cast<float>(cell->level()) /
2315 static_cast<float>(n_levels)) *
2316 std::max(x_dimension, y_dimension);
2319 projection_decomposition = svg_project_point(point,
2325 out << static_cast<unsigned int>(
2327 ((projection_decomposition[0] - x_min_perspective) /
2328 x_dimension_perspective) *
2329 (width - (width / 100.) * 2. * margin_in_percent) +
2330 ((width / 100.) * margin_in_percent))
2332 <<
static_cast<unsigned int>(
2333 .5 + height - (height / 100.) * margin_in_percent -
2334 ((projection_decomposition[1] - y_min_perspective) /
2335 y_dimension_perspective) *
2336 (height - (height / 100.) * 2. * margin_in_percent));
2340 point[0] = cell->vertex(1)[0];
2341 point[1] = cell->vertex(1)[1];
2343 projection_decomposition = svg_project_point(point,
2349 out << static_cast<unsigned int>(
2351 ((projection_decomposition[0] - x_min_perspective) /
2352 x_dimension_perspective) *
2353 (width - (width / 100.) * 2. * margin_in_percent) +
2354 ((width / 100.) * margin_in_percent))
2356 <<
static_cast<unsigned int>(
2357 .5 + height - (height / 100.) * margin_in_percent -
2358 ((projection_decomposition[1] - y_min_perspective) /
2359 y_dimension_perspective) *
2360 (height - (height / 100.) * 2. * margin_in_percent));
2364 if (cell->n_vertices() == 4)
2366 point[0] = cell->vertex(3)[0];
2367 point[1] = cell->vertex(3)[1];
2369 projection_decomposition = svg_project_point(point,
2375 out << static_cast<unsigned int>(
2377 ((projection_decomposition[0] - x_min_perspective) /
2378 x_dimension_perspective) *
2379 (width - (width / 100.) * 2. * margin_in_percent) +
2380 ((width / 100.) * margin_in_percent))
2382 <<
static_cast<unsigned int>(
2383 .5 + height - (height / 100.) * margin_in_percent -
2384 ((projection_decomposition[1] - y_min_perspective) /
2385 y_dimension_perspective) *
2386 (height - (height / 100.) * 2. * margin_in_percent));
2391 point[0] = cell->vertex(2)[0];
2392 point[1] = cell->vertex(2)[1];
2394 projection_decomposition = svg_project_point(point,
2400 out << static_cast<unsigned int>(
2402 ((projection_decomposition[0] - x_min_perspective) /
2403 x_dimension_perspective) *
2404 (width - (width / 100.) * 2. * margin_in_percent) +
2405 ((width / 100.) * margin_in_percent))
2407 <<
static_cast<unsigned int>(
2408 .5 + height - (height / 100.) * margin_in_percent -
2409 ((projection_decomposition[1] - y_min_perspective) /
2410 y_dimension_perspective) *
2411 (height - (height / 100.) * 2. * margin_in_percent));
2415 point[0] = cell->vertex(0)[0];
2416 point[1] = cell->vertex(0)[1];
2418 projection_decomposition = svg_project_point(point,
2424 out << static_cast<unsigned int>(
2426 ((projection_decomposition[0] - x_min_perspective) /
2427 x_dimension_perspective) *
2428 (width - (width / 100.) * 2. * margin_in_percent) +
2429 ((width / 100.) * margin_in_percent))
2431 <<
static_cast<unsigned int>(
2432 .5 + height - (height / 100.) * margin_in_percent -
2433 ((projection_decomposition[1] - y_min_perspective) /
2434 y_dimension_perspective) *
2435 (height - (height / 100.) * 2. * margin_in_percent));
2437 out <<
"\"/>" <<
'\n';
2444 point[0] = cell->center()[0];
2445 point[1] = cell->center()[1];
2451 (
static_cast<float>(cell->level()) /
2452 static_cast<float>(n_levels)) *
2453 std::max(x_dimension, y_dimension);
2456 const double distance_to_camera =
2457 std::hypot(point[0] - camera_position[0],
2458 point[1] - camera_position[1],
2459 point[2] - camera_position[2]);
2460 const double distance_factor =
2461 distance_to_camera / (2. *
std::max(x_dimension, y_dimension));
2463 projection_decomposition = svg_project_point(point,
2469 const unsigned int font_size_this_cell =
2470 static_cast<unsigned int>(
2472 cell_label_font_size *
2473 std::pow(.5, cell->level() - 4. + 3.5 * distance_factor));
2477 <<
static_cast<unsigned int>(
2479 ((projection_decomposition[0] - x_min_perspective) /
2480 x_dimension_perspective) *
2481 (width - (width / 100.) * 2. * margin_in_percent) +
2482 ((width / 100.) * margin_in_percent))
2484 <<
static_cast<unsigned int>(
2485 .5 + height - (height / 100.) * margin_in_percent -
2486 ((projection_decomposition[1] - y_min_perspective) /
2487 y_dimension_perspective) *
2488 (height - (height / 100.) * 2. * margin_in_percent) +
2489 0.5 * font_size_this_cell)
2490 <<
"\" style=\"font-size:" << font_size_this_cell <<
"px\">";
2494 out << cell->level();
2501 out << cell->index();
2509 out << static_cast<std::make_signed_t<types::material_id>>(
2510 cell->material_id());
2518 if (cell->is_active())
2519 out <<
static_cast<std::make_signed_t<types::subdomain_id>
>(
2520 cell->subdomain_id());
2532 out << static_cast<std::make_signed_t<types::subdomain_id>>(
2533 cell->level_subdomain_id());
2536 out <<
"</text>" <<
'\n';
2543 for (
auto faceIndex : cell->face_indices())
2545 if (cell->at_boundary(faceIndex))
2547 point[0] = cell->face(faceIndex)->vertex(0)[0];
2548 point[1] = cell->face(faceIndex)->vertex(0)[1];
2554 (
static_cast<float>(cell->level()) /
2555 static_cast<float>(n_levels)) *
2556 std::max(x_dimension, y_dimension);
2559 projection_decomposition =
2560 svg_project_point(point,
2566 out <<
" <line x1=\""
2567 <<
static_cast<unsigned int>(
2569 ((projection_decomposition[0] -
2570 x_min_perspective) /
2571 x_dimension_perspective) *
2573 (width / 100.) * 2. * margin_in_percent) +
2574 ((width / 100.) * margin_in_percent))
2576 <<
static_cast<unsigned int>(
2578 (height / 100.) * margin_in_percent -
2579 ((projection_decomposition[1] -
2580 y_min_perspective) /
2581 y_dimension_perspective) *
2583 (height / 100.) * 2. * margin_in_percent));
2585 point[0] = cell->face(faceIndex)->vertex(1)[0];
2586 point[1] = cell->face(faceIndex)->vertex(1)[1];
2592 (
static_cast<float>(cell->level()) /
2593 static_cast<float>(n_levels)) *
2594 std::max(x_dimension, y_dimension);
2597 projection_decomposition =
2598 svg_project_point(point,
2605 <<
static_cast<unsigned int>(
2607 ((projection_decomposition[0] -
2608 x_min_perspective) /
2609 x_dimension_perspective) *
2611 (width / 100.) * 2. * margin_in_percent) +
2612 ((width / 100.) * margin_in_percent))
2614 <<
static_cast<unsigned int>(
2616 (height / 100.) * margin_in_percent -
2617 ((projection_decomposition[1] -
2618 y_min_perspective) /
2619 y_dimension_perspective) *
2621 (height / 100.) * 2. * margin_in_percent))
2627 const double distance_to_camera =
2628 std::hypot(point[0] - camera_position[0],
2629 point[1] - camera_position[1],
2630 point[2] - camera_position[2]);
2631 const double distance_factor =
2632 distance_to_camera /
2633 (2. *
std::max(x_dimension, y_dimension));
2635 const unsigned int font_size_this_edge =
2636 static_cast<unsigned int>(
2637 .5 + .5 * cell_label_font_size *
2639 cell->level() - 4. +
2640 3.5 * distance_factor));
2642 point[0] = cell->face(faceIndex)->center()[0];
2643 point[1] = cell->face(faceIndex)->center()[1];
2649 (
static_cast<float>(cell->level()) /
2650 static_cast<float>(n_levels)) *
2651 std::max(x_dimension, y_dimension);
2654 projection_decomposition =
2655 svg_project_point(point,
2661 const unsigned int xc =
static_cast<unsigned int>(
2663 ((projection_decomposition[0] - x_min_perspective) /
2664 x_dimension_perspective) *
2666 (width / 100.) * 2. * margin_in_percent) +
2667 ((width / 100.) * margin_in_percent));
2668 const unsigned int yc =
static_cast<unsigned int>(
2669 .5 + height - (height / 100.) * margin_in_percent -
2670 ((projection_decomposition[1] - y_min_perspective) /
2671 y_dimension_perspective) *
2673 (height / 100.) * 2. * margin_in_percent));
2675 out <<
" <circle cx=\"" << xc <<
"\" cy=\"" << yc
2676 <<
"\" r=\"" << font_size_this_edge <<
"\" />"
2679 out <<
" <text x=\"" << xc <<
"\" y=\"" << yc
2680 <<
"\" style=\"font-size:" << font_size_this_edge
2681 <<
"px\" dominant-baseline=\"middle\">"
2682 <<
static_cast<int>(
2683 cell->face(faceIndex)->boundary_id())
2684 <<
"</text>" <<
'\n';
2696 out <<
'\n' <<
" <!-- legend -->" <<
'\n';
2698 additional_width = 0;
2700 additional_width =
static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2708 unsigned int line_offset = 0;
2709 out <<
" <rect x=\"" << width + additional_width <<
"\" y=\""
2710 <<
static_cast<unsigned int>(.5 + (height / 100.) * margin_in_percent)
2712 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2713 (40. - margin_in_percent))
2714 <<
"\" height=\"" <<
static_cast<unsigned int>(.5 + height * .215)
2717 out <<
" <text x=\""
2718 << width + additional_width +
2719 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2721 <<
static_cast<unsigned int>(.5 +
2722 (height / 100.) * margin_in_percent +
2723 (++line_offset) * 1.5 * font_size)
2724 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2725 << font_size <<
"px\">"
2727 <<
"</text>" <<
'\n';
2731 out <<
" <text x=\""
2732 << width + additional_width +
2733 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2735 <<
static_cast<unsigned int>(.5 +
2736 (height / 100.) * margin_in_percent +
2737 (++line_offset) * 1.5 * font_size)
2738 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2739 << font_size <<
"px\">"
2747 out <<
"</text>" <<
'\n';
2752 out <<
" <text x=\""
2753 << width + additional_width +
2754 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2756 <<
static_cast<unsigned int>(.5 +
2757 (height / 100.) * margin_in_percent +
2758 (++line_offset) * 1.5 * font_size)
2759 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2760 << font_size <<
"px\">"
2767 out <<
"</text>" <<
'\n';
2772 out <<
" <text x=\""
2773 << width + additional_width +
2774 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2776 <<
static_cast<unsigned int>(.5 +
2777 (height / 100.) * margin_in_percent +
2778 (++line_offset) * 1.5 * font_size)
2779 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2780 << font_size <<
"px\">"
2787 out <<
"</text>" <<
'\n';
2792 out <<
" <text x= \""
2793 << width + additional_width +
2794 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2796 <<
static_cast<unsigned int>(.5 +
2797 (height / 100.) * margin_in_percent +
2798 (++line_offset) * 1.5 * font_size)
2799 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2800 << font_size <<
"px\">"
2806 out <<
"</text>" <<
'\n';
2811 out <<
" <text x= \""
2812 << width + additional_width +
2813 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2815 <<
static_cast<unsigned int>(.5 +
2816 (height / 100.) * margin_in_percent +
2817 (++line_offset) * 1.5 * font_size)
2818 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2819 << font_size <<
"px\">"
2820 <<
"level_subdomain_id"
2821 <<
"</text>" <<
'\n';
2826 out <<
" <text x=\""
2827 << width + additional_width +
2828 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2830 <<
static_cast<unsigned int>(.5 +
2831 (height / 100.) * margin_in_percent +
2832 (++line_offset) * 1.5 * font_size)
2833 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2834 << font_size <<
"px\">"
2836 <<
"</text>" <<
'\n';
2838 out <<
" <text x= \""
2839 << width + additional_width +
2840 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2842 <<
static_cast<unsigned int>(.5 +
2843 (height / 100.) * margin_in_percent +
2844 (++line_offset) * 1.5 * font_size)
2845 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2846 << font_size <<
"px\">"
2848 <<
"</text>" <<
'\n';
2856 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2857 <<
static_cast<unsigned int>(
2858 .5 + (height / 100.) * margin_in_percent + 13.75 * font_size)
2859 <<
"\" style=\"text-anchor:start; font-size:" << font_size <<
"px\">"
2868 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
2870 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2871 <<
static_cast<unsigned int>(
2872 .5 + (height / 100.) * (margin_in_percent + 29.) -
2874 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2875 << font_size <<
"px\">";
2880 out <<
"material_id";
2883 out <<
"level_number";
2886 out <<
"subdomain_id";
2889 out <<
"level_subdomain_id";
2895 out <<
"</text>" <<
'\n';
2897 unsigned int element_height =
static_cast<unsigned int>(
2898 ((height / 100.) * (71. - 2. * margin_in_percent)) / n);
2899 unsigned int element_width =
2900 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2902 int labeling_index = 0;
2903 auto materials_it = materials.begin();
2904 auto levels_it = levels.begin();
2905 auto subdomains_it = subdomains.begin();
2906 auto level_subdomains_it = level_subdomains.begin();
2908 for (
unsigned int index = 0; index < n; ++index)
2913 labeling_index = *materials_it++;
2916 labeling_index = *levels_it++;
2919 labeling_index = *subdomains_it++;
2922 labeling_index = *level_subdomains_it++;
2928 out <<
" <rect class=\"r" << labeling_index <<
"\" x=\""
2929 << width + additional_width <<
"\" y=\""
2930 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2931 (margin_in_percent + 29)) +
2932 (n - index - 1) * element_height
2933 <<
"\" width=\"" << element_width <<
"\" height=\""
2934 << element_height <<
"\"/>" <<
'\n';
2936 out <<
" <text x=\""
2937 << width + additional_width + 1.5 * element_width <<
"\" y=\""
2938 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2939 (margin_in_percent + 29)) +
2940 (n - index - 1 + .5) * element_height +
2941 static_cast<unsigned int>(.5 + font_size * .35)
2943 <<
" style=\"text-anchor:start; font-size:"
2944 <<
static_cast<unsigned int>(.5 + font_size) <<
"px";
2946 if (index == 0 || index == n - 1)
2947 out <<
"; font-weight:bold";
2949 out <<
"\">" << labeling_index;
2956 out <<
"</text>" <<
'\n';
2964 out <<
'\n' <<
"</svg>";
2980template <
int dim,
int spacedim>
2983 std::ostream &out)
const
2990 const std::time_t time1 = std::time(
nullptr);
2991 const std::tm *time = std::localtime(&time1);
2995 <<
"\n# This file was generated by the deal.II library."
2996 <<
"\n# Date = " << time->tm_year + 1900 <<
"/" << std::setfill(
'0')
2997 << std::setw(2) << time->tm_mon + 1 <<
"/" << std::setfill(
'0')
2998 << std::setw(2) << time->tm_mday <<
"\n# Time = " << std::setfill(
'0')
2999 << std::setw(2) << time->tm_hour <<
":" << std::setfill(
'0')
3000 << std::setw(2) << time->tm_min <<
":" << std::setfill(
'0')
3001 << std::setw(2) << time->tm_sec <<
"\n#"
3002 <<
"\n# For a description of the MathGL script format see the MathGL manual. "
3004 <<
"\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
3005 <<
"\n# be quickly viewed in a graphical environment using \'mglview\'. "
3011 const std::string axes =
"xyz";
3026 out <<
"\nsetsize 800 800";
3027 out <<
"\nrotate 0 0";
3030 out <<
"\nsetsize 800 800";
3031 out <<
"\nrotate 60 40";
3040 <<
"\n# Vertex ordering."
3041 <<
"\n# list <vertex order> <vertex indices>"
3050 out <<
"\nlist f 0 1 2 3" <<
'\n';
3054 <<
"\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"
3063 <<
"\n# List of vertices."
3064 <<
"\n# list <id> <vertices>"
3072 for (
unsigned int i = 0; i < dim; ++i)
3079 out <<
"\nlist " << axes[i] << cell->active_cell_index() <<
" ";
3081 out << cell->vertex(j)[i] <<
" ";
3088 <<
"\n# List of cells to quadplot."
3089 <<
"\n# quadplot <vertex order> <id> <style>"
3093 out <<
"\nquadplot f ";
3094 for (
unsigned int j = 0; j < dim; ++j)
3095 out << axes[j] << i <<
" ";
3120 template <
int dim,
int spacedim,
typename ITERATOR,
typename END>
3122 generate_triangulation_patches(
3128 for (; cell != end; ++cell)
3133 patch.
data.reinit(5, cell->n_vertices());
3137 patch.
vertices[v] = cell->vertex(v);
3138 patch.
data(0, v) = cell->level();
3140 static_cast<std::make_signed_t<types::manifold_id>
>(
3141 cell->manifold_id());
3143 static_cast<std::make_signed_t<types::material_id>
>(
3144 cell->material_id());
3145 if (cell->is_active())
3147 static_cast<std::make_signed_t<types::subdomain_id>
>(
3148 cell->subdomain_id());
3150 patch.
data(3, v) = -1;
3152 static_cast<std::make_signed_t<types::subdomain_id>
>(
3153 cell->level_subdomain_id());
3155 patches.push_back(patch);
3161 std::vector<std::string>
3162 triangulation_patch_data_names()
3164 std::vector<std::string> v(5);
3169 v[4] =
"level_subdomain";
3176 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3179 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3181 std::vector<bool> flags;
3185 for (
auto face : tria.active_face_iterators())
3186 for (const auto
l : face->line_indices())
3188 const auto line = face->line(l);
3189 if (line->user_flag_set() || line->has_children())
3192 line->set_user_flag();
3193 if (line->at_boundary())
3194 res.emplace_back(line);
3205 template <
int dim,
int spacedim>
3206 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3218 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3221 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3223 std::vector<bool> flags;
3227 for (
auto face : tria.active_face_iterators())
3228 for (const auto
l : face->line_indices())
3230 const auto line = face->line(l);
3231 if (line->user_flag_set() || line->has_children())
3234 line->set_user_flag();
3236 (line->boundary_id() != 0 &&
3238 res.emplace_back(line);
3248 template <
int dim,
int spacedim>
3249 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3260 template <
int dim,
int spacedim>
3261 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3264 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3268 for (
auto face : tria.active_face_iterators())
3271 res.push_back(face);
3282 template <
int dim,
int spacedim>
3283 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3286 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3290 for (
auto face : tria.active_face_iterators())
3293 (face->boundary_id() != 0 &&
3295 res.push_back(face);
3303template <
int dim,
int spacedim>
3306 std::ostream &out)
const
3313 const auto n_vertices =
vertices.size();
3315 out <<
"# vtk DataFile Version 3.0\n"
3316 <<
"Triangulation generated with deal.II\n"
3318 <<
"DATASET UNSTRUCTURED_GRID\n"
3319 <<
"POINTS " << n_vertices <<
" double\n";
3325 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
3331 get_relevant_face_iterators(tria) :
3332 get_boundary_face_iterators(tria);
3334 get_relevant_edge_iterators(tria) :
3335 get_boundary_edge_iterators(tria);
3341 "At least one of the flags (output_cells, output_faces, output_edges) has to be enabled!"));
3358 cells_size += cell->n_vertices() + 1;
3361 for (
const auto &face : faces)
3362 cells_size += face->n_vertices() + 1;
3365 for (
const auto &edge : edges)
3366 cells_size += edge->n_vertices() + 1;
3370 out <<
"\nCELLS " << n_cells <<
' ' << cells_size <<
'\n';
3385 static const std::array<int, 8> deal_to_vtk_cell_type = {
3386 {1, 3, 5, 9, 10, 14, 13, 12}};
3387 static const std::array<unsigned int, 8> vtk_to_deal_hypercube = {
3388 {0, 1, 3, 2, 4, 5, 7, 6}};
3394 out << cell->n_vertices();
3395 for (
const unsigned int i : cell->vertex_indices())
3398 const auto reference_cell = cell->reference_cell();
3404 out << cell->vertex_index(vtk_to_deal_hypercube[i]);
3408 out << cell->vertex_index(i);
3411 static const std::array<unsigned int, 5> permutation_table{
3413 out << cell->vertex_index(permutation_table[i]);
3421 for (
const auto &face : faces)
3423 out << face->n_vertices();
3424 for (
const unsigned int i : face->vertex_indices())
3428 face->n_vertices() ?
3429 vtk_to_deal_hypercube[i] :
3435 for (
const auto &edge : edges)
3438 for (
const unsigned int i : edge->vertex_indices())
3439 out <<
' ' << edge->vertex_index(i);
3444 out <<
"\nCELL_TYPES " << n_cells <<
'\n';
3448 out << deal_to_vtk_cell_type[
static_cast<int>(cell->reference_cell())]
3454 for (
const auto &face : faces)
3455 out << deal_to_vtk_cell_type[
static_cast<int>(face->reference_cell())]
3461 for (
const auto &edge : edges)
3462 out << deal_to_vtk_cell_type[
static_cast<int>(edge->reference_cell())]
3465 out <<
"\n\nCELL_DATA " << n_cells <<
'\n'
3466 <<
"SCALARS MaterialID int 1\n"
3467 <<
"LOOKUP_TABLE default\n";
3474 out << static_cast<std::make_signed_t<types::material_id>>(
3475 cell->material_id())
3482 for (
const auto &face : faces)
3484 out << static_cast<std::make_signed_t<types::boundary_id>>(
3485 face->boundary_id())
3492 for (
const auto &edge : edges)
3494 out << static_cast<std::make_signed_t<types::boundary_id>>(
3495 edge->boundary_id())
3500 out <<
"\n\nSCALARS ManifoldID int 1\n"
3501 <<
"LOOKUP_TABLE default\n";
3508 out << static_cast<std::make_signed_t<types::manifold_id>>(
3509 cell->manifold_id())
3516 for (
const auto &face : faces)
3518 out << static_cast<std::make_signed_t<types::manifold_id>>(
3519 face->manifold_id())
3526 for (
const auto &edge : edges)
3528 out << static_cast<std::make_signed_t<types::manifold_id>>(
3529 edge->manifold_id())
3542template <
int dim,
int spacedim>
3545 std::ostream &out)
const
3553 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3555 generate_triangulation_patches(patches, tria.
begin_active(), tria.
end());
3560 triangulation_patch_data_names(),
3562 std::tuple<
unsigned int,
3570 out <<
" </UnstructuredGrid>\n";
3571 out <<
"<dealiiData encoding=\"base64\">";
3572 std::stringstream outstring;
3573 boost::archive::binary_oarchive ia(outstring);
3577 out <<
"\n</dealiiData>\n";
3578 out <<
"</VTKFile>\n";
3589template <
int dim,
int spacedim>
3593 const std::string &filename_without_extension,
3594 const bool view_levels,
3595 const bool include_artificial)
const
3597 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3598 const unsigned int n_datasets = 4;
3599 std::vector<std::string> data_names;
3600 data_names.emplace_back(
"level");
3601 data_names.emplace_back(
"subdomain");
3602 data_names.emplace_back(
"level_subdomain");
3603 data_names.emplace_back(
"proc_writing");
3609 const auto &reference_cell = reference_cells[0];
3611 const unsigned int n_q_points = reference_cell.n_vertices();
3617 if (cell->has_children())
3619 if (!include_artificial &&
3623 else if (!include_artificial)
3625 if (cell->has_children() &&
3628 else if (cell->is_active() &&
3629 cell->level_subdomain_id() ==
3636 patch.
data.reinit(n_datasets, n_q_points);
3640 for (
unsigned int vertex = 0; vertex < n_q_points; ++vertex)
3642 patch.
vertices[vertex] = cell->vertex(vertex);
3643 patch.
data(0, vertex) = cell->level();
3644 if (cell->is_active())
3645 patch.
data(1, vertex) =
static_cast<double>(
3646 static_cast<std::make_signed_t<types::subdomain_id>
>(
3647 cell->subdomain_id()));
3649 patch.
data(1, vertex) = -1.0;
3650 patch.
data(2, vertex) =
static_cast<double>(
3651 static_cast<std::make_signed_t<types::subdomain_id>
>(
3652 cell->level_subdomain_id()));
3656 for (
auto f : reference_cell.face_indices())
3658 patches.push_back(patch);
3664 std::string new_file = filename_without_extension +
".vtu";
3668 new_file = filename_without_extension +
".proc" +
3673 if (tr->locally_owned_subdomain() == 0)
3675 std::vector<std::string> filenames;
3680 std::size_t pos = filename_without_extension.find_last_of(
'/');
3681 if (pos == std::string::npos)
3685 const unsigned int n_procs =
3687 for (
unsigned int i = 0; i < n_procs; ++i)
3688 filenames.push_back(filename_without_extension.substr(pos) +
3692 const std::string pvtu_filename =
3693 (filename_without_extension +
".pvtu");
3694 std::ofstream pvtu_output(pvtu_filename);
3713 std::ofstream out(new_file);
3715 std::tuple<
unsigned int,
3721 patches, data_names, vector_data_ranges,
vtu_flags, out);
3777template <
int dim,
int spacedim>
3782 unsigned int n_faces = 0;
3785 if ((face->at_boundary()) && (face->boundary_id() != 0))
3793template <
int dim,
int spacedim>
3800 std::vector<bool> line_flags;
3804 .clear_user_flags_line();
3806 unsigned int n_lines = 0;
3809 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3810 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3811 (cell->line(l)->user_flag_set() ==
false))
3814 cell->line(l)->set_user_flag();
3829 const unsigned int next_element_index,
3830 std::ostream &)
const
3832 return next_element_index;
3838 const unsigned int next_element_index,
3839 std::ostream &)
const
3841 return next_element_index;
3846 const unsigned int next_element_index,
3847 std::ostream &)
const
3849 return next_element_index;
3855 const unsigned int next_element_index,
3856 std::ostream &)
const
3858 return next_element_index;
3863 const unsigned int next_element_index,
3864 std::ostream &)
const
3866 return next_element_index;
3872 const unsigned int next_element_index,
3873 std::ostream &)
const
3875 return next_element_index;
3881 const unsigned int next_element_index,
3882 std::ostream &)
const
3884 return next_element_index;
3889 const unsigned int next_element_index,
3890 std::ostream &)
const
3892 return next_element_index;
3897template <
int dim,
int spacedim>
3900 const unsigned int next_element_index,
3901 std::ostream &out)
const
3903 unsigned int current_element_index = next_element_index;
3906 if (face->at_boundary() && (face->boundary_id() != 0))
3908 out << current_element_index <<
' '
3909 << face->reference_cell().gmsh_element_type() <<
' ';
3910 out << static_cast<unsigned int>(face->boundary_id()) <<
' '
3911 <<
static_cast<unsigned int>(face->boundary_id()) <<
' '
3912 << face->n_vertices();
3914 for (
const unsigned int vertex : face->vertex_indices())
3918 << face->vertex_index(
3923 out <<
' ' << face->vertex_index(vertex) + 1;
3929 ++current_element_index;
3931 return current_element_index;
3936template <
int dim,
int spacedim>
3939 const unsigned int next_element_index,
3940 std::ostream &out)
const
3942 unsigned int current_element_index = next_element_index;
3947 std::vector<bool> line_flags;
3951 .clear_user_flags_line();
3954 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3955 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3956 (cell->line(l)->user_flag_set() ==
false))
3958 out << next_element_index <<
' '
3960 out << static_cast<unsigned int>(cell->line(l)->boundary_id()) <<
' '
3961 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
3964 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
3966 << cell->line(l)->vertex_index(
3974 ++current_element_index;
3975 cell->line(l)->set_user_flag();
3983 return current_element_index;
3990 const unsigned int next_element_index,
3991 std::ostream &)
const
3993 return next_element_index;
3998 const unsigned int next_element_index,
3999 std::ostream &)
const
4001 return next_element_index;
4006 const unsigned int next_element_index,
4007 std::ostream &)
const
4009 return next_element_index;
4014 const unsigned int next_element_index,
4015 std::ostream &)
const
4017 return next_element_index;
4022 const unsigned int next_element_index,
4023 std::ostream &)
const
4025 return next_element_index;
4031 const unsigned int next_element_index,
4032 std::ostream &)
const
4034 return next_element_index;
4040 const unsigned int next_element_index,
4041 std::ostream &)
const
4043 return next_element_index;
4048 const unsigned int next_element_index,
4049 std::ostream &)
const
4051 return next_element_index;
4056template <
int dim,
int spacedim>
4059 const unsigned int next_element_index,
4060 std::ostream &out)
const
4062 unsigned int current_element_index = next_element_index;
4066 if (face->at_boundary() && (face->boundary_id() != 0))
4068 out << current_element_index <<
" "
4069 <<
static_cast<unsigned int>(face->boundary_id()) <<
" ";
4082 for (
unsigned int vertex = 0;
4083 vertex < GeometryInfo<dim>::vertices_per_face;
4085 out << face->vertex_index(
4091 ++current_element_index;
4093 return current_element_index;
4098template <
int dim,
int spacedim>
4101 const unsigned int next_element_index,
4102 std::ostream &out)
const
4104 unsigned int current_element_index = next_element_index;
4109 std::vector<bool> line_flags;
4113 .clear_user_flags_line();
4116 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
4117 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
4118 (cell->line(l)->user_flag_set() ==
false))
4120 out << current_element_index <<
" "
4121 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
4124 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
4125 out << cell->line(l)->vertex_index(
4134 ++current_element_index;
4135 cell->line(l)->set_user_flag();
4142 return current_element_index;
4159 template <
int spacedim>
4163 while (points.size() > 2)
4166 first_difference /= first_difference.
norm();
4168 second_difference /= second_difference.
norm();
4170 if ((first_difference - second_difference).norm() < 1e-10)
4171 points.erase(points.begin() + 1);
4179 template <
int spacedim>
4188 for (
const auto &cell : tria.active_cell_iterators())
4191 out <<
"# cell " << cell <<
'\n';
4193 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4194 << cell->material_id() <<
'\n'
4195 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4196 << cell->material_id() <<
'\n'
4209 template <
int spacedim>
4220 const unsigned int n_additional_points =
4222 const unsigned int n_points = 2 + n_additional_points;
4227 std::vector<
Point<dim - 1>> boundary_points;
4228 if (mapping !=
nullptr)
4230 boundary_points.resize(n_points);
4231 boundary_points[0][0] = 0;
4232 boundary_points[n_points - 1][0] = 1;
4233 for (
unsigned int i = 1; i < n_points - 1; ++i)
4234 boundary_points[i][0] = 1. * i / (n_points - 1);
4236 const std::vector<double> dummy_weights(n_points, 1. / n_points);
4237 const Quadrature<dim - 1> quadrature(boundary_points, dummy_weights);
4240 ReferenceCells::get_hypercube<dim>(), quadrature);
4243 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
4244 {0, 1, 5, 4, 2, 3, 7, 6}};
4245 for (
const auto &cell : tria.active_cell_iterators())
4248 out <<
"# cell " << cell <<
'\n';
4250 if (mapping ==
nullptr ||
4261 out << cell->vertex(dim == 3 ?
4262 local_vertex_numbering[i] :
4266 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4267 << cell->material_id() <<
'\n'
4275 for (
const unsigned int face_no :
4278 const typename ::Triangulation<dim,
4279 spacedim>::face_iterator
4280 face = cell->face(face_no);
4281 if (dim != spacedim || face->at_boundary() ||
4287 std::vector<Point<spacedim>> line_points;
4292 cell->reference_cell(),
4294 cell->combined_face_orientation(face_no),
4296 for (
unsigned int i = 0; i < n_points; ++i)
4297 line_points.push_back(
4299 cell, q_projector.
point(offset + i)));
4300 internal::remove_colinear_points(line_points);
4306 out <<
'\n' <<
'\n';
4312 out << face->vertex(0) <<
' ' << cell->level() <<
' '
4313 << cell->material_id() <<
'\n'
4314 << face->vertex(1) <<
' ' << cell->level() <<
' '
4315 << cell->material_id() <<
'\n'
4331 template <
int spacedim>
4342 const unsigned int n_additional_points =
4344 const unsigned int n_points = 2 + n_additional_points;
4348 std::unique_ptr<Quadrature<dim>> q_projector;
4349 std::vector<Point<1>> boundary_points;
4350 if (mapping !=
nullptr)
4352 boundary_points.resize(n_points);
4353 boundary_points[0][0] = 0;
4354 boundary_points[n_points - 1][0] = 1;
4355 for (
unsigned int i = 1; i < n_points - 1; ++i)
4356 boundary_points[i][0] = 1. * i / (n_points - 1);
4358 const std::vector<double> dummy_weights(n_points, 1. / n_points);
4359 const Quadrature<1> quadrature1d(boundary_points, dummy_weights);
4362 const QIterated<dim - 1> quadrature(quadrature1d, 1);
4363 q_projector = std::make_unique<Quadrature<dim>>(
4365 ReferenceCells::get_hypercube<dim>(), quadrature));
4368 for (
const auto &cell : tria.active_cell_iterators())
4371 out <<
"# cell " << cell <<
'\n';
4373 if (mapping ==
nullptr || n_points == 2 ||
4374 (!cell->has_boundary_lines() &&
4380 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4381 << cell->material_id() <<
'\n'
4382 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4383 << cell->material_id() <<
'\n'
4384 << cell->vertex(5) <<
' ' << cell->level() <<
' '
4385 << cell->material_id() <<
'\n'
4386 << cell->vertex(4) <<
' ' << cell->level() <<
' '
4387 << cell->material_id() <<
'\n'
4388 << cell->vertex(0) <<
' ' << cell->level() <<
' '
4389 << cell->material_id() <<
'\n'
4392 out << cell->vertex(2) <<
' ' << cell->level() <<
' '
4393 << cell->material_id() <<
'\n'
4394 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4395 << cell->material_id() <<
'\n'
4396 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4397 << cell->material_id() <<
'\n'
4398 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4399 << cell->material_id() <<
'\n'
4400 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4401 << cell->material_id() <<
'\n'
4405 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4406 << cell->material_id() <<
'\n'
4407 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4408 << cell->material_id() <<
'\n'
4410 out << cell->vertex(1) <<
' ' << cell->level() <<
' '
4411 << cell->material_id() <<
'\n'
4412 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4413 << cell->material_id() <<
'\n'
4415 out << cell->vertex(5) <<
' ' << cell->level() <<
' '
4416 << cell->material_id() <<
'\n'
4417 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4418 << cell->material_id() <<
'\n'
4420 out << cell->vertex(4) <<
' ' << cell->level() <<
' '
4421 << cell->material_id() <<
'\n'
4422 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4423 << cell->material_id() <<
'\n'
4429 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
4431 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4432 << cell->material_id() <<
'\n';
4436 for (
const unsigned int v : {3, 1})
4438 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4439 << cell->material_id() <<
'\n';
4450 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
4452 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4453 << cell->material_id() <<
'\n';
4457 for (
const unsigned int v : {1, 4})
4459 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4460 << cell->material_id() <<
'\n';
4464 for (
const unsigned int v : {2, 5})
4466 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4467 << cell->material_id() <<
'\n';
4474 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
4476 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4477 << cell->material_id() <<
'\n';
4481 for (
const unsigned int v : {2, 4, 3})
4483 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4484 << cell->material_id() <<
'\n';
4495 for (
const unsigned int face_no :
4498 const typename ::Triangulation<dim,
4499 spacedim>::face_iterator
4500 face = cell->face(face_no);
4502 if (face->at_boundary() &&
4507 cell->reference_cell(),
4509 cell->combined_face_orientation(face_no),
4510 n_points * n_points);
4511 for (
unsigned int i = 0; i < n_points - 1; ++i)
4512 for (
unsigned int j = 0; j < n_points - 1; ++j)
4517 q_projector->point(offset + i * n_points + j));
4518 out << p0 <<
' ' << cell->level() <<
' '
4519 << cell->material_id() <<
'\n';
4523 offset + (i + 1) * n_points + j)))
4524 <<
' ' << cell->level() <<
' '
4525 << cell->material_id() <<
'\n';
4529 offset + (i + 1) * n_points + j + 1)))
4530 <<
' ' << cell->level() <<
' '
4531 << cell->material_id() <<
'\n';
4534 q_projector->point(offset + i * n_points +
4536 <<
' ' << cell->level() <<
' '
4537 << cell->material_id() <<
'\n';
4539 out << p0 <<
' ' << cell->level() <<
' '
4540 << cell->material_id() <<
'\n';
4541 out <<
'\n' <<
'\n';
4546 for (
unsigned int l = 0;
4547 l < GeometryInfo<dim>::lines_per_face;
4550 const typename ::Triangulation<dim, spacedim>::
4551 line_iterator line = face->line(l);
4554 &
v1 = line->vertex(1);
4555 if (line->at_boundary() ||
4561 std::vector<Point<spacedim>> line_points;
4570 for (
unsigned int i = 0; i < n_points; ++i)
4571 line_points.push_back(
4574 (1 - boundary_points[i][0]) * u0 +
4575 boundary_points[i][0] * u1));
4576 internal::remove_colinear_points(line_points);
4579 << static_cast<unsigned
int>(
4584 out <<
v0 <<
' ' << cell->level() <<
' '
4585 << cell->material_id() <<
'\n'
4586 <<
v1 <<
' ' << cell->level() <<
' '
4587 << cell->material_id() <<
'\n';
4589 out <<
'\n' <<
'\n';
4606template <
int dim,
int spacedim>
4630 const unsigned int l)
4650 write_eps(const ::Triangulation<1, 2> &,
4660 write_eps(const ::Triangulation<1, 3> &,
4670 write_eps(const ::Triangulation<2, 3> &,
4681 template <
int dim,
int spacedim>
4683 write_eps(const ::Triangulation<dim, spacedim> &tria,
4689 using LineList = std::list<LineEntry>;
4701 static_cast<const
GridOutFlags::EpsFlagsBase &>(eps_flags_3);
4729 for (
const auto &cell : tria.active_cell_iterators())
4730 for (const unsigned
int line_no : cell->line_indices())
4732 typename ::Triangulation<dim, spacedim>::line_iterator
4733 line = cell->line(line_no);
4745 if (!line->has_children() &&
4746 (mapping ==
nullptr || !line->at_boundary()))
4766 line_list.emplace_back(
4767 Point<2>(line->vertex(0)[0], line->vertex(0)[1]),
4768 Point<2>(line->vertex(1)[0], line->vertex(1)[1]),
4769 line->user_flag_set(),
4779 if (mapping !=
nullptr)
4786 std::vector<
Point<dim - 1>> boundary_points(n_points);
4788 for (
unsigned int i = 0; i < n_points; ++i)
4789 boundary_points[i][0] = 1. * (i + 1) / (n_points + 1);
4791 const Quadrature<dim - 1> quadrature(boundary_points);
4794 ReferenceCells::get_hypercube<dim>(), quadrature));
4800 for (
const auto &cell : tria.active_cell_iterators())
4801 for (const unsigned
int face_no :
4804 const typename ::Triangulation<dim, spacedim>::
4805 face_iterator face = cell->face(face_no);
4807 if (face->at_boundary())
4819 cell->reference_cell(),
4821 cell->combined_face_orientation(face_no),
4823 for (
unsigned int i = 0; i < n_points; ++i)
4827 cell, q_projector.point(offset + i)));
4828 const Point<2> p1(p1_dim[0], p1_dim[1]);
4830 line_list.emplace_back(p0,
4832 face->user_flag_set(),
4839 const Point<2> p1(p1_dim[0], p1_dim[1]);
4840 line_list.emplace_back(p0,
4842 face->user_flag_set(),
4876 const double z_angle = eps_flags_3.azimut_angle;
4877 const double turn_angle = eps_flags_3.turn_angle;
4879 -
std::sin(z_angle * 2. * pi / 360.) *
4880 std::sin(turn_angle * 2. * pi / 360.),
4881 +
std::sin(z_angle * 2. * pi / 360.) *
4882 std::cos(turn_angle * 2. * pi / 360.),
4883 -
std::cos(z_angle * 2. * pi / 360.));
4891 ((
Point<dim>(0, 0, 1) * view_direction) * view_direction);
4900 ((
Point<dim>(1, 0, 0) * view_direction) * view_direction) -
4901 ((
Point<dim>(1, 0, 0) * unit_vector1) * unit_vector1));
4905 for (
const auto &cell : tria.active_cell_iterators())
4906 for (const unsigned
int line_no : cell->line_indices())
4908 typename ::Triangulation<dim, spacedim>::line_iterator
4909 line = cell->line(line_no);
4910 line_list.emplace_back(
4911 Point<2>(line->vertex(0) * unit_vector2,
4912 line->vertex(0) * unit_vector1),
4913 Point<2>(line->vertex(1) * unit_vector2,
4914 line->vertex(1) * unit_vector1),
4915 line->user_flag_set(),
4931 double x_min = tria.begin_active()->vertex(0)[0];
4932 double x_max = x_min;
4933 double y_min = tria.begin_active()->vertex(0)[1];
4934 double y_max = y_min;
4935 unsigned int max_level = line_list.begin()->level;
4937 for (LineList::const_iterator line = line_list.begin();
4938 line != line_list.end();
4941 x_min =
std::min(x_min, line->first[0]);
4942 x_min =
std::min(x_min, line->second[0]);
4944 x_max =
std::max(x_max, line->first[0]);
4945 x_max =
std::max(x_max, line->second[0]);
4947 y_min =
std::min(y_min, line->first[1]);
4948 y_min =
std::min(y_min, line->second[1]);
4950 y_max =
std::max(y_max, line->first[1]);
4951 y_max =
std::max(y_max, line->second[1]);
4953 max_level =
std::max(max_level, line->level);
4961 const double scale =
4962 (eps_flags_base.
size /
4973 std::time_t time1 = std::time(
nullptr);
4974 std::tm *time = std::localtime(&time1);
4975 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4976 <<
"%%Title: deal.II Output" <<
'\n'
4977 <<
"%%Creator: the deal.II library" <<
'\n'
4978 <<
"%%Creation Date: " << time->tm_year + 1900 <<
"/"
4979 << time->tm_mon + 1 <<
"/" << time->tm_mday <<
" - "
4980 << time->tm_hour <<
":" << std::setw(2) << time->tm_min <<
":"
4981 << std::setw(2) << time->tm_sec <<
'\n'
4982 <<
"%%BoundingBox: "
4986 <<
static_cast<unsigned int>(
4987 std::floor(((x_max - x_min) * scale) + 1))
4989 <<
static_cast<unsigned int>(
4990 std::floor(((y_max - y_min) * scale) + 1))
4999 out <<
"/m {moveto} bind def" <<
'\n'
5000 <<
"/x {lineto stroke} bind def" <<
'\n'
5001 <<
"/b {0 0 0 setrgbcolor} def" <<
'\n'
5002 <<
"/r {1 0 0 setrgbcolor} def" <<
'\n';
5009 out <<
"/l { neg " << (max_level) <<
" add "
5010 << (0.66666 /
std::max(1U, (max_level - 1)))
5011 <<
" mul 1 0.8 sethsbcolor} def" <<
'\n';
5021 if ((dim == 2) && (eps_flags_2.write_cell_numbers ||
5022 eps_flags_2.write_vertex_numbers))
5025 << (
"/R {rmoveto} bind def\n"
5026 "/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n"
5027 "dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n"
5028 "currentdict end definefont\n"
5029 "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5030 "[ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n"
5031 "{show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n"
5032 "{2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n"
5033 "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5034 "5 get stringwidth pop add}\n"
5035 "{pop} ifelse} forall} bind def\n"
5036 "/MCshow { currentpoint stroke m\n"
5037 "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
5041 out <<
"%%EndProlog" <<
'\n' <<
'\n';
5044 out << eps_flags_base.
line_width <<
" setlinewidth" <<
'\n';
5048 const Point<2> offset(x_min, y_min);
5050 for (LineList::const_iterator line = line_list.begin();
5051 line != line_list.end();
5054 out << line->level <<
" l " << (line->first - offset) *
scale <<
" m "
5055 << (line->second - offset) * scale <<
" x" <<
'\n';
5061 << (line->
second - offset) *
scale <<
" x" <<
'\n';
5065 if ((dim == 2) && (eps_flags_2.write_cell_numbers ==
true))
5067 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5069 for (
const auto &cell : tria.active_cell_iterators())
5071 out << (cell->center()[0] - offset[0]) * scale <<
' '
5072 << (cell->center()[1] - offset[1]) * scale <<
" m" <<
'\n'
5073 <<
"[ [(Helvetica) 12.0 0.0 true true (";
5074 if (eps_flags_2.write_cell_number_level)
5077 out << cell->index();
5080 <<
"] -6 MCshow" <<
'\n';
5085 if ((dim == 2) && (eps_flags_2.write_vertex_numbers ==
true))
5087 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5093 std::set<unsigned int> treated_vertices;
5094 for (
const auto &cell : tria.active_cell_iterators())
5096 if (treated_vertices.find(cell->vertex_index(vertex_no)) ==
5097 treated_vertices.
end())
5099 treated_vertices.insert(cell->vertex_index(vertex_no));
5101 out << (cell->vertex(vertex_no)[0] - offset[0]) * scale <<
' '
5102 << (cell->vertex(vertex_no)[1] - offset[1]) * scale
5104 <<
"[ [(Helvetica) 10.0 0.0 true true ("
5105 << cell->vertex_index(vertex_no) <<
")] "
5106 <<
"] -6 MCshow" <<
'\n';
5110 out <<
"showpage" <<
'\n';
5122template <
int dim,
int spacedim>
5132template <
int dim,
int spacedim>
5139 switch (output_format)
5189template <
int dim,
int spacedim>
5200#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
Abstract base class for mapping classes.
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const =0
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const =0
void enter_subsection(const std::string &subsection, const bool create_path_if_needed=true)
long int get_integer(const std::string &entry_string) const
bool get_bool(const std::string &entry_name) const
void declare_entry(const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation="", const bool has_to_be_set=false)
std::string get(const std::string &entry_string) const
double get_double(const std::string &entry_name) const
static DataSetDescriptor face(const ReferenceCell &reference_cell, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points)
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
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
const std::vector< Point< spacedim > > & get_vertices() const
unsigned int n_used_vertices() const
const std::vector< ReferenceCell > & get_reference_cells() const
cell_iterator end() const
const std::vector< bool > & get_used_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_face_iterator > active_face_iterators() const
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators() const
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInvalidState()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
DataComponentInterpretation
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_header(std::ostream &out, const VtkFlags &flags)
void write_vtu(const std::vector< Patch< dim, spacedim > > &patches, const std::vector< std::string > &data_names, const std::vector< std::tuple< unsigned int, unsigned int, std::string, DataComponentInterpretation::DataComponentInterpretation > > &nonscalar_data_ranges, const VtkFlags &flags, std::ostream &out)
void write_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_vtu_footer(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)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
constexpr const ReferenceCell Tetrahedron
constexpr const ReferenceCell Quadrilateral
constexpr const ReferenceCell Wedge
constexpr const ReferenceCell Pyramid
constexpr const ReferenceCell 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)
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
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
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 std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices()
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > vertex_indices()
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)
void parse_parameters(ParameterHandler ¶m)
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