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)
59 : write_cells(write_cells)
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)
189 : size_type(size_type)
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)
369 , color_by(material_id)
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)
467 : default_format(none)
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";
780template <
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<types::boundary_id>::type
>(
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';
973 out <<
"object \"deal data\" class field" <<
'\n'
974 <<
"component \"positions\" value \"vertices\"" <<
'\n'
975 <<
"component \"connections\" value \"cells\"" <<
'\n';
979 out <<
"object \"cell data\" class field" <<
'\n'
980 <<
"component \"positions\" value \"vertices\"" <<
'\n'
981 <<
"component \"connections\" value \"cells\"" <<
'\n';
982 out <<
"component \"material\" value \"material\"" <<
'\n';
983 out <<
"component \"level\" value \"level\"" <<
'\n';
985 out <<
"component \"measure\" value \"measure\"" <<
'\n';
987 out <<
"component \"diameter\" value \"diameter\"" <<
'\n';
992 out <<
"object \"face data\" class field" <<
'\n'
993 <<
"component \"positions\" value \"vertices\"" <<
'\n'
994 <<
"component \"connections\" value \"faces\"" <<
'\n';
995 out <<
"component \"boundary\" value \"boundary\"" <<
'\n';
997 out <<
"component \"measure\" value \"face measure\"" <<
'\n';
999 out <<
"component \"diameter\" value \"face diameter\"" <<
'\n';
1002 out <<
'\n' <<
"object \"grid data\" class group" <<
'\n';
1004 out <<
"member \"cells\" value \"cell data\"" <<
'\n';
1006 out <<
"member \"faces\" value \"face data\"" <<
'\n';
1007 out <<
"end" <<
'\n';
1018template <
int dim,
int spacedim>
1021 std::ostream & out)
const
1049 out <<
"@f$NOD" <<
'\n' << n_vertices <<
'\n';
1054 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1059 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1065 out <<
"@f$ENDNOD" <<
'\n'
1072 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
1073 {0, 1, 5, 4, 2, 3, 7, 6}};
1079 out << cell->active_cell_index() + 1 <<
' '
1080 << cell->reference_cell().gmsh_element_type() <<
' '
1081 << cell->material_id() <<
' ' << cell->subdomain_id() <<
' '
1082 << cell->n_vertices() <<
' ';
1086 for (
const unsigned int vertex : cell->vertex_indices())
1088 if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
1089 out << cell->vertex_index(
1090 dim == 3 ? local_vertex_numbering[vertex] :
1094 else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
1095 out << cell->vertex_index(vertex) + 1 <<
' ';
1113 out <<
"@f$ENDELM\n";
1123template <
int dim,
int spacedim>
1126 std::ostream & out)
const
1144 std::time_t time1 = std::time(
nullptr);
1145 std::tm * time = std::localtime(&time1);
1147 <<
"# This file was generated by the deal.II library." <<
'\n'
1148 <<
"# Date = " << time->tm_year + 1900 <<
"/" << time->tm_mon + 1
1149 <<
"/" << time->tm_mday <<
'\n'
1150 <<
"# Time = " << time->tm_hour <<
":" << std::setw(2) << time->tm_min
1151 <<
":" << std::setw(2) << time->tm_sec <<
'\n'
1153 <<
"# For a description of the UCD format see the AVS Developer's guide."
1159 out << n_vertices <<
' '
1169 for (
unsigned int i = 0; i <
vertices.size(); ++i)
1174 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1183 out << cell->active_cell_index() + 1 <<
' ' << cell->material_id() <<
' ';
1240template <
int dim,
int spacedim>
1258 const int spacedim = 2;
1264 out <<
"#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
1265 <<
"A4\n100.00\nSingle"
1268 <<
"-3" << std::endl
1269 <<
"# generated by deal.II GridOut class" << std::endl
1270 <<
"# reduce first number to scale up image" << std::endl
1271 <<
"1200 2" << std::endl;
1274 unsigned int colno = 32;
1275 out <<
"0 " << colno++ <<
" #ff0000" << std::endl;
1276 out <<
"0 " << colno++ <<
" #ff8000" << std::endl;
1277 out <<
"0 " << colno++ <<
" #ffd000" << std::endl;
1278 out <<
"0 " << colno++ <<
" #ffff00" << std::endl;
1279 out <<
"0 " << colno++ <<
" #c0ff00" << std::endl;
1280 out <<
"0 " << colno++ <<
" #80ff00" << std::endl;
1281 out <<
"0 " << colno++ <<
" #00f000" << std::endl;
1282 out <<
"0 " << colno++ <<
" #00f0c0" << std::endl;
1283 out <<
"0 " << colno++ <<
" #00f0ff" << std::endl;
1284 out <<
"0 " << colno++ <<
" #00c0ff" << std::endl;
1285 out <<
"0 " << colno++ <<
" #0080ff" << std::endl;
1286 out <<
"0 " << colno++ <<
" #0040ff" << std::endl;
1287 out <<
"0 " << colno++ <<
" #0000c0" << std::endl;
1288 out <<
"0 " << colno++ <<
" #5000ff" << std::endl;
1289 out <<
"0 " << colno++ <<
" #8000ff" << std::endl;
1290 out <<
"0 " << colno++ <<
" #b000ff" << std::endl;
1291 out <<
"0 " << colno++ <<
" #ff00ff" << std::endl;
1292 out <<
"0 " << colno++ <<
" #ff80ff" << std::endl;
1294 for (
unsigned int i = 0; i < 8; ++i)
1295 out <<
"0 " << colno++ <<
" #" << std::hex << 32 * i + 31 << 32 * i + 31
1296 << 32 * i + 31 << std::dec << std::endl;
1298 for (
unsigned int i = 1; i < 16; ++i)
1299 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << std::dec
1300 <<
"00" << std::endl;
1302 for (
unsigned int i = 1; i < 16; ++i)
1303 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << 16 * i + 15
1304 << std::dec <<
"00" << std::endl;
1306 for (
unsigned int i = 1; i < 16; ++i)
1307 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 << std::dec
1308 <<
"0000" << std::endl;
1310 for (
unsigned int i = 1; i < 16; ++i)
1311 out <<
"0 " << colno++ <<
" #" << std::hex << 16 * i + 15 <<
"00"
1312 << 16 * i + 15 << std::dec << std::endl;
1314 for (
unsigned int i = 1; i < 16; ++i)
1315 out <<
"0 " << colno++ <<
" #0000" << std::hex << 16 * i + 15 << std::dec
1318 for (
unsigned int i = 1; i < 16; ++i)
1319 out <<
"0 " << colno++ <<
" #00" << std::hex << 16 * i + 15 << 16 * i + 15
1320 << std::dec << std::endl;
1342 out << cell->material_id() + 32;
1345 out << cell->level() + 8;
1348 out << cell->subdomain_id() + 32;
1351 out << cell->level_subdomain_id() + 32;
1360 (900 + cell->material_id()))
1366 << nv + 1 << std::endl;
1372 for (
unsigned int k = 0; k <= nv; ++k)
1376 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim); ++d)
1380 out <<
'\t' << ((d == 0) ? val : -val);
1385 static const unsigned int face_reorder[4] = {2, 1, 3, 0};
1387 for (
const unsigned int f : face_reorder)
1415 for (
unsigned int k = 0;
1416 k < GeometryInfo<dim>::vertices_per_face;
1420 for (
unsigned int d = 0; d < static_cast<unsigned int>(dim);
1426 out <<
'\t' << ((d == 0) ? val : -val);
1443#ifdef DEAL_II_GMSH_WITH_API
1444template <
int dim,
int spacedim>
1447 const std::string & filename)
const
1450 const std::array<int, 8> dealii_to_gmsh_type = {{15, 1, 2, 3, 4, 7, 6, 5}};
1453 const std::array<std::vector<unsigned int>, 8> dealii_to_gmsh = {
1460 {{0, 1, 2, 3, 4, 5}},
1461 {{0, 1, 3, 2, 4, 5, 7, 6}}}};
1466 std::vector<double> coords(3 *
vertices.size());
1467 std::vector<std::size_t> nodes(
vertices.size());
1473 for (
unsigned int d = 0; d < spacedim; ++d)
1474 coords[i * 3 + d] = p[d];
1486 using IdPair = std::pair<types::material_id, types::manifold_id>;
1487 std::map<IdPair, int> id_pair_to_entity_tag;
1488 std::vector<IdPair> all_pairs;
1490 std::set<IdPair> set_of_pairs;
1493 set_of_pairs.insert({cell->material_id(), cell->manifold_id()});
1494 for (
const auto &f : cell->face_iterators())
1496 (f->boundary_id() != 0 &&
1498 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1500 for (
const auto l : cell->line_indices())
1502 const auto &f = cell->line(l);
1504 (f->boundary_id() != 0 &&
1506 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1509 all_pairs = {set_of_pairs.begin(), set_of_pairs.end()};
1512 for (
const auto &p : set_of_pairs)
1513 id_pair_to_entity_tag[p] = entity++;
1516 const auto n_entity_tags = id_pair_to_entity_tag.size();
1519 std::vector<std::vector<std::vector<std::size_t>>> element_ids(
1520 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1521 std::vector<std::vector<std::vector<std::size_t>>> element_nodes(
1522 n_entity_tags, std::vector<std::vector<std::size_t>>(8));
1525 std::size_t element_id = 1;
1527 const auto add_element = [&](
const auto &element,
const int &entity_tag) {
1528 const auto type = element->reference_cell();
1533 for (
const auto v : element->vertex_indices())
1534 element_nodes[entity_tag - 1][type].emplace_back(
1535 element->vertex_index(dealii_to_gmsh[type][v]) + 1);
1538 element_ids[entity_tag - 1][type].emplace_back(element_id);
1546 std::set<std::pair<int, int>> dim_entity_tag;
1548 auto maybe_add_element =
1549 [&](
const auto & element,
1551 const auto struct_dim = element->structure_dimension;
1552 const auto manifold_id = element->manifold_id();
1555 const bool non_default_boundary_or_material_id =
1556 (boundary_or_material_id != 0 &&
1558 const bool non_default_manifold =
1560 if (struct_dim == dim || non_default_boundary_or_material_id ||
1561 non_default_manifold)
1563 const auto entity_tag =
1564 id_pair_to_entity_tag[{boundary_or_material_id, manifold_id}];
1565 add_element(element, entity_tag);
1566 dim_entity_tag.insert({struct_dim, entity_tag});
1573 maybe_add_element(cell, cell->material_id());
1574 for (
const auto &face : cell->face_iterators())
1575 maybe_add_element(face, face->boundary_id());
1577 for (
const auto l : cell->line_indices())
1578 maybe_add_element(cell->line(l), cell->line(l)->boundary_id());
1583 gmsh::option::setNumber(
"General.Verbosity", 0);
1584 gmsh::model::add(
"Grid generated in deal.II");
1585 for (
const auto &p : dim_entity_tag)
1587 gmsh::model::addDiscreteEntity(p.first, p.second);
1588 gmsh::model::mesh::addNodes(p.first, p.second, nodes, coords);
1591 for (
unsigned int entity_tag = 0; entity_tag < n_entity_tags; ++entity_tag)
1592 for (
unsigned int t = 1; t < 8; ++t)
1594 const auto all_element_ids = element_ids[entity_tag][t];
1595 const auto all_element_nodes = element_nodes[entity_tag][t];
1596 const auto gmsh_t = dealii_to_gmsh_type[t];
1597 if (all_element_ids.size() > 0)
1598 gmsh::model::mesh::addElementsByType(entity_tag + 1,
1606 for (
const auto &it : dim_entity_tag)
1608 const auto &d = it.first;
1609 const auto &entity_tag = it.second;
1610 const auto &boundary_id = all_pairs[entity_tag - 1].first;
1611 const auto &manifold_id = all_pairs[entity_tag - 1].second;
1613 std::string physical_name;
1614 if (d == dim && boundary_id != 0)
1616 static_cast<int>(boundary_id));
1617 else if (d < dim && boundary_id != 0)
1624 std::string sep = physical_name !=
"" ?
", " :
"";
1627 sep +
"ManifoldID:" +
1629 const auto physical_tag =
1630 gmsh::model::addPhysicalGroup(d, {entity_tag}, -1);
1631 if (physical_name !=
"")
1632 gmsh::model::setPhysicalName(d, physical_tag, physical_name);
1636 gmsh::write(filename);
1657 svg_project_point(
const Point<3> & point,
1661 const float camera_focus)
1664 cross_product_3d(camera_horizontal, camera_direction);
1667 camera_focus / ((point - camera_position) * camera_direction);
1670 camera_position + phi * (point - camera_position);
1672 return {(projection - camera_position - camera_focus * camera_direction) *
1674 (projection - camera_position - camera_focus * camera_direction) *
1681template <
int dim,
int spacedim>
1684 std::ostream & )
const
1687 ExcMessage(
"Mesh output in SVG format is not implemented for anything "
1688 "other than two-dimensional meshes in two-dimensional "
1689 "space. That's because three-dimensional meshes are best "
1690 "viewed in programs that allow changing the viewpoint, "
1691 "but SVG format does not allow this: It is an inherently "
1692 "2d format, and for three-dimensional meshes would "
1693 "require choosing one, fixed viewpoint."
1695 "You probably want to output your mesh in a format such "
1696 "as VTK, VTU, or gnuplot."));
1705 unsigned int min_level, max_level;
1713 Assert(height != 0 || width != 0,
1714 ExcMessage(
"You have to set at least one of width and height"));
1716 unsigned int margin_in_percent = 0;
1718 margin_in_percent = 8;
1721 unsigned int cell_label_font_size;
1734 float x_max_perspective, x_min_perspective;
1735 float y_max_perspective, y_min_perspective;
1737 float x_dimension_perspective, y_dimension_perspective;
1741 double x_min =
tria.
begin()->vertex(0)[0];
1742 double x_max = x_min;
1743 double y_min =
tria.
begin()->vertex(0)[1];
1744 double y_max = y_min;
1746 double x_dimension, y_dimension;
1748 min_level = max_level =
tria.
begin()->level();
1751 std::set<unsigned int> materials;
1754 std::set<unsigned int> levels;
1757 std::set<unsigned int> subdomains;
1760 std::set<int> level_subdomains;
1768 for (
unsigned int vertex_index = 0; vertex_index < cell->n_vertices();
1771 if (cell->vertex(vertex_index)[0] < x_min)
1772 x_min = cell->vertex(vertex_index)[0];
1773 if (cell->vertex(vertex_index)[0] > x_max)
1774 x_max = cell->vertex(vertex_index)[0];
1776 if (cell->vertex(vertex_index)[1] < y_min)
1777 y_min = cell->vertex(vertex_index)[1];
1778 if (cell->vertex(vertex_index)[1] > y_max)
1779 y_max = cell->vertex(vertex_index)[1];
1782 if (
static_cast<unsigned int>(cell->level()) < min_level)
1783 min_level = cell->level();
1784 if (
static_cast<unsigned int>(cell->level()) > max_level)
1785 max_level = cell->level();
1787 materials.insert(cell->material_id());
1788 levels.insert(cell->level());
1789 if (cell->is_active())
1790 subdomains.insert(cell->subdomain_id() + 2);
1791 level_subdomains.insert(cell->level_subdomain_id() + 2);
1794 x_dimension = x_max - x_min;
1795 y_dimension = y_max - y_min;
1798 const unsigned int n_materials = materials.size();
1801 const unsigned int n_levels = levels.size();
1804 const unsigned int n_subdomains = subdomains.size();
1807 const unsigned int n_level_subdomains = level_subdomains.size();
1821 n = n_level_subdomains;
1830 camera_position[0] = 0;
1831 camera_position[1] = 0;
1832 camera_position[2] = 2. *
std::max(x_dimension, y_dimension);
1835 camera_direction[0] = 0;
1836 camera_direction[1] = 0;
1837 camera_direction[2] = -1;
1840 camera_horizontal[0] = 1;
1841 camera_horizontal[1] = 0;
1842 camera_horizontal[2] = 0;
1844 camera_focus = .5 *
std::max(x_dimension, y_dimension);
1850 const double angle_factor = 3.14159265 / 180.;
1853 camera_position_temp[1] =
1856 camera_position_temp[2] =
1860 camera_direction_temp[1] =
1863 camera_direction_temp[2] =
1867 camera_horizontal_temp[1] =
1870 camera_horizontal_temp[2] =
1874 camera_position[1] = camera_position_temp[1];
1875 camera_position[2] = camera_position_temp[2];
1877 camera_direction[1] = camera_direction_temp[1];
1878 camera_direction[2] = camera_direction_temp[2];
1880 camera_horizontal[1] = camera_horizontal_temp[1];
1881 camera_horizontal[2] = camera_horizontal_temp[2];
1884 camera_position_temp[0] =
1887 camera_position_temp[1] =
1891 camera_direction_temp[0] =
1894 camera_direction_temp[1] =
1898 camera_horizontal_temp[0] =
1901 camera_horizontal_temp[1] =
1905 camera_position[0] = camera_position_temp[0];
1906 camera_position[1] = camera_position_temp[1];
1908 camera_direction[0] = camera_direction_temp[0];
1909 camera_direction[1] = camera_direction_temp[1];
1911 camera_horizontal[0] = camera_horizontal_temp[0];
1912 camera_horizontal[1] = camera_horizontal_temp[1];
1915 camera_position[0] = x_min + .5 * x_dimension;
1916 camera_position[1] = y_min + .5 * y_dimension;
1918 camera_position[0] += 2. *
std::max(x_dimension, y_dimension) *
1921 camera_position[1] -= 2. *
std::max(x_dimension, y_dimension) *
1932 float min_level_min_vertex_distance = 0;
1937 (
static_cast<float>(
tria.
begin()->level()) /
1938 static_cast<float>(n_levels)) *
1939 std::max(x_dimension, y_dimension);
1942 projection_decomposition = svg_project_point(
1943 point, camera_position, camera_direction, camera_horizontal, camera_focus);
1945 x_max_perspective = projection_decomposition[0];
1946 x_min_perspective = projection_decomposition[0];
1948 y_max_perspective = projection_decomposition[1];
1949 y_min_perspective = projection_decomposition[1];
1953 point[0] = cell->vertex(0)[0];
1954 point[1] = cell->vertex(0)[1];
1961 (
static_cast<float>(cell->level()) /
static_cast<float>(n_levels)) *
1962 std::max(x_dimension, y_dimension);
1965 projection_decomposition = svg_project_point(point,
1971 if (x_max_perspective < projection_decomposition[0])
1972 x_max_perspective = projection_decomposition[0];
1973 if (x_min_perspective > projection_decomposition[0])
1974 x_min_perspective = projection_decomposition[0];
1976 if (y_max_perspective < projection_decomposition[1])
1977 y_max_perspective = projection_decomposition[1];
1978 if (y_min_perspective > projection_decomposition[1])
1979 y_min_perspective = projection_decomposition[1];
1981 point[0] = cell->vertex(1)[0];
1982 point[1] = cell->vertex(1)[1];
1984 projection_decomposition = svg_project_point(point,
1990 if (x_max_perspective < projection_decomposition[0])
1991 x_max_perspective = projection_decomposition[0];
1992 if (x_min_perspective > projection_decomposition[0])
1993 x_min_perspective = projection_decomposition[0];
1995 if (y_max_perspective < projection_decomposition[1])
1996 y_max_perspective = projection_decomposition[1];
1997 if (y_min_perspective > projection_decomposition[1])
1998 y_min_perspective = projection_decomposition[1];
2000 point[0] = cell->vertex(2)[0];
2001 point[1] = cell->vertex(2)[1];
2003 projection_decomposition = svg_project_point(point,
2009 if (x_max_perspective < projection_decomposition[0])
2010 x_max_perspective = projection_decomposition[0];
2011 if (x_min_perspective > projection_decomposition[0])
2012 x_min_perspective = projection_decomposition[0];
2014 if (y_max_perspective < projection_decomposition[1])
2015 y_max_perspective = projection_decomposition[1];
2016 if (y_min_perspective > projection_decomposition[1])
2017 y_min_perspective = projection_decomposition[1];
2019 if (cell->n_vertices() == 4)
2021 point[0] = cell->vertex(3)[0];
2022 point[1] = cell->vertex(3)[1];
2024 projection_decomposition = svg_project_point(point,
2030 if (x_max_perspective < projection_decomposition[0])
2031 x_max_perspective = projection_decomposition[0];
2032 if (x_min_perspective > projection_decomposition[0])
2033 x_min_perspective = projection_decomposition[0];
2035 if (y_max_perspective < projection_decomposition[1])
2036 y_max_perspective = projection_decomposition[1];
2037 if (y_min_perspective > projection_decomposition[1])
2038 y_min_perspective = projection_decomposition[1];
2041 if (
static_cast<unsigned int>(cell->level()) == min_level)
2042 min_level_min_vertex_distance = cell->minimum_vertex_distance();
2045 x_dimension_perspective = x_max_perspective - x_min_perspective;
2046 y_dimension_perspective = y_max_perspective - y_min_perspective;
2050 width =
static_cast<unsigned int>(
2051 .5 + height * (x_dimension_perspective / y_dimension_perspective));
2052 else if (height == 0)
2053 height =
static_cast<unsigned int>(
2054 .5 + width * (y_dimension_perspective / x_dimension_perspective));
2055 unsigned int additional_width = 0;
2057 unsigned int font_size =
2058 static_cast<unsigned int>(.5 + (height / 100.) * 1.75);
2059 cell_label_font_size =
static_cast<unsigned int>(
2061 min_level_min_vertex_distance /
std::min(x_dimension, y_dimension)));
2068 additional_width =
static_cast<unsigned int>(
2073 additional_width =
static_cast<unsigned int>(
2074 .5 + height * .175);
2086 out <<
"<svg width=\"" << width + additional_width <<
"\" height=\"" << height
2087 <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" <<
'\n'
2094 <<
" <linearGradient id=\"background_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\""
2095 << height <<
"\">" <<
'\n'
2096 <<
" <stop offset=\"0\" style=\"stop-color:white\"/>" <<
'\n'
2097 <<
" <stop offset=\"1\" style=\"stop-color:lightsteelblue\"/>" <<
'\n'
2098 <<
" </linearGradient>" <<
'\n';
2104 out <<
"<!-- internal style sheet -->" <<
'\n'
2105 <<
"<style type=\"text/css\"><![CDATA[" <<
'\n';
2109 out <<
" rect.background{fill:url(#background_gradient)}" <<
'\n';
2111 out <<
" rect.background{fill:white}" <<
'\n';
2113 out <<
" rect.background{fill:none}" <<
'\n';
2116 out <<
" rect{fill:none; stroke:rgb(25,25,25); stroke-width:"
2118 <<
" text{font-family:Helvetica; text-anchor:middle; fill:rgb(25,25,25)}"
2120 <<
" line{stroke:rgb(25,25,25); stroke-width:"
2122 <<
" path{fill:none; stroke:rgb(25,25,25); stroke-width:"
2124 <<
" circle{fill:white; stroke:black; stroke-width:2}" <<
'\n'
2130 unsigned int labeling_index = 0;
2131 auto materials_it = materials.begin();
2132 auto levels_it = levels.begin();
2133 auto subdomains_it = subdomains.begin();
2134 auto level_subdomains_it = level_subdomains.begin();
2136 for (
unsigned int index = 0; index < n; ++index)
2141 h = .6 - (index / (n - 1.)) * .6;
2149 unsigned int i =
static_cast<unsigned int>(h * 6);
2151 double f = h * 6 - i;
2158 r = 255, g =
static_cast<unsigned int>(.5 + 255 * t);
2161 r =
static_cast<unsigned int>(.5 + 255 * q), g = 255;
2164 g = 255, b =
static_cast<unsigned int>(.5 + 255 * t);
2167 g =
static_cast<unsigned int>(.5 + 255 * q), b = 255;
2170 r =
static_cast<unsigned int>(.5 + 255 * t), b = 255;
2173 r = 255, b =
static_cast<unsigned int>(.5 + 255 * q);
2182 labeling_index = *materials_it++;
2185 labeling_index = *levels_it++;
2188 labeling_index = *subdomains_it++;
2191 labeling_index = *level_subdomains_it++;
2197 out <<
" path.p" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2198 <<
',' << b <<
"); "
2199 <<
"stroke:rgb(25,25,25); stroke-width:"
2202 out <<
" path.ps" << labeling_index <<
"{fill:rgb("
2203 <<
static_cast<unsigned int>(.5 + .75 * r) <<
','
2204 <<
static_cast<unsigned int>(.5 + .75 * g) <<
','
2205 <<
static_cast<unsigned int>(.5 + .75 * b) <<
"); "
2206 <<
"stroke:rgb(20,20,20); stroke-width:"
2209 out <<
" rect.r" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2210 <<
',' << b <<
"); "
2211 <<
"stroke:rgb(25,25,25); stroke-width:"
2218 out <<
"]]></style>" <<
'\n' <<
'\n';
2221 out <<
" <rect class=\"background\" width=\"" << width <<
"\" height=\""
2222 << height <<
"\"/>" <<
'\n';
2226 unsigned int x_offset = 0;
2229 x_offset =
static_cast<unsigned int>(.5 + (height / 100.) *
2230 (margin_in_percent / 2.));
2232 x_offset =
static_cast<unsigned int>(.5 + height * .025);
2235 <<
" <text x=\"" << x_offset <<
"\" y=\""
2236 <<
static_cast<unsigned int>(.5 + height * .0525) <<
'\"'
2237 <<
" style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:"
2238 <<
static_cast<unsigned int>(.5 + height * .045) <<
"px\">"
2240 <<
"</text>" <<
'\n';
2259 out <<
" <!-- cells -->" <<
'\n';
2261 for (
unsigned int level_index = min_level; level_index <= max_level;
2274 out <<
" class=\"p";
2276 if (!cell->is_active() &&
2283 out << cell->material_id();
2286 out << static_cast<unsigned int>(cell->level());
2289 if (cell->is_active())
2290 out << cell->subdomain_id() + 2;
2295 out << cell->level_subdomain_id() + 2;
2306 point[0] = cell->vertex(0)[0];
2307 point[1] = cell->vertex(0)[1];
2313 (
static_cast<float>(cell->level()) /
2314 static_cast<float>(n_levels)) *
2315 std::max(x_dimension, y_dimension);
2318 projection_decomposition = svg_project_point(point,
2324 out << static_cast<unsigned int>(
2326 ((projection_decomposition[0] - x_min_perspective) /
2327 x_dimension_perspective) *
2328 (width - (width / 100.) * 2. * margin_in_percent) +
2329 ((width / 100.) * margin_in_percent))
2331 <<
static_cast<unsigned int>(
2332 .5 + height - (height / 100.) * margin_in_percent -
2333 ((projection_decomposition[1] - y_min_perspective) /
2334 y_dimension_perspective) *
2335 (height - (height / 100.) * 2. * margin_in_percent));
2339 point[0] = cell->vertex(1)[0];
2340 point[1] = cell->vertex(1)[1];
2342 projection_decomposition = svg_project_point(point,
2348 out << static_cast<unsigned int>(
2350 ((projection_decomposition[0] - x_min_perspective) /
2351 x_dimension_perspective) *
2352 (width - (width / 100.) * 2. * margin_in_percent) +
2353 ((width / 100.) * margin_in_percent))
2355 <<
static_cast<unsigned int>(
2356 .5 + height - (height / 100.) * margin_in_percent -
2357 ((projection_decomposition[1] - y_min_perspective) /
2358 y_dimension_perspective) *
2359 (height - (height / 100.) * 2. * margin_in_percent));
2363 if (cell->n_vertices() == 4)
2365 point[0] = cell->vertex(3)[0];
2366 point[1] = cell->vertex(3)[1];
2368 projection_decomposition = svg_project_point(point,
2374 out << static_cast<unsigned int>(
2376 ((projection_decomposition[0] - x_min_perspective) /
2377 x_dimension_perspective) *
2378 (width - (width / 100.) * 2. * margin_in_percent) +
2379 ((width / 100.) * margin_in_percent))
2381 <<
static_cast<unsigned int>(
2382 .5 + height - (height / 100.) * margin_in_percent -
2383 ((projection_decomposition[1] - y_min_perspective) /
2384 y_dimension_perspective) *
2385 (height - (height / 100.) * 2. * margin_in_percent));
2390 point[0] = cell->vertex(2)[0];
2391 point[1] = cell->vertex(2)[1];
2393 projection_decomposition = svg_project_point(point,
2399 out << static_cast<unsigned int>(
2401 ((projection_decomposition[0] - x_min_perspective) /
2402 x_dimension_perspective) *
2403 (width - (width / 100.) * 2. * margin_in_percent) +
2404 ((width / 100.) * margin_in_percent))
2406 <<
static_cast<unsigned int>(
2407 .5 + height - (height / 100.) * margin_in_percent -
2408 ((projection_decomposition[1] - y_min_perspective) /
2409 y_dimension_perspective) *
2410 (height - (height / 100.) * 2. * margin_in_percent));
2414 point[0] = cell->vertex(0)[0];
2415 point[1] = cell->vertex(0)[1];
2417 projection_decomposition = svg_project_point(point,
2423 out << static_cast<unsigned int>(
2425 ((projection_decomposition[0] - x_min_perspective) /
2426 x_dimension_perspective) *
2427 (width - (width / 100.) * 2. * margin_in_percent) +
2428 ((width / 100.) * margin_in_percent))
2430 <<
static_cast<unsigned int>(
2431 .5 + height - (height / 100.) * margin_in_percent -
2432 ((projection_decomposition[1] - y_min_perspective) /
2433 y_dimension_perspective) *
2434 (height - (height / 100.) * 2. * margin_in_percent));
2436 out <<
"\"/>" <<
'\n';
2443 point[0] = cell->center()[0];
2444 point[1] = cell->center()[1];
2450 (
static_cast<float>(cell->level()) /
2451 static_cast<float>(n_levels)) *
2452 std::max(x_dimension, y_dimension);
2455 const double distance_to_camera =
2457 std::pow(point[1] - camera_position[1], 2.) +
2458 std::pow(point[2] - camera_position[2], 2.));
2459 const double distance_factor =
2460 distance_to_camera / (2. *
std::max(x_dimension, y_dimension));
2462 projection_decomposition = svg_project_point(point,
2468 const unsigned int font_size_this_cell =
2469 static_cast<unsigned int>(
2471 cell_label_font_size *
2472 std::pow(.5, cell->level() - 4. + 3.5 * distance_factor));
2476 <<
static_cast<unsigned int>(
2478 ((projection_decomposition[0] - x_min_perspective) /
2479 x_dimension_perspective) *
2480 (width - (width / 100.) * 2. * margin_in_percent) +
2481 ((width / 100.) * margin_in_percent))
2483 <<
static_cast<unsigned int>(
2484 .5 + height - (height / 100.) * margin_in_percent -
2485 ((projection_decomposition[1] - y_min_perspective) /
2486 y_dimension_perspective) *
2487 (height - (height / 100.) * 2. * margin_in_percent) +
2488 0.5 * font_size_this_cell)
2489 <<
"\" style=\"font-size:" << font_size_this_cell <<
"px\">";
2493 out << cell->level();
2500 out << cell->index();
2509 <<
static_cast<std::make_signed<types::material_id>::type
>(
2510 cell->material_id());
2518 if (cell->is_active())
2520 std::make_signed<types::subdomain_id>::type
>(
2521 cell->subdomain_id());
2534 <<
static_cast<std::make_signed<types::subdomain_id>::type
>(
2535 cell->level_subdomain_id());
2538 out <<
"</text>" <<
'\n';
2545 for (
auto faceIndex : cell->face_indices())
2547 if (cell->at_boundary(faceIndex))
2549 point[0] = cell->face(faceIndex)->vertex(0)[0];
2550 point[1] = cell->face(faceIndex)->vertex(0)[1];
2556 (
static_cast<float>(cell->level()) /
2557 static_cast<float>(n_levels)) *
2558 std::max(x_dimension, y_dimension);
2561 projection_decomposition =
2562 svg_project_point(point,
2568 out <<
" <line x1=\""
2569 <<
static_cast<unsigned int>(
2571 ((projection_decomposition[0] -
2572 x_min_perspective) /
2573 x_dimension_perspective) *
2575 (width / 100.) * 2. * margin_in_percent) +
2576 ((width / 100.) * margin_in_percent))
2578 <<
static_cast<unsigned int>(
2580 (height / 100.) * margin_in_percent -
2581 ((projection_decomposition[1] -
2582 y_min_perspective) /
2583 y_dimension_perspective) *
2585 (height / 100.) * 2. * margin_in_percent));
2587 point[0] = cell->face(faceIndex)->vertex(1)[0];
2588 point[1] = cell->face(faceIndex)->vertex(1)[1];
2594 (
static_cast<float>(cell->level()) /
2595 static_cast<float>(n_levels)) *
2596 std::max(x_dimension, y_dimension);
2599 projection_decomposition =
2600 svg_project_point(point,
2607 <<
static_cast<unsigned int>(
2609 ((projection_decomposition[0] -
2610 x_min_perspective) /
2611 x_dimension_perspective) *
2613 (width / 100.) * 2. * margin_in_percent) +
2614 ((width / 100.) * margin_in_percent))
2616 <<
static_cast<unsigned int>(
2618 (height / 100.) * margin_in_percent -
2619 ((projection_decomposition[1] -
2620 y_min_perspective) /
2621 y_dimension_perspective) *
2623 (height / 100.) * 2. * margin_in_percent))
2629 const double distance_to_camera =
std::sqrt(
2630 std::pow(point[0] - camera_position[0], 2.) +
2631 std::pow(point[1] - camera_position[1], 2.) +
2632 std::pow(point[2] - camera_position[2], 2.));
2633 const double distance_factor =
2634 distance_to_camera /
2635 (2. *
std::max(x_dimension, y_dimension));
2637 const unsigned int font_size_this_edge =
2638 static_cast<unsigned int>(
2639 .5 + .5 * cell_label_font_size *
2641 cell->level() - 4. +
2642 3.5 * distance_factor));
2644 point[0] = cell->face(faceIndex)->center()[0];
2645 point[1] = cell->face(faceIndex)->center()[1];
2651 (
static_cast<float>(cell->level()) /
2652 static_cast<float>(n_levels)) *
2653 std::max(x_dimension, y_dimension);
2656 projection_decomposition =
2657 svg_project_point(point,
2663 const unsigned int xc =
static_cast<unsigned int>(
2665 ((projection_decomposition[0] - x_min_perspective) /
2666 x_dimension_perspective) *
2668 (width / 100.) * 2. * margin_in_percent) +
2669 ((width / 100.) * margin_in_percent));
2670 const unsigned int yc =
static_cast<unsigned int>(
2671 .5 + height - (height / 100.) * margin_in_percent -
2672 ((projection_decomposition[1] - y_min_perspective) /
2673 y_dimension_perspective) *
2675 (height / 100.) * 2. * margin_in_percent));
2677 out <<
" <circle cx=\"" << xc <<
"\" cy=\"" << yc
2678 <<
"\" r=\"" << font_size_this_edge <<
"\" />"
2681 out <<
" <text x=\"" << xc <<
"\" y=\"" << yc
2682 <<
"\" style=\"font-size:" << font_size_this_edge
2683 <<
"px\" dominant-baseline=\"middle\">"
2684 <<
static_cast<int>(
2685 cell->face(faceIndex)->boundary_id())
2686 <<
"</text>" <<
'\n';
2698 out <<
'\n' <<
" <!-- legend -->" <<
'\n';
2700 additional_width = 0;
2702 additional_width =
static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2710 unsigned int line_offset = 0;
2711 out <<
" <rect x=\"" << width + additional_width <<
"\" y=\""
2712 <<
static_cast<unsigned int>(.5 + (height / 100.) * margin_in_percent)
2714 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2715 (40. - margin_in_percent))
2716 <<
"\" height=\"" <<
static_cast<unsigned int>(.5 + height * .215)
2719 out <<
" <text x=\""
2720 << width + additional_width +
2721 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2723 <<
static_cast<unsigned int>(.5 +
2724 (height / 100.) * margin_in_percent +
2725 (++line_offset) * 1.5 * font_size)
2726 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2727 << font_size <<
"px\">"
2729 <<
"</text>" <<
'\n';
2733 out <<
" <text x=\""
2734 << width + additional_width +
2735 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2737 <<
static_cast<unsigned int>(.5 +
2738 (height / 100.) * margin_in_percent +
2739 (++line_offset) * 1.5 * font_size)
2740 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2741 << font_size <<
"px\">"
2749 out <<
"</text>" <<
'\n';
2754 out <<
" <text x=\""
2755 << width + additional_width +
2756 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2758 <<
static_cast<unsigned int>(.5 +
2759 (height / 100.) * margin_in_percent +
2760 (++line_offset) * 1.5 * font_size)
2761 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2762 << font_size <<
"px\">"
2769 out <<
"</text>" <<
'\n';
2774 out <<
" <text x=\""
2775 << width + additional_width +
2776 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2778 <<
static_cast<unsigned int>(.5 +
2779 (height / 100.) * margin_in_percent +
2780 (++line_offset) * 1.5 * font_size)
2781 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2782 << font_size <<
"px\">"
2789 out <<
"</text>" <<
'\n';
2794 out <<
" <text x= \""
2795 << width + additional_width +
2796 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2798 <<
static_cast<unsigned int>(.5 +
2799 (height / 100.) * margin_in_percent +
2800 (++line_offset) * 1.5 * font_size)
2801 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2802 << font_size <<
"px\">"
2808 out <<
"</text>" <<
'\n';
2813 out <<
" <text x= \""
2814 << width + additional_width +
2815 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2817 <<
static_cast<unsigned int>(.5 +
2818 (height / 100.) * margin_in_percent +
2819 (++line_offset) * 1.5 * font_size)
2820 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2821 << font_size <<
"px\">"
2822 <<
"level_subdomain_id"
2823 <<
"</text>" <<
'\n';
2828 out <<
" <text x=\""
2829 << width + additional_width +
2830 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2832 <<
static_cast<unsigned int>(.5 +
2833 (height / 100.) * margin_in_percent +
2834 (++line_offset) * 1.5 * font_size)
2835 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2836 << font_size <<
"px\">"
2838 <<
"</text>" <<
'\n';
2840 out <<
" <text x= \""
2841 << width + additional_width +
2842 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2844 <<
static_cast<unsigned int>(.5 +
2845 (height / 100.) * margin_in_percent +
2846 (++line_offset) * 1.5 * font_size)
2847 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2848 << font_size <<
"px\">"
2850 <<
"</text>" <<
'\n';
2858 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2859 <<
static_cast<unsigned int>(
2860 .5 + (height / 100.) * margin_in_percent + 13.75 * font_size)
2861 <<
"\" style=\"text-anchor:start; font-size:" << font_size <<
"px\">"
2870 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
2872 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2873 <<
static_cast<unsigned int>(
2874 .5 + (height / 100.) * (margin_in_percent + 29.) -
2876 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2877 << font_size <<
"px\">";
2882 out <<
"material_id";
2885 out <<
"level_number";
2888 out <<
"subdomain_id";
2891 out <<
"level_subdomain_id";
2897 out <<
"</text>" <<
'\n';
2899 unsigned int element_height =
static_cast<unsigned int>(
2900 ((height / 100.) * (71. - 2. * margin_in_percent)) / n);
2901 unsigned int element_width =
2902 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2904 int labeling_index = 0;
2905 auto materials_it = materials.begin();
2906 auto levels_it = levels.begin();
2907 auto subdomains_it = subdomains.begin();
2908 auto level_subdomains_it = level_subdomains.begin();
2910 for (
unsigned int index = 0; index < n; ++index)
2915 labeling_index = *materials_it++;
2918 labeling_index = *levels_it++;
2921 labeling_index = *subdomains_it++;
2924 labeling_index = *level_subdomains_it++;
2930 out <<
" <rect class=\"r" << labeling_index <<
"\" x=\""
2931 << width + additional_width <<
"\" y=\""
2932 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2933 (margin_in_percent + 29)) +
2934 (n - index - 1) * element_height
2935 <<
"\" width=\"" << element_width <<
"\" height=\""
2936 << element_height <<
"\"/>" <<
'\n';
2938 out <<
" <text x=\""
2939 << width + additional_width + 1.5 * element_width <<
"\" y=\""
2940 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2941 (margin_in_percent + 29)) +
2942 (n - index - 1 + .5) * element_height +
2943 static_cast<unsigned int>(.5 + font_size * .35)
2945 <<
" style=\"text-anchor:start; font-size:"
2946 <<
static_cast<unsigned int>(.5 + font_size) <<
"px";
2948 if (index == 0 || index == n - 1)
2949 out <<
"; font-weight:bold";
2951 out <<
"\">" << labeling_index;
2958 out <<
"</text>" <<
'\n';
2966 out <<
'\n' <<
"</svg>";
2982template <
int dim,
int spacedim>
2985 std::ostream & out)
const
2992 const std::time_t time1 = std::time(
nullptr);
2993 const std::tm * time = std::localtime(&time1);
2997 <<
"\n# This file was generated by the deal.II library."
2998 <<
"\n# Date = " << time->tm_year + 1900 <<
"/" << std::setfill(
'0')
2999 << std::setw(2) << time->tm_mon + 1 <<
"/" << std::setfill(
'0')
3000 << std::setw(2) << time->tm_mday <<
"\n# Time = " << std::setfill(
'0')
3001 << std::setw(2) << time->tm_hour <<
":" << std::setfill(
'0')
3002 << std::setw(2) << time->tm_min <<
":" << std::setfill(
'0')
3003 << std::setw(2) << time->tm_sec <<
"\n#"
3004 <<
"\n# For a description of the MathGL script format see the MathGL manual. "
3006 <<
"\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
3007 <<
"\n# be quickly viewed in a graphical environment using \'mglview\'. "
3013 const std::string axes =
"xyz";
3028 out <<
"\nsetsize 800 800";
3029 out <<
"\nrotate 0 0";
3032 out <<
"\nsetsize 800 800";
3033 out <<
"\nrotate 60 40";
3042 <<
"\n# Vertex ordering."
3043 <<
"\n# list <vertex order> <vertex indices>"
3052 out <<
"\nlist f 0 1 2 3" <<
'\n';
3056 <<
"\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"
3065 <<
"\n# List of vertices."
3066 <<
"\n# list <id> <vertices>"
3074 for (
unsigned int i = 0; i < dim; ++i)
3081 out <<
"\nlist " << axes[i] << cell->active_cell_index() <<
" ";
3083 out << cell->vertex(j)[i] <<
" ";
3090 <<
"\n# List of cells to quadplot."
3091 <<
"\n# quadplot <vertex order> <id> <style>"
3095 out <<
"\nquadplot f ";
3096 for (
unsigned int j = 0; j < dim; ++j)
3097 out << axes[j] << i <<
" ";
3122 template <
int dim,
int spacedim,
typename ITERATOR,
typename END>
3124 generate_triangulation_patches(
3130 for (; cell != end; ++cell)
3135 patch.
data.reinit(5, cell->n_vertices());
3139 patch.
vertices[v] = cell->vertex(v);
3140 patch.
data(0, v) = cell->level();
3142 static_cast<std::make_signed<types::manifold_id>::type
>(
3143 cell->manifold_id());
3145 static_cast<std::make_signed<types::material_id>::type
>(
3146 cell->material_id());
3147 if (cell->is_active())
3149 static_cast<std::make_signed<types::subdomain_id>::type
>(
3150 cell->subdomain_id());
3152 patch.
data(3, v) = -1;
3154 static_cast<std::make_signed<types::subdomain_id>::type
>(
3155 cell->level_subdomain_id());
3157 patches.push_back(patch);
3163 std::vector<std::string>
3164 triangulation_patch_data_names()
3166 std::vector<std::string> v(5);
3171 v[4] =
"level_subdomain";
3178 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3181 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3183 std::vector<bool> flags;
3187 for (
auto face :
tria.active_face_iterators())
3188 for (const auto
l : face->line_indices())
3190 const auto line = face->line(l);
3191 if (line->user_flag_set() || line->has_children())
3194 line->set_user_flag();
3195 if (line->at_boundary())
3196 res.emplace_back(line);
3207 template <
int dim,
int spacedim>
3208 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3220 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3223 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3225 std::vector<bool> flags;
3229 for (
auto face :
tria.active_face_iterators())
3230 for (const auto
l : face->line_indices())
3232 const auto line = face->line(l);
3233 if (line->user_flag_set() || line->has_children())
3236 line->set_user_flag();
3238 (line->boundary_id() != 0 &&
3240 res.emplace_back(line);
3250 template <
int dim,
int spacedim>
3251 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3262 template <
int dim,
int spacedim>
3263 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3266 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3270 for (
auto face :
tria.active_face_iterators())
3273 res.push_back(face);
3284 template <
int dim,
int spacedim>
3285 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3288 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3292 for (
auto face :
tria.active_face_iterators())
3295 (face->boundary_id() != 0 &&
3297 res.push_back(face);
3305template <
int dim,
int spacedim>
3308 std::ostream & out)
const
3315 const auto n_vertices =
vertices.size();
3317 out <<
"# vtk DataFile Version 3.0\n"
3318 <<
"Triangulation generated with deal.II\n"
3320 <<
"DATASET UNSTRUCTURED_GRID\n"
3321 <<
"POINTS " << n_vertices <<
" double\n";
3327 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
3333 get_relevant_face_iterators(
tria) :
3334 get_boundary_face_iterators(
tria);
3336 get_relevant_edge_iterators(
tria) :
3337 get_boundary_edge_iterators(
tria);
3343 "At least one of the flags (output_cells, output_faces, output_edges) has to be enabled!"));
3360 cells_size += cell->n_vertices() + 1;
3363 for (
const auto &face : faces)
3364 cells_size += face->n_vertices() + 1;
3367 for (
const auto &edge : edges)
3368 cells_size += edge->n_vertices() + 1;
3372 out <<
"\nCELLS " << n_cells <<
' ' << cells_size <<
'\n';
3387 static const std::array<int, 8> deal_to_vtk_cell_type = {
3388 {1, 3, 5, 9, 10, 14, 13, 12}};
3389 static const std::array<unsigned int, 8> vtk_to_deal_hypercube = {
3390 {0, 1, 3, 2, 4, 5, 7, 6}};
3396 out << cell->n_vertices();
3397 for (
const unsigned int i : cell->vertex_indices())
3400 const auto reference_cell = cell->reference_cell();
3406 out << cell->vertex_index(vtk_to_deal_hypercube[i]);
3410 out << cell->vertex_index(i);
3413 static const std::array<unsigned int, 5> permutation_table{
3415 out << cell->vertex_index(permutation_table[i]);
3423 for (
const auto &face : faces)
3425 out << face->n_vertices();
3426 for (
const unsigned int i : face->vertex_indices())
3430 face->n_vertices() ?
3431 vtk_to_deal_hypercube[i] :
3437 for (
const auto &edge : edges)
3440 for (
const unsigned int i : edge->vertex_indices())
3441 out <<
' ' << edge->vertex_index(i);
3446 out <<
"\nCELL_TYPES " << n_cells <<
'\n';
3450 out << deal_to_vtk_cell_type[
static_cast<int>(cell->reference_cell())]
3456 for (
const auto &face : faces)
3457 out << deal_to_vtk_cell_type[
static_cast<int>(face->reference_cell())]
3463 for (
const auto &edge : edges)
3464 out << deal_to_vtk_cell_type[
static_cast<int>(edge->reference_cell())]
3467 out <<
"\n\nCELL_DATA " << n_cells <<
'\n'
3468 <<
"SCALARS MaterialID int 1\n"
3469 <<
"LOOKUP_TABLE default\n";
3476 out << static_cast<std::make_signed<types::material_id>::type>(
3477 cell->material_id())
3484 for (
const auto &face : faces)
3486 out << static_cast<std::make_signed<types::boundary_id>::type>(
3487 face->boundary_id())
3494 for (
const auto &edge : edges)
3496 out << static_cast<std::make_signed<types::boundary_id>::type>(
3497 edge->boundary_id())
3502 out <<
"\n\nSCALARS ManifoldID int 1\n"
3503 <<
"LOOKUP_TABLE default\n";
3510 out << static_cast<std::make_signed<types::manifold_id>::type>(
3511 cell->manifold_id())
3518 for (
const auto &face : faces)
3520 out << static_cast<std::make_signed<types::manifold_id>::type>(
3521 face->manifold_id())
3528 for (
const auto &edge : edges)
3530 out << static_cast<std::make_signed<types::manifold_id>::type>(
3531 edge->manifold_id())
3544template <
int dim,
int spacedim>
3547 std::ostream & out)
const
3555 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3562 triangulation_patch_data_names(),
3564 std::tuple<
unsigned int,
3572 out <<
" </UnstructuredGrid>\n";
3573 out <<
"<dealiiData encoding=\"base64\">";
3574 std::stringstream outstring;
3575 boost::archive::binary_oarchive ia(outstring);
3579 out <<
"\n</dealiiData>\n";
3580 out <<
"</VTKFile>\n";
3591template <
int dim,
int spacedim>
3595 const std::string & filename_without_extension,
3596 const bool view_levels,
3597 const bool include_artificial)
const
3599 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3600 const unsigned int n_datasets = 4;
3601 std::vector<std::string> data_names;
3602 data_names.emplace_back(
"level");
3603 data_names.emplace_back(
"subdomain");
3604 data_names.emplace_back(
"level_subdomain");
3605 data_names.emplace_back(
"proc_writing");
3611 const auto &reference_cell = reference_cells[0];
3613 const unsigned int n_q_points = reference_cell.n_vertices();
3619 if (cell->has_children())
3621 if (!include_artificial &&
3625 else if (!include_artificial)
3627 if (cell->has_children() &&
3630 else if (cell->is_active() &&
3631 cell->level_subdomain_id() ==
3638 patch.
data.reinit(n_datasets, n_q_points);
3642 for (
unsigned int vertex = 0; vertex < n_q_points; ++vertex)
3644 patch.
vertices[vertex] = cell->vertex(vertex);
3645 patch.
data(0, vertex) = cell->level();
3646 if (cell->is_active())
3647 patch.
data(1, vertex) =
static_cast<double>(
3648 static_cast<std::make_signed<types::subdomain_id>::type
>(
3649 cell->subdomain_id()));
3651 patch.
data(1, vertex) = -1.0;
3652 patch.
data(2, vertex) =
static_cast<double>(
3653 static_cast<std::make_signed<types::subdomain_id>::type
>(
3654 cell->level_subdomain_id()));
3658 for (
auto f : reference_cell.face_indices())
3660 patches.push_back(patch);
3666 std::string new_file = filename_without_extension +
".vtu";
3670 new_file = filename_without_extension +
".proc" +
3675 if (tr->locally_owned_subdomain() == 0)
3677 std::vector<std::string> filenames;
3682 std::size_t pos = filename_without_extension.find_last_of(
'/');
3683 if (pos == std::string::npos)
3687 const unsigned int n_procs =
3689 for (
unsigned int i = 0; i < n_procs; ++i)
3690 filenames.push_back(filename_without_extension.substr(pos) +
3694 const std::string pvtu_filename =
3695 (filename_without_extension +
".pvtu");
3696 std::ofstream pvtu_output(pvtu_filename.c_str());
3715 std::ofstream out(new_file.c_str());
3717 std::tuple<
unsigned int,
3723 patches, data_names, vector_data_ranges,
vtu_flags, out);
3779template <
int dim,
int spacedim>
3784 unsigned int n_faces = 0;
3787 if ((face->at_boundary()) && (face->boundary_id() != 0))
3795template <
int dim,
int spacedim>
3802 std::vector<bool> line_flags;
3806 .clear_user_flags_line();
3808 unsigned int n_lines = 0;
3811 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3812 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3813 (cell->line(l)->user_flag_set() ==
false))
3816 cell->line(l)->set_user_flag();
3831 const unsigned int next_element_index,
3832 std::ostream &)
const
3834 return next_element_index;
3840 const unsigned int next_element_index,
3841 std::ostream &)
const
3843 return next_element_index;
3848 const unsigned int next_element_index,
3849 std::ostream &)
const
3851 return next_element_index;
3857 const unsigned int next_element_index,
3858 std::ostream &)
const
3860 return next_element_index;
3865 const unsigned int next_element_index,
3866 std::ostream &)
const
3868 return next_element_index;
3874 const unsigned int next_element_index,
3875 std::ostream &)
const
3877 return next_element_index;
3883 const unsigned int next_element_index,
3884 std::ostream &)
const
3886 return next_element_index;
3891 const unsigned int next_element_index,
3892 std::ostream &)
const
3894 return next_element_index;
3899template <
int dim,
int spacedim>
3902 const unsigned int next_element_index,
3903 std::ostream & out)
const
3905 unsigned int current_element_index = next_element_index;
3908 if (face->at_boundary() && (face->boundary_id() != 0))
3910 out << current_element_index <<
' '
3911 << face->reference_cell().gmsh_element_type() <<
' ';
3912 out << static_cast<unsigned int>(face->boundary_id()) <<
' '
3913 <<
static_cast<unsigned int>(face->boundary_id()) <<
' '
3914 << face->n_vertices();
3916 for (
const unsigned int vertex : face->vertex_indices())
3920 << face->vertex_index(
3925 out <<
' ' << face->vertex_index(vertex) + 1;
3931 ++current_element_index;
3933 return current_element_index;
3938template <
int dim,
int spacedim>
3941 const unsigned int next_element_index,
3942 std::ostream & out)
const
3944 unsigned int current_element_index = next_element_index;
3949 std::vector<bool> line_flags;
3953 .clear_user_flags_line();
3956 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3957 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3958 (cell->line(l)->user_flag_set() ==
false))
3960 out << next_element_index <<
' '
3962 out << static_cast<unsigned int>(cell->line(l)->boundary_id()) <<
' '
3963 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
3966 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
3968 << cell->line(l)->vertex_index(
3976 ++current_element_index;
3977 cell->line(l)->set_user_flag();
3985 return current_element_index;
3992 const unsigned int next_element_index,
3993 std::ostream &)
const
3995 return next_element_index;
4000 const unsigned int next_element_index,
4001 std::ostream &)
const
4003 return next_element_index;
4008 const unsigned int next_element_index,
4009 std::ostream &)
const
4011 return next_element_index;
4016 const unsigned int next_element_index,
4017 std::ostream &)
const
4019 return next_element_index;
4024 const unsigned int next_element_index,
4025 std::ostream &)
const
4027 return next_element_index;
4033 const unsigned int next_element_index,
4034 std::ostream &)
const
4036 return next_element_index;
4042 const unsigned int next_element_index,
4043 std::ostream &)
const
4045 return next_element_index;
4050 const unsigned int next_element_index,
4051 std::ostream &)
const
4053 return next_element_index;
4058template <
int dim,
int spacedim>
4061 const unsigned int next_element_index,
4062 std::ostream & out)
const
4064 unsigned int current_element_index = next_element_index;
4068 if (face->at_boundary() && (face->boundary_id() != 0))
4070 out << current_element_index <<
" "
4071 <<
static_cast<unsigned int>(face->boundary_id()) <<
" ";
4084 for (
unsigned int vertex = 0;
4085 vertex < GeometryInfo<dim>::vertices_per_face;
4087 out << face->vertex_index(
4093 ++current_element_index;
4095 return current_element_index;
4100template <
int dim,
int spacedim>
4103 const unsigned int next_element_index,
4104 std::ostream & out)
const
4106 unsigned int current_element_index = next_element_index;
4111 std::vector<bool> line_flags;
4115 .clear_user_flags_line();
4118 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
4119 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
4120 (cell->line(l)->user_flag_set() ==
false))
4122 out << current_element_index <<
" "
4123 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
4126 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
4127 out << cell->line(l)->vertex_index(
4136 ++current_element_index;
4137 cell->line(l)->set_user_flag();
4144 return current_element_index;
4161 template <
int spacedim>
4165 while (points.size() > 2)
4168 first_difference /= first_difference.
norm();
4170 second_difference /= second_difference.
norm();
4172 if ((first_difference - second_difference).norm() < 1e-10)
4173 points.erase(points.begin() + 1);
4181 template <
int spacedim>
4190 for (
const auto &cell :
tria.active_cell_iterators())
4193 out <<
"# cell " << cell <<
'\n';
4195 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4196 << cell->material_id() <<
'\n'
4197 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4198 << cell->material_id() <<
'\n'
4211 template <
int spacedim>
4222 const unsigned int n_additional_points =
4224 const unsigned int n_points = 2 + n_additional_points;
4229 std::vector<
Point<dim - 1>> boundary_points;
4230 if (mapping !=
nullptr)
4232 boundary_points.resize(n_points);
4233 boundary_points[0][0] = 0;
4234 boundary_points[n_points - 1][0] = 1;
4235 for (
unsigned int i = 1; i < n_points - 1; ++i)
4236 boundary_points[i](0) = 1. * i / (n_points - 1);
4238 std::vector<double> dummy_weights(n_points, 1. / n_points);
4239 Quadrature<dim - 1> quadrature(boundary_points, dummy_weights);
4242 ReferenceCells::get_hypercube<dim>(), quadrature);
4245 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
4246 {0, 1, 5, 4, 2, 3, 7, 6}};
4247 for (
const auto &cell :
tria.active_cell_iterators())
4250 out <<
"# cell " << cell <<
'\n';
4252 if (mapping ==
nullptr ||
4263 out << cell->vertex(dim == 3 ?
4264 local_vertex_numbering[i] :
4268 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4269 << cell->material_id() <<
'\n'
4277 for (
const unsigned int face_no :
4280 const typename ::Triangulation<dim,
4281 spacedim>::face_iterator
4282 face = cell->face(face_no);
4283 if (dim != spacedim || face->at_boundary() ||
4289 std::vector<Point<spacedim>> line_points;
4292 const unsigned int offset = face_no * n_points;
4293 for (
unsigned int i = 0; i < n_points; ++i)
4294 line_points.push_back(
4296 cell, q_projector.
point(offset + i)));
4297 internal::remove_colinear_points(line_points);
4303 out <<
'\n' <<
'\n';
4309 out << face->vertex(0) <<
' ' << cell->level() <<
' '
4310 << cell->material_id() <<
'\n'
4311 << face->vertex(1) <<
' ' << cell->level() <<
' '
4312 << cell->material_id() <<
'\n'
4328 template <
int spacedim>
4339 const unsigned int n_additional_points =
4341 const unsigned int n_points = 2 + n_additional_points;
4345 std::unique_ptr<Quadrature<dim>> q_projector;
4346 std::vector<Point<1>> boundary_points;
4347 if (mapping !=
nullptr)
4349 boundary_points.resize(n_points);
4350 boundary_points[0][0] = 0;
4351 boundary_points[n_points - 1][0] = 1;
4352 for (
unsigned int i = 1; i < n_points - 1; ++i)
4353 boundary_points[i](0) = 1. * i / (n_points - 1);
4355 std::vector<double> dummy_weights(n_points, 1. / n_points);
4359 QIterated<dim - 1> quadrature(quadrature1d, 1);
4360 q_projector = std::make_unique<Quadrature<dim>>(
4362 ReferenceCells::get_hypercube<dim>(), quadrature));
4365 for (
const auto &cell :
tria.active_cell_iterators())
4368 out <<
"# cell " << cell <<
'\n';
4370 if (mapping ==
nullptr || n_points == 2 ||
4371 (!cell->has_boundary_lines() &&
4377 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4378 << cell->material_id() <<
'\n'
4379 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4380 << cell->material_id() <<
'\n'
4381 << cell->vertex(5) <<
' ' << cell->level() <<
' '
4382 << cell->material_id() <<
'\n'
4383 << cell->vertex(4) <<
' ' << cell->level() <<
' '
4384 << cell->material_id() <<
'\n'
4385 << cell->vertex(0) <<
' ' << cell->level() <<
' '
4386 << cell->material_id() <<
'\n'
4389 out << cell->vertex(2) <<
' ' << cell->level() <<
' '
4390 << cell->material_id() <<
'\n'
4391 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4392 << cell->material_id() <<
'\n'
4393 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4394 << cell->material_id() <<
'\n'
4395 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4396 << cell->material_id() <<
'\n'
4397 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4398 << cell->material_id() <<
'\n'
4402 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4403 << cell->material_id() <<
'\n'
4404 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4405 << cell->material_id() <<
'\n'
4407 out << cell->vertex(1) <<
' ' << cell->level() <<
' '
4408 << cell->material_id() <<
'\n'
4409 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4410 << cell->material_id() <<
'\n'
4412 out << cell->vertex(5) <<
' ' << cell->level() <<
' '
4413 << cell->material_id() <<
'\n'
4414 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4415 << cell->material_id() <<
'\n'
4417 out << cell->vertex(4) <<
' ' << cell->level() <<
' '
4418 << cell->material_id() <<
'\n'
4419 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4420 << cell->material_id() <<
'\n'
4426 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
4428 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4429 << cell->material_id() <<
'\n';
4433 for (
const unsigned int v : {3, 1})
4435 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4436 << cell->material_id() <<
'\n';
4447 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
4449 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4450 << cell->material_id() <<
'\n';
4454 for (
const unsigned int v : {1, 4})
4456 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4457 << cell->material_id() <<
'\n';
4461 for (
const unsigned int v : {2, 5})
4463 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4464 << cell->material_id() <<
'\n';
4471 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
4473 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4474 << cell->material_id() <<
'\n';
4478 for (
const unsigned int v : {2, 4, 3})
4480 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4481 << cell->material_id() <<
'\n';
4492 for (
const unsigned int face_no :
4495 const typename ::Triangulation<dim,
4496 spacedim>::face_iterator
4497 face = cell->face(face_no);
4499 if (face->at_boundary() &&
4502 const unsigned int offset = face_no * n_points * n_points;
4503 for (
unsigned int i = 0; i < n_points - 1; ++i)
4504 for (
unsigned int j = 0; j < n_points - 1; ++j)
4509 q_projector->point(offset + i * n_points + j));
4510 out << p0 <<
' ' << cell->level() <<
' '
4511 << cell->material_id() <<
'\n';
4515 offset + (i + 1) * n_points + j)))
4516 <<
' ' << cell->level() <<
' '
4517 << cell->material_id() <<
'\n';
4521 offset + (i + 1) * n_points + j + 1)))
4522 <<
' ' << cell->level() <<
' '
4523 << cell->material_id() <<
'\n';
4526 q_projector->point(offset + i * n_points +
4528 <<
' ' << cell->level() <<
' '
4529 << cell->material_id() <<
'\n';
4531 out << p0 <<
' ' << cell->level() <<
' '
4532 << cell->material_id() <<
'\n';
4533 out <<
'\n' <<
'\n';
4538 for (
unsigned int l = 0;
4539 l < GeometryInfo<dim>::lines_per_face;
4542 const typename ::Triangulation<dim, spacedim>::
4543 line_iterator line = face->line(l);
4546 &
v1 = line->vertex(1);
4547 if (line->at_boundary() ||
4553 std::vector<Point<spacedim>> line_points;
4562 for (
unsigned int i = 0; i < n_points; ++i)
4563 line_points.push_back(
4566 (1 - boundary_points[i][0]) * u0 +
4567 boundary_points[i][0] * u1));
4568 internal::remove_colinear_points(line_points);
4571 << static_cast<unsigned
int>(
4576 out <<
v0 <<
' ' << cell->level() <<
' '
4577 << cell->material_id() <<
'\n'
4578 <<
v1 <<
' ' << cell->level() <<
' '
4579 << cell->material_id() <<
'\n';
4581 out <<
'\n' <<
'\n';
4598template <
int dim,
int spacedim>
4622 const unsigned int l)
4642 write_eps(const ::Triangulation<1, 2> &,
4652 write_eps(const ::Triangulation<1, 3> &,
4662 write_eps(const ::Triangulation<2, 3> &,
4673 template <
int dim,
int spacedim>
4681 using LineList = std::list<LineEntry>;
4693 static_cast<const
GridOutFlags::EpsFlagsBase &>(eps_flags_3);
4721 for (
const auto &cell :
tria.active_cell_iterators())
4722 for (const unsigned
int line_no : cell->line_indices())
4724 typename ::Triangulation<dim, spacedim>::line_iterator
4725 line = cell->line(line_no);
4737 if (!line->has_children() &&
4738 (mapping ==
nullptr || !line->at_boundary()))
4758 line_list.emplace_back(
4759 Point<2>(line->vertex(0)(0), line->vertex(0)(1)),
4760 Point<2>(line->vertex(1)(0), line->vertex(1)(1)),
4761 line->user_flag_set(),
4771 if (mapping !=
nullptr)
4778 std::vector<
Point<dim - 1>> boundary_points(n_points);
4780 for (
unsigned int i = 0; i < n_points; ++i)
4781 boundary_points[i](0) = 1. * (i + 1) / (n_points + 1);
4783 Quadrature<dim - 1> quadrature(boundary_points);
4786 ReferenceCells::get_hypercube<dim>(), quadrature));
4792 for (
const auto &cell :
tria.active_cell_iterators())
4793 for (const unsigned
int face_no :
4796 const typename ::Triangulation<dim, spacedim>::
4797 face_iterator face = cell->face(face_no);
4799 if (face->at_boundary())
4809 const unsigned int offset = face_no * n_points;
4810 for (
unsigned int i = 0; i < n_points; ++i)
4814 cell, q_projector.point(offset + i)));
4815 const Point<2> p1(p1_dim(0), p1_dim(1));
4817 line_list.emplace_back(p0,
4819 face->user_flag_set(),
4826 const Point<2> p1(p1_dim(0), p1_dim(1));
4827 line_list.emplace_back(p0,
4829 face->user_flag_set(),
4863 const double z_angle = eps_flags_3.azimut_angle;
4864 const double turn_angle = eps_flags_3.turn_angle;
4866 -
std::sin(z_angle * 2. * pi / 360.) *
4867 std::sin(turn_angle * 2. * pi / 360.),
4868 +
std::sin(z_angle * 2. * pi / 360.) *
4869 std::cos(turn_angle * 2. * pi / 360.),
4870 -
std::cos(z_angle * 2. * pi / 360.));
4878 ((
Point<dim>(0, 0, 1) * view_direction) * view_direction);
4887 ((
Point<dim>(1, 0, 0) * view_direction) * view_direction) -
4888 ((
Point<dim>(1, 0, 0) * unit_vector1) * unit_vector1));
4892 for (
const auto &cell :
tria.active_cell_iterators())
4893 for (const unsigned
int line_no : cell->line_indices())
4895 typename ::Triangulation<dim, spacedim>::line_iterator
4896 line = cell->line(line_no);
4897 line_list.emplace_back(
4898 Point<2>(line->vertex(0) * unit_vector2,
4899 line->vertex(0) * unit_vector1),
4900 Point<2>(line->vertex(1) * unit_vector2,
4901 line->vertex(1) * unit_vector1),
4902 line->user_flag_set(),
4919 double x_max = x_min;
4921 double y_max = y_min;
4922 unsigned int max_level = line_list.begin()->level;
4924 for (LineList::const_iterator line = line_list.begin();
4925 line != line_list.end();
4928 x_min =
std::min(x_min, line->first(0));
4929 x_min =
std::min(x_min, line->second(0));
4931 x_max =
std::max(x_max, line->first(0));
4932 x_max =
std::max(x_max, line->second(0));
4934 y_min =
std::min(y_min, line->first(1));
4935 y_min =
std::min(y_min, line->second(1));
4937 y_max =
std::max(y_max, line->first(1));
4938 y_max =
std::max(y_max, line->second(1));
4940 max_level =
std::max(max_level, line->level);
4948 const double scale =
4949 (eps_flags_base.
size /
4960 std::time_t time1 = std::time(
nullptr);
4961 std::tm * time = std::localtime(&time1);
4962 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4963 <<
"%%Title: deal.II Output" <<
'\n'
4964 <<
"%%Creator: the deal.II library" <<
'\n'
4965 <<
"%%Creation Date: " << time->tm_year + 1900 <<
"/"
4966 << time->tm_mon + 1 <<
"/" << time->tm_mday <<
" - "
4967 << time->tm_hour <<
":" << std::setw(2) << time->tm_min <<
":"
4968 << std::setw(2) << time->tm_sec <<
'\n'
4969 <<
"%%BoundingBox: "
4973 <<
static_cast<unsigned int>(
4974 std::floor(((x_max - x_min) * scale) + 1))
4976 <<
static_cast<unsigned int>(
4977 std::floor(((y_max - y_min) * scale) + 1))
4986 out <<
"/m {moveto} bind def" <<
'\n'
4987 <<
"/x {lineto stroke} bind def" <<
'\n'
4988 <<
"/b {0 0 0 setrgbcolor} def" <<
'\n'
4989 <<
"/r {1 0 0 setrgbcolor} def" <<
'\n';
4996 out <<
"/l { neg " << (max_level) <<
" add "
4997 << (0.66666 /
std::max(1U, (max_level - 1)))
4998 <<
" mul 1 0.8 sethsbcolor} def" <<
'\n';
5008 if ((dim == 2) && (eps_flags_2.write_cell_numbers ||
5009 eps_flags_2.write_vertex_numbers))
5012 << (
"/R {rmoveto} bind def\n"
5013 "/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n"
5014 "dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n"
5015 "currentdict end definefont\n"
5016 "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5017 "[ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n"
5018 "{show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n"
5019 "{2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n"
5020 "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5021 "5 get stringwidth pop add}\n"
5022 "{pop} ifelse} forall} bind def\n"
5023 "/MCshow { currentpoint stroke m\n"
5024 "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
5028 out <<
"%%EndProlog" <<
'\n' <<
'\n';
5031 out << eps_flags_base.
line_width <<
" setlinewidth" <<
'\n';
5035 const Point<2> offset(x_min, y_min);
5037 for (LineList::const_iterator line = line_list.begin();
5038 line != line_list.end();
5041 out << line->level <<
" l " << (line->first - offset) *
scale <<
" m "
5042 << (line->second - offset) * scale <<
" x" <<
'\n';
5048 << (line->
second - offset) *
scale <<
" x" <<
'\n';
5052 if ((dim == 2) && (eps_flags_2.write_cell_numbers ==
true))
5054 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5056 for (
const auto &cell :
tria.active_cell_iterators())
5058 out << (cell->center()(0) - offset(0)) * scale <<
' '
5059 << (cell->center()(1) - offset(1)) * scale <<
" m" <<
'\n'
5060 <<
"[ [(Helvetica) 12.0 0.0 true true (";
5061 if (eps_flags_2.write_cell_number_level)
5064 out << cell->index();
5067 <<
"] -6 MCshow" <<
'\n';
5072 if ((dim == 2) && (eps_flags_2.write_vertex_numbers ==
true))
5074 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5080 std::set<unsigned int> treated_vertices;
5081 for (
const auto &cell :
tria.active_cell_iterators())
5083 if (treated_vertices.find(cell->vertex_index(vertex_no)) ==
5084 treated_vertices.
end())
5086 treated_vertices.insert(cell->vertex_index(vertex_no));
5088 out << (cell->vertex(vertex_no)(0) - offset(0)) * scale <<
' '
5089 << (cell->vertex(vertex_no)(1) - offset(1)) * scale
5091 <<
"[ [(Helvetica) 10.0 0.0 true true ("
5092 << cell->vertex_index(vertex_no) <<
")] "
5093 <<
"] -6 MCshow" <<
'\n';
5097 out <<
"showpage" <<
'\n';
5109template <
int dim,
int spacedim>
5119template <
int dim,
int spacedim>
5126 switch (output_format)
5176template <
int dim,
int spacedim>
5187#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
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
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)
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 > sqrt(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
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