31#include <boost/archive/binary_oarchive.hpp>
33#ifdef DEAL_II_GMSH_WITH_API
52 const bool write_faces,
53 const bool write_diameter,
54 const bool write_measure,
55 const bool write_all_faces)
56 : write_cells(write_cells)
57 , write_faces(write_faces)
58 , write_diameter(write_diameter)
59 , write_measure(write_measure)
60 , write_all_faces(write_all_faces)
69 "Write the mesh connectivity as DX grid cells");
73 "Write faces of cells. These may be boundary faces "
74 "or all faces between mesh cells, according to "
75 "\"Write all faces\"");
79 "If cells are written, additionally write their"
80 " diameter as data for visualization");
84 "Write the volume of each cell as data");
88 "Write all faces, not only boundary");
102 Msh::Msh(
const bool write_faces,
const bool write_lines)
103 : write_faces(write_faces)
104 , write_lines(write_lines)
124 const bool write_faces,
125 const bool write_lines)
126 : write_preamble(write_preamble)
127 , write_faces(write_faces)
128 , write_lines(write_lines)
153 const unsigned int n_extra_curved_line_points,
154 const bool curved_inner_cells,
155 const bool write_additional_boundary_lines)
156 : write_cell_numbers(write_cell_numbers)
157 , n_extra_curved_line_points(n_extra_curved_line_points)
158 , curved_inner_cells(curved_inner_cells)
159 , write_additional_boundary_lines(write_additional_boundary_lines)
181 const unsigned int size,
182 const double line_width,
183 const bool color_lines_on_user_flag,
184 const unsigned int n_boundary_face_points,
185 const bool color_lines_level)
186 : size_type(size_type)
188 , line_width(line_width)
189 , color_lines_on_user_flag(color_lines_on_user_flag)
190 , n_boundary_face_points(n_boundary_face_points)
191 , color_lines_level(color_lines_level)
201 "Depending on this parameter, either the "
203 "of the eps is scaled to \"Size\"");
207 "Size of the output in points");
211 "Width of the lines drawn in points");
215 "Draw lines with user flag set in different color");
219 "Number of points on boundary edges. "
220 "Increase this beyond 2 to see curved boundaries.");
224 "Draw different colors according to grid level.");
231 if (param.
get(
"Size by") ==
"width")
233 else if (param.
get(
"Size by") ==
"height")
245 const unsigned int size,
246 const double line_width,
247 const bool color_lines_on_user_flag,
248 const unsigned int n_boundary_face_points)
252 color_lines_on_user_flag,
253 n_boundary_face_points)
271 const unsigned int size,
272 const double line_width,
273 const bool color_lines_on_user_flag,
274 const unsigned int n_boundary_face_points,
275 const bool write_cell_numbers,
276 const bool write_cell_number_level,
277 const bool write_vertex_numbers,
278 const bool color_lines_level)
282 color_lines_on_user_flag,
283 n_boundary_face_points,
285 , write_cell_numbers(write_cell_numbers)
286 , write_cell_number_level(write_cell_number_level)
287 , write_vertex_numbers(write_vertex_numbers)
297 "(2d only) Write cell numbers"
298 " into the centers of cells");
302 "(2d only) if \"Cell number\" is true, write "
303 "numbers in the form level.number");
307 "Write numbers for each vertex");
315 write_cell_numbers = param.
get_bool(
"Cell number");
316 write_cell_number_level = param.
get_bool(
"Level number");
317 write_vertex_numbers = param.
get_bool(
"Vertex number");
323 const unsigned int size,
324 const double line_width,
325 const bool color_lines_on_user_flag,
326 const unsigned int n_boundary_face_points,
327 const double azimut_angle,
328 const double turn_angle)
332 color_lines_on_user_flag,
333 n_boundary_face_points)
334 , azimut_angle(azimut_angle)
335 , turn_angle(turn_angle)
345 "Azimuth of the view point, that is, the angle "
346 "in the plane from the x-axis.");
350 "Elevation of the view point above the xy-plane.");
358 azimut_angle = 90 - param.
get_double(
"Elevation");
365 : draw_boundary(true)
366 , color_by(material_id)
368 , n_boundary_face_points(0)
374 , boundary_thickness(3)
408 const unsigned int boundary_line_thickness,
411 const int azimuth_angle,
412 const int polar_angle,
414 const bool convert_level_number_to_height,
415 const bool label_level_number,
416 const bool label_cell_index,
417 const bool label_material_id,
418 const bool label_subdomain_id,
419 const bool draw_colorbar,
420 const bool draw_legend,
421 const bool label_boundary_id)
424 , line_thickness(line_thickness)
425 , boundary_line_thickness(boundary_line_thickness)
427 , background(background)
428 , azimuth_angle(azimuth_angle)
429 , polar_angle(polar_angle)
431 , convert_level_number_to_height(convert_level_number_to_height)
432 , level_height_factor(0.3f)
433 , cell_font_scaling(1.f)
434 , label_level_number(label_level_number)
435 , label_cell_index(label_cell_index)
436 , label_material_id(label_material_id)
437 , label_subdomain_id(label_subdomain_id)
438 , label_level_subdomain_id(false)
439 , label_boundary_id(label_boundary_id)
440 , draw_colorbar(draw_colorbar)
441 , draw_legend(draw_legend)
445 : draw_bounding_box(false)
464 : default_format(none)
558 switch (output_format)
601 if (format_name ==
"none" || format_name ==
"false")
604 if (format_name ==
"dx")
607 if (format_name ==
"ucd")
610 if (format_name ==
"gnuplot")
613 if (format_name ==
"eps")
616 if (format_name ==
"xfig")
619 if (format_name ==
"msh")
622 if (format_name ==
"svg")
625 if (format_name ==
"mathgl")
628 if (format_name ==
"vtk")
631 if (format_name ==
"vtu")
644 return "none|dx|gnuplot|eps|ucd|xfig|msh|svg|mathgl|vtk|vtu";
777template <
int dim,
int spacedim>
780 std::ostream &out)
const
786 const std::vector<Point<spacedim>> &vertices = tria.
get_vertices();
796 std::vector<unsigned int> renumber(vertices.size());
799 unsigned int new_number = 0;
800 for (
unsigned int i = 0; i < vertices.size(); ++i)
802 renumber[i] = new_number++;
806 out <<
"object \"vertices\" class array type float rank 1 shape " << dim
807 <<
" items " << n_vertices <<
" data follows" <<
'\n';
809 for (
unsigned int i = 0; i < vertices.size(); ++i)
811 out <<
'\t' << vertices[i] <<
'\n';
818 const unsigned int n_faces =
826 out <<
"object \"cells\" class array type int rank 1 shape "
827 << n_vertices_per_cell <<
" items " << n_cells <<
" data follows"
838 out <<
"attribute \"element type\" string \"";
846 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
851 out <<
"object \"material\" class array type int rank 0 items " << n_cells
852 <<
" data follows" <<
'\n';
854 out <<
' ' << cell->material_id();
855 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
857 out <<
"object \"level\" class array type int rank 0 items " << n_cells
858 <<
" data follows" <<
'\n';
860 out <<
' ' << cell->level();
861 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
865 out <<
"object \"measure\" class array type float rank 0 items "
866 << n_cells <<
" data follows" <<
'\n';
868 out <<
'\t' << cell->measure();
870 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
876 out <<
"object \"diameter\" class array type float rank 0 items "
877 << n_cells <<
" data follows" <<
'\n';
879 out <<
'\t' << cell->diameter();
881 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
888 out <<
"object \"faces\" class array type int rank 1 shape "
889 << n_vertices_per_face <<
" items " << n_faces <<
" data follows"
894 for (
const unsigned int f : cell->face_indices())
899 for (
unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
902 << renumber[face->vertex_index(
907 out <<
"attribute \"element type\" string \"";
913 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
919 out <<
"object \"boundary\" class array type int rank 0 items " << n_faces
920 <<
" data follows" <<
'\n';
927 <<
static_cast<std::make_signed_t<types::boundary_id>
>(
928 cell->face(f)->boundary_id());
932 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
936 out <<
"object \"face measure\" class array type float rank 0 items "
937 << n_faces <<
" data follows" <<
'\n';
941 out <<
' ' << cell->face(f)->measure();
944 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
949 out <<
"object \"face diameter\" class array type float rank 0 items "
950 << n_faces <<
" data follows" <<
'\n';
954 out <<
' ' << cell->face(f)->diameter();
957 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
972 out <<
"object \"deal data\" class field" <<
'\n'
973 <<
"component \"positions\" value \"vertices\"" <<
'\n'
974 <<
"component \"connections\" value \"cells\"" <<
'\n';
978 out <<
"object \"cell data\" class field" <<
'\n'
979 <<
"component \"positions\" value \"vertices\"" <<
'\n'
980 <<
"component \"connections\" value \"cells\"" <<
'\n';
981 out <<
"component \"material\" value \"material\"" <<
'\n';
982 out <<
"component \"level\" value \"level\"" <<
'\n';
984 out <<
"component \"measure\" value \"measure\"" <<
'\n';
986 out <<
"component \"diameter\" value \"diameter\"" <<
'\n';
991 out <<
"object \"face data\" class field" <<
'\n'
992 <<
"component \"positions\" value \"vertices\"" <<
'\n'
993 <<
"component \"connections\" value \"faces\"" <<
'\n';
994 out <<
"component \"boundary\" value \"boundary\"" <<
'\n';
996 out <<
"component \"measure\" value \"face measure\"" <<
'\n';
998 out <<
"component \"diameter\" value \"face diameter\"" <<
'\n';
1001 out <<
'\n' <<
"object \"grid data\" class group" <<
'\n';
1003 out <<
"member \"cells\" value \"cell data\"" <<
'\n';
1005 out <<
"member \"faces\" value \"face data\"" <<
'\n';
1006 out <<
"end" <<
'\n';
1017template <
int dim,
int spacedim>
1020 std::ostream &out)
const
1027 const std::vector<Point<spacedim>> &vertices = tria.
get_vertices();
1048 out <<
"@f$NOD" <<
'\n' << n_vertices <<
'\n';
1053 for (
unsigned int i = 0; i < vertices.size(); ++i)
1057 <<
" " << vertices[i];
1058 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1064 out <<
"@f$ENDNOD" <<
'\n'
1071 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
1072 {0, 1, 5, 4, 2, 3, 7, 6}};
1078 out << cell->active_cell_index() + 1 <<
' '
1079 << cell->reference_cell().gmsh_element_type() <<
' '
1080 << cell->material_id() <<
' ' << cell->subdomain_id() <<
' '
1081 << cell->n_vertices() <<
' ';
1085 for (
const unsigned int vertex : cell->vertex_indices())
1087 if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
1088 out << cell->vertex_index(
1089 dim == 3 ? local_vertex_numbering[vertex] :
1093 else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
1094 out << cell->vertex_index(vertex) + 1 <<
' ';
1112 out <<
"@f$ENDELM\n";
1122template <
int dim,
int spacedim>
1125 std::ostream &out)
const
1132 const std::vector<Point<spacedim>> &vertices = tria.
get_vertices();
1143 std::time_t time1 = std::time(
nullptr);
1144 std::tm *time = std::localtime(&time1);
1146 <<
"# This file was generated by the deal.II library." <<
'\n'
1147 <<
"# Date = " << time->tm_year + 1900 <<
"/" << time->tm_mon + 1
1148 <<
"/" << time->tm_mday <<
'\n'
1149 <<
"# Time = " << time->tm_hour <<
":" << std::setw(2) << time->tm_min
1150 <<
":" << std::setw(2) << time->tm_sec <<
'\n'
1152 <<
"# For a description of the UCD format see the AVS Developer's guide."
1158 out << n_vertices <<
' '
1168 for (
unsigned int i = 0; i < vertices.size(); ++i)
1172 <<
" " << vertices[i];
1173 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1182 out << cell->active_cell_index() + 1 <<
' ' << cell->material_id() <<
' ';
1214 for (
const unsigned int vertex : cell->vertex_indices())
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);
1443template <
int dim,
int spacedim>
1446 const std::string &filename)
const
1448#ifdef DEAL_II_GMSH_WITH_API
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());
1471 for (
const auto &p : vertices)
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());
1582# if DEAL_II_GMSH_WITH_API_VERSION_GTE(4, 9, 4)
1584 ExcMessage(
"The GMSH API may only be called after GMSH is "
1585 "initialized, e.g., via the InitFinalize or "
1586 "MPI_InitFinalize classes or the gmsh::initialize() "
1589 gmsh::option::setNumber(
"General.Verbosity", 0);
1591 gmsh::model::add(
"Grid generated in deal.II");
1592 for (
const auto &p : dim_entity_tag)
1594 gmsh::model::addDiscreteEntity(p.first, p.second);
1595 gmsh::model::mesh::addNodes(p.first, p.second, nodes, coords);
1598 for (
unsigned int entity_tag = 0; entity_tag < n_entity_tags; ++entity_tag)
1599 for (
unsigned int t = 1; t < 8; ++t)
1601 const auto all_element_ids = element_ids[entity_tag][t];
1602 const auto all_element_nodes = element_nodes[entity_tag][t];
1603 const auto gmsh_t = dealii_to_gmsh_type[t];
1604 if (all_element_ids.size() > 0)
1605 gmsh::model::mesh::addElementsByType(entity_tag + 1,
1613 for (
const auto &[d, entity_tag] : dim_entity_tag)
1615 const auto &boundary_id = all_pairs[entity_tag - 1].first;
1616 const auto &manifold_id = all_pairs[entity_tag - 1].second;
1618 std::string physical_name;
1619 if (d == dim && boundary_id != 0)
1621 static_cast<int>(boundary_id));
1622 else if (d < dim && boundary_id != 0)
1629 std::string sep = physical_name !=
"" ?
", " :
"";
1632 sep +
"ManifoldID:" +
1634 const auto physical_tag =
1635 gmsh::model::addPhysicalGroup(d, {entity_tag}, -1);
1636 if (physical_name !=
"")
1637 gmsh::model::setPhysicalName(d, physical_tag, physical_name);
1641 gmsh::write(filename);
1665 svg_project_point(
const Point<3> &point,
1669 const float camera_focus)
1672 cross_product_3d(camera_horizontal, camera_direction);
1675 camera_focus / ((point - camera_position) * camera_direction);
1678 camera_position + phi * (point - camera_position);
1680 return {(projection - camera_position - camera_focus * camera_direction) *
1682 (projection - camera_position - camera_focus * camera_direction) *
1689template <
int dim,
int spacedim>
1692 std::ostream & )
const
1695 ExcMessage(
"Mesh output in SVG format is not implemented for anything "
1696 "other than two-dimensional meshes in two-dimensional "
1697 "space. That's because three-dimensional meshes are best "
1698 "viewed in programs that allow changing the viewpoint, "
1699 "but SVG format does not allow this: It is an inherently "
1700 "2d format, and for three-dimensional meshes would "
1701 "require choosing one, fixed viewpoint."
1703 "You probably want to output your mesh in a format such "
1704 "as VTK, VTU, or gnuplot."));
1713 unsigned int min_level, max_level;
1722 ExcMessage(
"You have to set at least one of width and height"));
1724 unsigned int margin_in_percent = 0;
1726 margin_in_percent = 8;
1729 unsigned int cell_label_font_size;
1742 float x_max_perspective, x_min_perspective;
1743 float y_max_perspective, y_min_perspective;
1745 float x_dimension_perspective, y_dimension_perspective;
1749 double x_min = tria.
begin()->vertex(0)[0];
1750 double x_max = x_min;
1751 double y_min = tria.
begin()->vertex(0)[1];
1752 double y_max = y_min;
1754 double x_dimension, y_dimension;
1756 min_level = max_level = tria.
begin()->level();
1759 std::set<unsigned int> materials;
1762 std::set<unsigned int> levels;
1765 std::set<unsigned int> subdomains;
1768 std::set<int> level_subdomains;
1776 for (
unsigned int vertex_index = 0; vertex_index < cell->n_vertices();
1779 if (cell->vertex(vertex_index)[0] < x_min)
1780 x_min = cell->vertex(vertex_index)[0];
1781 if (cell->vertex(vertex_index)[0] > x_max)
1782 x_max = cell->vertex(vertex_index)[0];
1784 if (cell->vertex(vertex_index)[1] < y_min)
1785 y_min = cell->vertex(vertex_index)[1];
1786 if (cell->vertex(vertex_index)[1] > y_max)
1787 y_max = cell->vertex(vertex_index)[1];
1790 if (
static_cast<unsigned int>(cell->level()) < min_level)
1791 min_level = cell->level();
1792 if (
static_cast<unsigned int>(cell->level()) > max_level)
1793 max_level = cell->level();
1795 materials.insert(cell->material_id());
1796 levels.insert(cell->level());
1797 if (cell->is_active())
1798 subdomains.insert(cell->subdomain_id() + 2);
1799 level_subdomains.insert(cell->level_subdomain_id() + 2);
1802 x_dimension = x_max - x_min;
1803 y_dimension = y_max - y_min;
1806 const unsigned int n_materials = materials.size();
1809 const unsigned int n_levels = levels.size();
1812 const unsigned int n_subdomains = subdomains.size();
1815 const unsigned int n_level_subdomains = level_subdomains.size();
1829 n = n_level_subdomains;
1838 camera_position[0] = 0;
1839 camera_position[1] = 0;
1840 camera_position[2] = 2. *
std::max(x_dimension, y_dimension);
1843 camera_direction[0] = 0;
1844 camera_direction[1] = 0;
1845 camera_direction[2] = -1;
1848 camera_horizontal[0] = 1;
1849 camera_horizontal[1] = 0;
1850 camera_horizontal[2] = 0;
1852 camera_focus = .5 *
std::max(x_dimension, y_dimension);
1858 const double angle_factor = 3.14159265 / 180.;
1861 camera_position_temp[1] =
1864 camera_position_temp[2] =
1868 camera_direction_temp[1] =
1871 camera_direction_temp[2] =
1875 camera_horizontal_temp[1] =
1878 camera_horizontal_temp[2] =
1882 camera_position[1] = camera_position_temp[1];
1883 camera_position[2] = camera_position_temp[2];
1885 camera_direction[1] = camera_direction_temp[1];
1886 camera_direction[2] = camera_direction_temp[2];
1888 camera_horizontal[1] = camera_horizontal_temp[1];
1889 camera_horizontal[2] = camera_horizontal_temp[2];
1892 camera_position_temp[0] =
1895 camera_position_temp[1] =
1899 camera_direction_temp[0] =
1902 camera_direction_temp[1] =
1906 camera_horizontal_temp[0] =
1909 camera_horizontal_temp[1] =
1913 camera_position[0] = camera_position_temp[0];
1914 camera_position[1] = camera_position_temp[1];
1916 camera_direction[0] = camera_direction_temp[0];
1917 camera_direction[1] = camera_direction_temp[1];
1919 camera_horizontal[0] = camera_horizontal_temp[0];
1920 camera_horizontal[1] = camera_horizontal_temp[1];
1923 camera_position[0] = x_min + .5 * x_dimension;
1924 camera_position[1] = y_min + .5 * y_dimension;
1926 camera_position[0] += 2. *
std::max(x_dimension, y_dimension) *
1929 camera_position[1] -= 2. *
std::max(x_dimension, y_dimension) *
1936 point[0] = tria.
begin()->vertex(0)[0];
1937 point[1] = tria.
begin()->vertex(0)[1];
1940 float min_level_min_vertex_distance = 0;
1945 (
static_cast<float>(tria.
begin()->level()) /
1946 static_cast<float>(n_levels)) *
1947 std::max(x_dimension, y_dimension);
1950 projection_decomposition = svg_project_point(
1951 point, camera_position, camera_direction, camera_horizontal, camera_focus);
1953 x_max_perspective = projection_decomposition[0];
1954 x_min_perspective = projection_decomposition[0];
1956 y_max_perspective = projection_decomposition[1];
1957 y_min_perspective = projection_decomposition[1];
1961 point[0] = cell->vertex(0)[0];
1962 point[1] = cell->vertex(0)[1];
1969 (
static_cast<float>(cell->level()) /
static_cast<float>(n_levels)) *
1970 std::max(x_dimension, y_dimension);
1973 projection_decomposition = svg_project_point(point,
1979 if (x_max_perspective < projection_decomposition[0])
1980 x_max_perspective = projection_decomposition[0];
1981 if (x_min_perspective > projection_decomposition[0])
1982 x_min_perspective = projection_decomposition[0];
1984 if (y_max_perspective < projection_decomposition[1])
1985 y_max_perspective = projection_decomposition[1];
1986 if (y_min_perspective > projection_decomposition[1])
1987 y_min_perspective = projection_decomposition[1];
1989 point[0] = cell->vertex(1)[0];
1990 point[1] = cell->vertex(1)[1];
1992 projection_decomposition = svg_project_point(point,
1998 if (x_max_perspective < projection_decomposition[0])
1999 x_max_perspective = projection_decomposition[0];
2000 if (x_min_perspective > projection_decomposition[0])
2001 x_min_perspective = projection_decomposition[0];
2003 if (y_max_perspective < projection_decomposition[1])
2004 y_max_perspective = projection_decomposition[1];
2005 if (y_min_perspective > projection_decomposition[1])
2006 y_min_perspective = projection_decomposition[1];
2008 point[0] = cell->vertex(2)[0];
2009 point[1] = cell->vertex(2)[1];
2011 projection_decomposition = svg_project_point(point,
2017 if (x_max_perspective < projection_decomposition[0])
2018 x_max_perspective = projection_decomposition[0];
2019 if (x_min_perspective > projection_decomposition[0])
2020 x_min_perspective = projection_decomposition[0];
2022 if (y_max_perspective < projection_decomposition[1])
2023 y_max_perspective = projection_decomposition[1];
2024 if (y_min_perspective > projection_decomposition[1])
2025 y_min_perspective = projection_decomposition[1];
2027 if (cell->n_vertices() == 4)
2029 point[0] = cell->vertex(3)[0];
2030 point[1] = cell->vertex(3)[1];
2032 projection_decomposition = svg_project_point(point,
2038 if (x_max_perspective < projection_decomposition[0])
2039 x_max_perspective = projection_decomposition[0];
2040 if (x_min_perspective > projection_decomposition[0])
2041 x_min_perspective = projection_decomposition[0];
2043 if (y_max_perspective < projection_decomposition[1])
2044 y_max_perspective = projection_decomposition[1];
2045 if (y_min_perspective > projection_decomposition[1])
2046 y_min_perspective = projection_decomposition[1];
2049 if (
static_cast<unsigned int>(cell->level()) == min_level)
2050 min_level_min_vertex_distance = cell->minimum_vertex_distance();
2053 x_dimension_perspective = x_max_perspective - x_min_perspective;
2054 y_dimension_perspective = y_max_perspective - y_min_perspective;
2058 width =
static_cast<unsigned int>(
2059 .5 +
height * (x_dimension_perspective / y_dimension_perspective));
2061 height =
static_cast<unsigned int>(
2062 .5 + width * (y_dimension_perspective / x_dimension_perspective));
2063 unsigned int additional_width = 0;
2065 unsigned int font_size =
2066 static_cast<unsigned int>(.5 + (
height / 100.) * 1.75);
2067 cell_label_font_size =
static_cast<unsigned int>(
2069 min_level_min_vertex_distance /
std::min(x_dimension, y_dimension)));
2076 additional_width =
static_cast<unsigned int>(
2081 additional_width =
static_cast<unsigned int>(
2094 out <<
"<svg width=\"" << width + additional_width <<
"\" height=\"" <<
height
2095 <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" <<
'\n'
2102 <<
" <linearGradient id=\"background_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\""
2103 <<
height <<
"\">" <<
'\n'
2104 <<
" <stop offset=\"0\" style=\"stop-color:white\"/>" <<
'\n'
2105 <<
" <stop offset=\"1\" style=\"stop-color:lightsteelblue\"/>" <<
'\n'
2106 <<
" </linearGradient>" <<
'\n';
2112 out <<
"<!-- internal style sheet -->" <<
'\n'
2113 <<
"<style type=\"text/css\"><![CDATA[" <<
'\n';
2117 out <<
" rect.background{fill:url(#background_gradient)}" <<
'\n';
2119 out <<
" rect.background{fill:white}" <<
'\n';
2121 out <<
" rect.background{fill:none}" <<
'\n';
2124 out <<
" rect{fill:none; stroke:rgb(25,25,25); stroke-width:"
2126 <<
" text{font-family:Helvetica; text-anchor:middle; fill:rgb(25,25,25)}"
2128 <<
" line{stroke:rgb(25,25,25); stroke-width:"
2130 <<
" path{fill:none; stroke:rgb(25,25,25); stroke-width:"
2132 <<
" circle{fill:white; stroke:black; stroke-width:2}" <<
'\n'
2138 unsigned int labeling_index = 0;
2139 auto materials_it = materials.begin();
2140 auto levels_it = levels.begin();
2141 auto subdomains_it = subdomains.begin();
2142 auto level_subdomains_it = level_subdomains.begin();
2144 for (
unsigned int index = 0; index < n; ++index)
2154 h = .6 - (index / (n - 1.)) * .6;
2163 unsigned int i =
static_cast<unsigned int>(h * 6);
2165 double f = h * 6 - i;
2172 r = 255, g =
static_cast<unsigned int>(.5 + 255 * t);
2175 r =
static_cast<unsigned int>(.5 + 255 * q), g = 255;
2178 g = 255, b =
static_cast<unsigned int>(.5 + 255 * t);
2181 g =
static_cast<unsigned int>(.5 + 255 * q), b = 255;
2184 r =
static_cast<unsigned int>(.5 + 255 * t), b = 255;
2187 r = 255, b =
static_cast<unsigned int>(.5 + 255 * q);
2196 labeling_index = *materials_it++;
2199 labeling_index = *levels_it++;
2202 labeling_index = *subdomains_it++;
2205 labeling_index = *level_subdomains_it++;
2211 out <<
" path.p" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2212 <<
',' << b <<
"); "
2213 <<
"stroke:rgb(25,25,25); stroke-width:"
2216 out <<
" path.ps" << labeling_index <<
"{fill:rgb("
2217 <<
static_cast<unsigned int>(.5 + .75 * r) <<
','
2218 <<
static_cast<unsigned int>(.5 + .75 * g) <<
','
2219 <<
static_cast<unsigned int>(.5 + .75 * b) <<
"); "
2220 <<
"stroke:rgb(20,20,20); stroke-width:"
2223 out <<
" rect.r" << labeling_index <<
"{fill:rgb(" << r <<
',' << g
2224 <<
',' << b <<
"); "
2225 <<
"stroke:rgb(25,25,25); stroke-width:"
2232 out <<
"]]></style>" <<
'\n' <<
'\n';
2235 out <<
" <rect class=\"background\" width=\"" << width <<
"\" height=\""
2236 <<
height <<
"\"/>" <<
'\n';
2240 unsigned int x_offset = 0;
2243 x_offset =
static_cast<unsigned int>(.5 + (
height / 100.) *
2244 (margin_in_percent / 2.));
2246 x_offset =
static_cast<unsigned int>(.5 +
height * .025);
2249 <<
" <text x=\"" << x_offset <<
"\" y=\""
2250 <<
static_cast<unsigned int>(.5 +
height * .0525) <<
'\"'
2251 <<
" style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:"
2252 <<
static_cast<unsigned int>(.5 +
height * .045) <<
"px\">"
2254 <<
"</text>" <<
'\n';
2273 out <<
" <!-- cells -->" <<
'\n';
2275 for (
unsigned int level_index = min_level; level_index <= max_level;
2288 out <<
" class=\"p";
2290 if (!cell->is_active() &&
2297 out << cell->material_id();
2300 out << static_cast<unsigned int>(cell->level());
2303 if (cell->is_active())
2304 out << cell->subdomain_id() + 2;
2309 out << cell->level_subdomain_id() + 2;
2320 point[0] = cell->vertex(0)[0];
2321 point[1] = cell->vertex(0)[1];
2327 (
static_cast<float>(cell->level()) /
2328 static_cast<float>(n_levels)) *
2329 std::max(x_dimension, y_dimension);
2332 projection_decomposition = svg_project_point(point,
2338 out << static_cast<unsigned int>(
2340 ((projection_decomposition[0] - x_min_perspective) /
2341 x_dimension_perspective) *
2342 (width - (width / 100.) * 2. * margin_in_percent) +
2343 ((width / 100.) * margin_in_percent))
2345 <<
static_cast<unsigned int>(
2347 ((projection_decomposition[1] - y_min_perspective) /
2348 y_dimension_perspective) *
2353 point[0] = cell->vertex(1)[0];
2354 point[1] = cell->vertex(1)[1];
2356 projection_decomposition = svg_project_point(point,
2362 out << static_cast<unsigned int>(
2364 ((projection_decomposition[0] - x_min_perspective) /
2365 x_dimension_perspective) *
2366 (width - (width / 100.) * 2. * margin_in_percent) +
2367 ((width / 100.) * margin_in_percent))
2369 <<
static_cast<unsigned int>(
2371 ((projection_decomposition[1] - y_min_perspective) /
2372 y_dimension_perspective) *
2377 if (cell->n_vertices() == 4)
2379 point[0] = cell->vertex(3)[0];
2380 point[1] = cell->vertex(3)[1];
2382 projection_decomposition = svg_project_point(point,
2388 out << static_cast<unsigned int>(
2390 ((projection_decomposition[0] - x_min_perspective) /
2391 x_dimension_perspective) *
2392 (width - (width / 100.) * 2. * margin_in_percent) +
2393 ((width / 100.) * margin_in_percent))
2395 <<
static_cast<unsigned int>(
2397 ((projection_decomposition[1] - y_min_perspective) /
2398 y_dimension_perspective) *
2404 point[0] = cell->vertex(2)[0];
2405 point[1] = cell->vertex(2)[1];
2407 projection_decomposition = svg_project_point(point,
2413 out << static_cast<unsigned int>(
2415 ((projection_decomposition[0] - x_min_perspective) /
2416 x_dimension_perspective) *
2417 (width - (width / 100.) * 2. * margin_in_percent) +
2418 ((width / 100.) * margin_in_percent))
2420 <<
static_cast<unsigned int>(
2422 ((projection_decomposition[1] - y_min_perspective) /
2423 y_dimension_perspective) *
2428 point[0] = cell->vertex(0)[0];
2429 point[1] = cell->vertex(0)[1];
2431 projection_decomposition = svg_project_point(point,
2437 out << static_cast<unsigned int>(
2439 ((projection_decomposition[0] - x_min_perspective) /
2440 x_dimension_perspective) *
2441 (width - (width / 100.) * 2. * margin_in_percent) +
2442 ((width / 100.) * margin_in_percent))
2444 <<
static_cast<unsigned int>(
2446 ((projection_decomposition[1] - y_min_perspective) /
2447 y_dimension_perspective) *
2450 out <<
"\"/>" <<
'\n';
2457 point[0] = cell->center()[0];
2458 point[1] = cell->center()[1];
2464 (
static_cast<float>(cell->level()) /
2465 static_cast<float>(n_levels)) *
2466 std::max(x_dimension, y_dimension);
2469 const double distance_to_camera =
2470 std::hypot(point[0] - camera_position[0],
2471 point[1] - camera_position[1],
2472 point[2] - camera_position[2]);
2473 const double distance_factor =
2474 distance_to_camera / (2. *
std::max(x_dimension, y_dimension));
2476 projection_decomposition = svg_project_point(point,
2482 const unsigned int font_size_this_cell =
2483 static_cast<unsigned int>(
2485 cell_label_font_size *
2486 std::pow(.5, cell->level() - 4. + 3.5 * distance_factor));
2490 <<
static_cast<unsigned int>(
2492 ((projection_decomposition[0] - x_min_perspective) /
2493 x_dimension_perspective) *
2494 (width - (width / 100.) * 2. * margin_in_percent) +
2495 ((width / 100.) * margin_in_percent))
2497 <<
static_cast<unsigned int>(
2499 ((projection_decomposition[1] - y_min_perspective) /
2500 y_dimension_perspective) *
2502 0.5 * font_size_this_cell)
2503 <<
"\" style=\"font-size:" << font_size_this_cell <<
"px\">";
2507 out << cell->level();
2514 out << cell->index();
2522 out << static_cast<std::make_signed_t<types::material_id>>(
2523 cell->material_id());
2531 if (cell->is_active())
2532 out <<
static_cast<std::make_signed_t<types::subdomain_id>
>(
2533 cell->subdomain_id());
2545 out << static_cast<std::make_signed_t<types::subdomain_id>>(
2546 cell->level_subdomain_id());
2549 out <<
"</text>" <<
'\n';
2556 for (
auto faceIndex : cell->face_indices())
2558 if (cell->at_boundary(faceIndex))
2560 point[0] = cell->face(faceIndex)->vertex(0)[0];
2561 point[1] = cell->face(faceIndex)->vertex(0)[1];
2567 (
static_cast<float>(cell->level()) /
2568 static_cast<float>(n_levels)) *
2569 std::max(x_dimension, y_dimension);
2572 projection_decomposition =
2573 svg_project_point(point,
2579 out <<
" <line x1=\""
2580 <<
static_cast<unsigned int>(
2582 ((projection_decomposition[0] -
2583 x_min_perspective) /
2584 x_dimension_perspective) *
2586 (width / 100.) * 2. * margin_in_percent) +
2587 ((width / 100.) * margin_in_percent))
2589 <<
static_cast<unsigned int>(
2591 (
height / 100.) * margin_in_percent -
2592 ((projection_decomposition[1] -
2593 y_min_perspective) /
2594 y_dimension_perspective) *
2596 (
height / 100.) * 2. * margin_in_percent));
2598 point[0] = cell->face(faceIndex)->vertex(1)[0];
2599 point[1] = cell->face(faceIndex)->vertex(1)[1];
2605 (
static_cast<float>(cell->level()) /
2606 static_cast<float>(n_levels)) *
2607 std::max(x_dimension, y_dimension);
2610 projection_decomposition =
2611 svg_project_point(point,
2618 <<
static_cast<unsigned int>(
2620 ((projection_decomposition[0] -
2621 x_min_perspective) /
2622 x_dimension_perspective) *
2624 (width / 100.) * 2. * margin_in_percent) +
2625 ((width / 100.) * margin_in_percent))
2627 <<
static_cast<unsigned int>(
2629 (
height / 100.) * margin_in_percent -
2630 ((projection_decomposition[1] -
2631 y_min_perspective) /
2632 y_dimension_perspective) *
2634 (
height / 100.) * 2. * margin_in_percent))
2640 const double distance_to_camera =
2641 std::hypot(point[0] - camera_position[0],
2642 point[1] - camera_position[1],
2643 point[2] - camera_position[2]);
2644 const double distance_factor =
2645 distance_to_camera /
2646 (2. *
std::max(x_dimension, y_dimension));
2648 const unsigned int font_size_this_edge =
2649 static_cast<unsigned int>(
2650 .5 + .5 * cell_label_font_size *
2652 cell->level() - 4. +
2653 3.5 * distance_factor));
2655 point[0] = cell->face(faceIndex)->center()[0];
2656 point[1] = cell->face(faceIndex)->center()[1];
2662 (
static_cast<float>(cell->level()) /
2663 static_cast<float>(n_levels)) *
2664 std::max(x_dimension, y_dimension);
2667 projection_decomposition =
2668 svg_project_point(point,
2674 const unsigned int xc =
static_cast<unsigned int>(
2676 ((projection_decomposition[0] - x_min_perspective) /
2677 x_dimension_perspective) *
2679 (width / 100.) * 2. * margin_in_percent) +
2680 ((width / 100.) * margin_in_percent));
2681 const unsigned int yc =
static_cast<unsigned int>(
2683 ((projection_decomposition[1] - y_min_perspective) /
2684 y_dimension_perspective) *
2686 (
height / 100.) * 2. * margin_in_percent));
2688 out <<
" <circle cx=\"" << xc <<
"\" cy=\"" << yc
2689 <<
"\" r=\"" << font_size_this_edge <<
"\" />"
2692 out <<
" <text x=\"" << xc <<
"\" y=\"" << yc
2693 <<
"\" style=\"font-size:" << font_size_this_edge
2694 <<
"px\" dominant-baseline=\"middle\">"
2695 <<
static_cast<int>(
2696 cell->face(faceIndex)->boundary_id())
2697 <<
"</text>" <<
'\n';
2709 out <<
'\n' <<
" <!-- legend -->" <<
'\n';
2711 additional_width = 0;
2713 additional_width =
static_cast<unsigned int>(.5 + (
height / 100.) * 2.5);
2721 unsigned int line_offset = 0;
2722 out <<
" <rect x=\"" << width + additional_width <<
"\" y=\""
2723 <<
static_cast<unsigned int>(.5 + (
height / 100.) * margin_in_percent)
2725 <<
static_cast<unsigned int>(.5 + (
height / 100.) *
2726 (40. - margin_in_percent))
2727 <<
"\" height=\"" <<
static_cast<unsigned int>(.5 +
height * .215)
2730 out <<
" <text x=\""
2731 << width + additional_width +
2732 static_cast<unsigned int>(.5 + (
height / 100.) * 1.25)
2734 <<
static_cast<unsigned int>(.5 +
2735 (
height / 100.) * margin_in_percent +
2736 (++line_offset) * 1.5 * font_size)
2737 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2738 << font_size <<
"px\">"
2740 <<
"</text>" <<
'\n';
2744 out <<
" <text x=\""
2745 << width + additional_width +
2746 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2748 <<
static_cast<unsigned int>(.5 +
2749 (
height / 100.) * margin_in_percent +
2750 (++line_offset) * 1.5 * font_size)
2751 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2752 << font_size <<
"px\">"
2760 out <<
"</text>" <<
'\n';
2765 out <<
" <text x=\""
2766 << width + additional_width +
2767 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2769 <<
static_cast<unsigned int>(.5 +
2770 (
height / 100.) * margin_in_percent +
2771 (++line_offset) * 1.5 * font_size)
2772 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2773 << font_size <<
"px\">"
2780 out <<
"</text>" <<
'\n';
2785 out <<
" <text x=\""
2786 << width + additional_width +
2787 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2789 <<
static_cast<unsigned int>(.5 +
2790 (
height / 100.) * margin_in_percent +
2791 (++line_offset) * 1.5 * font_size)
2792 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2793 << font_size <<
"px\">"
2800 out <<
"</text>" <<
'\n';
2805 out <<
" <text x= \""
2806 << width + additional_width +
2807 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2809 <<
static_cast<unsigned int>(.5 +
2810 (
height / 100.) * margin_in_percent +
2811 (++line_offset) * 1.5 * font_size)
2812 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2813 << font_size <<
"px\">"
2819 out <<
"</text>" <<
'\n';
2824 out <<
" <text x= \""
2825 << width + additional_width +
2826 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2828 <<
static_cast<unsigned int>(.5 +
2829 (
height / 100.) * margin_in_percent +
2830 (++line_offset) * 1.5 * font_size)
2831 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2832 << font_size <<
"px\">"
2833 <<
"level_subdomain_id"
2834 <<
"</text>" <<
'\n';
2839 out <<
" <text x=\""
2840 << width + additional_width +
2841 static_cast<unsigned int>(.5 + (
height / 100.) * 1.25)
2843 <<
static_cast<unsigned int>(.5 +
2844 (
height / 100.) * margin_in_percent +
2845 (++line_offset) * 1.5 * font_size)
2846 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2847 << font_size <<
"px\">"
2849 <<
"</text>" <<
'\n';
2851 out <<
" <text x= \""
2852 << width + additional_width +
2853 static_cast<unsigned int>(.5 + (
height / 100.) * 2.)
2855 <<
static_cast<unsigned int>(.5 +
2856 (
height / 100.) * margin_in_percent +
2857 (++line_offset) * 1.5 * font_size)
2858 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2859 << font_size <<
"px\">"
2861 <<
"</text>" <<
'\n';
2869 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2870 <<
static_cast<unsigned int>(
2871 .5 + (
height / 100.) * margin_in_percent + 13.75 * font_size)
2872 <<
"\" style=\"text-anchor:start; font-size:" << font_size <<
"px\">"
2881 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
2883 out <<
" <text x=\"" << width + additional_width <<
"\" y=\""
2884 <<
static_cast<unsigned int>(
2885 .5 + (
height / 100.) * (margin_in_percent + 29.) -
2887 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2888 << font_size <<
"px\">";
2893 out <<
"material_id";
2896 out <<
"level_number";
2899 out <<
"subdomain_id";
2902 out <<
"level_subdomain_id";
2908 out <<
"</text>" <<
'\n';
2910 unsigned int element_height =
static_cast<unsigned int>(
2911 ((
height / 100.) * (71. - 2. * margin_in_percent)) / n);
2912 unsigned int element_width =
2913 static_cast<unsigned int>(.5 + (
height / 100.) * 2.5);
2915 int labeling_index = 0;
2916 auto materials_it = materials.begin();
2917 auto levels_it = levels.begin();
2918 auto subdomains_it = subdomains.begin();
2919 auto level_subdomains_it = level_subdomains.begin();
2921 for (
unsigned int index = 0; index < n; ++index)
2926 labeling_index = *materials_it++;
2929 labeling_index = *levels_it++;
2932 labeling_index = *subdomains_it++;
2935 labeling_index = *level_subdomains_it++;
2941 out <<
" <rect class=\"r" << labeling_index <<
"\" x=\""
2942 << width + additional_width <<
"\" y=\""
2943 <<
static_cast<unsigned int>(.5 + (
height / 100.) *
2944 (margin_in_percent + 29)) +
2945 (n - index - 1) * element_height
2946 <<
"\" width=\"" << element_width <<
"\" height=\""
2947 << element_height <<
"\"/>" <<
'\n';
2949 out <<
" <text x=\""
2950 << width + additional_width + 1.5 * element_width <<
"\" y=\""
2951 <<
static_cast<unsigned int>(.5 + (
height / 100.) *
2952 (margin_in_percent + 29)) +
2953 (n - index - 1 + .5) * element_height +
2954 static_cast<unsigned int>(.5 + font_size * .35)
2956 <<
" style=\"text-anchor:start; font-size:"
2957 <<
static_cast<unsigned int>(.5 + font_size) <<
"px";
2959 if (index == 0 || index == n - 1)
2960 out <<
"; font-weight:bold";
2962 out <<
"\">" << labeling_index;
2969 out <<
"</text>" <<
'\n';
2977 out <<
'\n' <<
"</svg>";
2993template <
int dim,
int spacedim>
2996 std::ostream &out)
const
3003 const std::time_t time1 = std::time(
nullptr);
3004 const std::tm *time = std::localtime(&time1);
3008 <<
"\n# This file was generated by the deal.II library."
3009 <<
"\n# Date = " << time->tm_year + 1900 <<
"/" << std::setfill(
'0')
3010 << std::setw(2) << time->tm_mon + 1 <<
"/" << std::setfill(
'0')
3011 << std::setw(2) << time->tm_mday <<
"\n# Time = " << std::setfill(
'0')
3012 << std::setw(2) << time->tm_hour <<
":" << std::setfill(
'0')
3013 << std::setw(2) << time->tm_min <<
":" << std::setfill(
'0')
3014 << std::setw(2) << time->tm_sec <<
"\n#"
3015 <<
"\n# For a description of the MathGL script format see the MathGL manual. "
3017 <<
"\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
3018 <<
"\n# be quickly viewed in a graphical environment using \'mglview\'. "
3024 const std::string axes =
"xyz";
3039 out <<
"\nsetsize 800 800";
3040 out <<
"\nrotate 0 0";
3043 out <<
"\nsetsize 800 800";
3044 out <<
"\nrotate 60 40";
3053 <<
"\n# Vertex ordering."
3054 <<
"\n# list <vertex order> <vertex indices>"
3063 out <<
"\nlist f 0 1 2 3" <<
'\n';
3067 <<
"\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"
3076 <<
"\n# List of vertices."
3077 <<
"\n# list <id> <vertices>"
3085 for (
unsigned int i = 0; i < dim; ++i)
3092 out <<
"\nlist " << axes[i] << cell->active_cell_index() <<
" ";
3094 out << cell->vertex(j)[i] <<
" ";
3101 <<
"\n# List of cells to quadplot."
3102 <<
"\n# quadplot <vertex order> <id> <style>"
3106 out <<
"\nquadplot f ";
3107 for (
unsigned int j = 0; j < dim; ++j)
3108 out << axes[j] << i <<
" ";
3133 template <
int dim,
int spacedim,
typename IteratorType>
3135 generate_triangulation_patches(
3137 const IteratorType &
begin,
3141 for (
auto cell =
begin; cell !=
end; ++cell)
3146 patch.
data.reinit(5, cell->n_vertices());
3150 patch.
vertices[v] = cell->vertex(v);
3151 patch.
data(0, v) = cell->level();
3153 static_cast<std::make_signed_t<types::manifold_id>
>(
3154 cell->manifold_id());
3156 static_cast<std::make_signed_t<types::material_id>
>(
3157 cell->material_id());
3158 if (cell->is_active())
3160 static_cast<std::make_signed_t<types::subdomain_id>
>(
3161 cell->subdomain_id());
3163 patch.
data(3, v) = -1;
3165 static_cast<std::make_signed_t<types::subdomain_id>
>(
3166 cell->level_subdomain_id());
3168 patches.push_back(patch);
3174 std::vector<std::string>
3175 triangulation_patch_data_names()
3177 std::vector<std::string> v(5);
3182 v[4] =
"level_subdomain";
3189 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3192 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3194 std::vector<bool> flags;
3198 for (
auto face : tria.active_face_iterators())
3199 for (
const auto
l : face->line_indices())
3201 const auto line = face->line(l);
3202 if (line->user_flag_set() || line->has_children())
3205 line->set_user_flag();
3206 if (line->at_boundary())
3207 res.emplace_back(line);
3218 template <
int dim,
int spacedim>
3219 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3231 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3234 std::vector<typename Triangulation<3, 3>::active_line_iterator> res;
3236 std::vector<bool> flags;
3240 for (
auto face : tria.active_face_iterators())
3241 for (
const auto
l : face->line_indices())
3243 const auto line = face->line(l);
3244 if (line->user_flag_set() || line->has_children())
3247 line->set_user_flag();
3249 (line->boundary_id() != 0 &&
3251 res.emplace_back(line);
3261 template <
int dim,
int spacedim>
3262 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3273 template <
int dim,
int spacedim>
3274 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3277 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3281 for (
auto face : tria.active_face_iterators())
3284 res.push_back(face);
3295 template <
int dim,
int spacedim>
3296 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3299 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3303 for (
auto face : tria.active_face_iterators())
3306 (face->boundary_id() != 0 &&
3308 res.push_back(face);
3316template <
int dim,
int spacedim>
3319 std::ostream &out)
const
3324 const std::vector<Point<spacedim>> &vertices = tria.
get_vertices();
3326 const auto n_vertices = vertices.size();
3328 out <<
"# vtk DataFile Version 3.0\n"
3329 <<
"Triangulation generated with deal.II\n"
3331 <<
"DATASET UNSTRUCTURED_GRID\n"
3332 <<
"POINTS " << n_vertices <<
" double\n";
3335 for (
const auto &v : vertices)
3338 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
3344 get_relevant_face_iterators(tria) :
3345 get_boundary_face_iterators(tria);
3347 get_relevant_edge_iterators(tria) :
3348 get_boundary_edge_iterators(tria);
3354 "At least one of the flags (output_cells, output_faces, output_edges) has to be enabled!"));
3371 cells_size += cell->n_vertices() + 1;
3374 for (
const auto &face : faces)
3375 cells_size += face->n_vertices() + 1;
3378 for (
const auto &edge : edges)
3379 cells_size += edge->n_vertices() + 1;
3383 out <<
"\nCELLS " << n_cells <<
' ' << cells_size <<
'\n';
3398 static const std::array<int, 8> deal_to_vtk_cell_type = {
3399 {1, 3, 5, 9, 10, 14, 13, 12}};
3400 static const std::array<unsigned int, 8> vtk_to_deal_hypercube = {
3401 {0, 1, 3, 2, 4, 5, 7, 6}};
3407 out << cell->n_vertices();
3408 for (
const unsigned int i : cell->vertex_indices())
3411 const auto reference_cell = cell->reference_cell();
3417 out << cell->vertex_index(vtk_to_deal_hypercube[i]);
3421 out << cell->vertex_index(i);
3424 static const std::array<unsigned int, 5> permutation_table{
3426 out << cell->vertex_index(permutation_table[i]);
3434 for (
const auto &face : faces)
3436 out << face->n_vertices();
3437 for (
const unsigned int i : face->vertex_indices())
3441 face->n_vertices() ?
3442 vtk_to_deal_hypercube[i] :
3448 for (
const auto &edge : edges)
3451 for (
const unsigned int i : edge->vertex_indices())
3452 out <<
' ' << edge->vertex_index(i);
3457 out <<
"\nCELL_TYPES " << n_cells <<
'\n';
3461 out << deal_to_vtk_cell_type[
static_cast<int>(cell->reference_cell())]
3467 for (
const auto &face : faces)
3468 out << deal_to_vtk_cell_type[
static_cast<int>(face->reference_cell())]
3474 for (
const auto &edge : edges)
3475 out << deal_to_vtk_cell_type[
static_cast<int>(edge->reference_cell())]
3478 out <<
"\n\nCELL_DATA " << n_cells <<
'\n'
3479 <<
"SCALARS MaterialID int 1\n"
3480 <<
"LOOKUP_TABLE default\n";
3487 out << static_cast<std::make_signed_t<types::material_id>>(
3488 cell->material_id())
3495 for (
const auto &face : faces)
3497 out << static_cast<std::make_signed_t<types::boundary_id>>(
3498 face->boundary_id())
3505 for (
const auto &edge : edges)
3507 out << static_cast<std::make_signed_t<types::boundary_id>>(
3508 edge->boundary_id())
3513 out <<
"\n\nSCALARS ManifoldID int 1\n"
3514 <<
"LOOKUP_TABLE default\n";
3521 out << static_cast<std::make_signed_t<types::manifold_id>>(
3522 cell->manifold_id())
3529 for (
const auto &face : faces)
3531 out << static_cast<std::make_signed_t<types::manifold_id>>(
3532 face->manifold_id())
3539 for (
const auto &edge : edges)
3541 out << static_cast<std::make_signed_t<types::manifold_id>>(
3542 edge->manifold_id())
3555template <
int dim,
int spacedim>
3558 std::ostream &out)
const
3566 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3568 generate_triangulation_patches(patches, tria.
begin_active(), tria.
end());
3573 triangulation_patch_data_names(),
3575 std::tuple<
unsigned int,
3583 out <<
" </UnstructuredGrid>\n";
3584 out <<
"<dealiiData encoding=\"base64\">";
3585 std::stringstream outstring;
3586 boost::archive::binary_oarchive ia(outstring);
3590 out <<
"\n</dealiiData>\n";
3591 out <<
"</VTKFile>\n";
3602template <
int dim,
int spacedim>
3606 const std::string &filename_without_extension,
3607 const bool view_levels,
3608 const bool include_artificial)
const
3610 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3611 const unsigned int n_datasets = 4;
3612 std::vector<std::string> data_names;
3613 data_names.emplace_back(
"level");
3614 data_names.emplace_back(
"subdomain");
3615 data_names.emplace_back(
"level_subdomain");
3616 data_names.emplace_back(
"proc_writing");
3622 const auto &reference_cell = reference_cells[0];
3624 const unsigned int n_q_points = reference_cell.n_vertices();
3630 if (cell->has_children())
3632 if (!include_artificial &&
3636 else if (!include_artificial)
3638 if (cell->has_children() &&
3641 else if (cell->is_active() &&
3642 cell->level_subdomain_id() ==
3649 patch.
data.reinit(n_datasets, n_q_points);
3653 for (
unsigned int vertex = 0; vertex < n_q_points; ++vertex)
3655 patch.
vertices[vertex] = cell->vertex(vertex);
3656 patch.
data(0, vertex) = cell->level();
3657 if (cell->is_active())
3658 patch.
data(1, vertex) =
static_cast<double>(
3659 static_cast<std::make_signed_t<types::subdomain_id>
>(
3660 cell->subdomain_id()));
3662 patch.
data(1, vertex) = -1.0;
3663 patch.
data(2, vertex) =
static_cast<double>(
3664 static_cast<std::make_signed_t<types::subdomain_id>
>(
3665 cell->level_subdomain_id()));
3669 for (
auto f : reference_cell.face_indices())
3671 patches.push_back(patch);
3677 std::string new_file = filename_without_extension +
".vtu";
3681 new_file = filename_without_extension +
".proc" +
3686 if (tr->locally_owned_subdomain() == 0)
3688 std::vector<std::string> filenames;
3693 std::size_t pos = filename_without_extension.find_last_of(
'/');
3694 if (pos == std::string::npos)
3701 for (
unsigned int i = 0; i <
n_procs; ++i)
3702 filenames.push_back(filename_without_extension.substr(pos) +
3706 const std::string pvtu_filename =
3707 (filename_without_extension +
".pvtu");
3708 std::ofstream pvtu_output(pvtu_filename);
3727 std::ofstream out(new_file);
3729 std::tuple<
unsigned int,
3735 patches, data_names, vector_data_ranges,
vtu_flags, out);
3791template <
int dim,
int spacedim>
3796 unsigned int n_faces = 0;
3799 if ((face->at_boundary()) && (face->boundary_id() != 0))
3807template <
int dim,
int spacedim>
3814 std::vector<bool> line_flags;
3818 .clear_user_flags_line();
3820 unsigned int n_lines = 0;
3823 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3824 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3825 (cell->line(l)->user_flag_set() ==
false))
3828 cell->line(l)->set_user_flag();
3843 const unsigned int next_element_index,
3844 std::ostream &)
const
3846 return next_element_index;
3852 const unsigned int next_element_index,
3853 std::ostream &)
const
3855 return next_element_index;
3860 const unsigned int next_element_index,
3861 std::ostream &)
const
3863 return next_element_index;
3869 const unsigned int next_element_index,
3870 std::ostream &)
const
3872 return next_element_index;
3877 const unsigned int next_element_index,
3878 std::ostream &)
const
3880 return next_element_index;
3886 const unsigned int next_element_index,
3887 std::ostream &)
const
3889 return next_element_index;
3895 const unsigned int next_element_index,
3896 std::ostream &)
const
3898 return next_element_index;
3903 const unsigned int next_element_index,
3904 std::ostream &)
const
3906 return next_element_index;
3911template <
int dim,
int spacedim>
3914 const unsigned int next_element_index,
3915 std::ostream &out)
const
3917 unsigned int current_element_index = next_element_index;
3920 if (face->at_boundary() && (face->boundary_id() != 0))
3922 out << current_element_index <<
' '
3923 << face->reference_cell().gmsh_element_type() <<
' ';
3924 out << static_cast<unsigned int>(face->boundary_id()) <<
' '
3925 <<
static_cast<unsigned int>(face->boundary_id()) <<
' '
3926 << face->n_vertices();
3928 for (
const unsigned int vertex : face->vertex_indices())
3932 << face->vertex_index(
3937 out <<
' ' << face->vertex_index(vertex) + 1;
3943 ++current_element_index;
3945 return current_element_index;
3950template <
int dim,
int spacedim>
3953 const unsigned int next_element_index,
3954 std::ostream &out)
const
3956 unsigned int current_element_index = next_element_index;
3961 std::vector<bool> line_flags;
3965 .clear_user_flags_line();
3968 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
3969 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3970 (cell->line(l)->user_flag_set() ==
false))
3972 out << next_element_index <<
' '
3974 out << static_cast<unsigned int>(cell->line(l)->boundary_id()) <<
' '
3975 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
3978 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
3980 << cell->line(l)->vertex_index(
3988 ++current_element_index;
3989 cell->line(l)->set_user_flag();
3997 return current_element_index;
4004 const unsigned int next_element_index,
4005 std::ostream &)
const
4007 return next_element_index;
4012 const unsigned int next_element_index,
4013 std::ostream &)
const
4015 return next_element_index;
4020 const unsigned int next_element_index,
4021 std::ostream &)
const
4023 return next_element_index;
4028 const unsigned int next_element_index,
4029 std::ostream &)
const
4031 return next_element_index;
4036 const unsigned int next_element_index,
4037 std::ostream &)
const
4039 return next_element_index;
4045 const unsigned int next_element_index,
4046 std::ostream &)
const
4048 return next_element_index;
4054 const unsigned int next_element_index,
4055 std::ostream &)
const
4057 return next_element_index;
4062 const unsigned int next_element_index,
4063 std::ostream &)
const
4065 return next_element_index;
4070template <
int dim,
int spacedim>
4073 const unsigned int next_element_index,
4074 std::ostream &out)
const
4076 unsigned int current_element_index = next_element_index;
4080 if (face->at_boundary() && (face->boundary_id() != 0))
4082 out << current_element_index <<
" "
4083 <<
static_cast<unsigned int>(face->boundary_id()) <<
" ";
4096 for (
unsigned int vertex = 0;
4097 vertex < GeometryInfo<dim>::vertices_per_face;
4099 out << face->vertex_index(
4105 ++current_element_index;
4107 return current_element_index;
4112template <
int dim,
int spacedim>
4115 const unsigned int next_element_index,
4116 std::ostream &out)
const
4118 unsigned int current_element_index = next_element_index;
4123 std::vector<bool> line_flags;
4127 .clear_user_flags_line();
4130 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
4131 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
4132 (cell->line(l)->user_flag_set() ==
false))
4134 out << current_element_index <<
" "
4135 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
4138 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
4139 out << cell->line(l)->vertex_index(
4148 ++current_element_index;
4149 cell->line(l)->set_user_flag();
4156 return current_element_index;
4173 template <
int spacedim>
4177 while (points.size() > 2)
4180 first_difference /= first_difference.
norm();
4182 second_difference /= second_difference.
norm();
4184 if ((first_difference - second_difference).norm() < 1e-10)
4185 points.erase(points.begin() + 1);
4193 template <
int spacedim>
4202 for (
const auto &cell : tria.active_cell_iterators())
4205 out <<
"# cell " << cell <<
'\n';
4207 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4208 << cell->material_id() <<
'\n'
4209 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4210 << cell->material_id() <<
'\n'
4223 template <
int spacedim>
4234 const unsigned int n_additional_points =
4236 const unsigned int n_points = 2 + n_additional_points;
4241 std::vector<
Point<dim - 1>> boundary_points;
4242 if (mapping !=
nullptr)
4244 boundary_points.resize(n_points);
4245 boundary_points[0][0] = 0;
4246 boundary_points[n_points - 1][0] = 1;
4247 for (
unsigned int i = 1; i < n_points - 1; ++i)
4248 boundary_points[i][0] = 1. * i / (n_points - 1);
4250 const std::vector<double> dummy_weights(n_points, 1. / n_points);
4251 const Quadrature<dim - 1> quadrature(boundary_points, dummy_weights);
4254 ReferenceCells::get_hypercube<dim>(), quadrature);
4257 static constexpr std::array<unsigned int, 8> local_vertex_numbering = {
4258 {0, 1, 5, 4, 2, 3, 7, 6}};
4259 for (
const auto &cell : tria.active_cell_iterators())
4262 out <<
"# cell " << cell <<
'\n';
4264 if (mapping ==
nullptr ||
4275 out << cell->vertex(dim == 3 ?
4276 local_vertex_numbering[i] :
4280 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4281 << cell->material_id() <<
'\n'
4289 for (
const unsigned int face_no :
4292 const typename ::Triangulation<dim,
4293 spacedim>::face_iterator
4294 face = cell->face(face_no);
4295 if (dim != spacedim || face->at_boundary() ||
4301 std::vector<Point<spacedim>> line_points;
4306 cell->reference_cell(),
4308 cell->combined_face_orientation(face_no),
4310 line_points.reserve(n_points);
4311 for (
unsigned int i = 0; i < n_points; ++i)
4312 line_points.push_back(
4314 cell, q_projector.
point(offset + i)));
4315 internal::remove_collinear_points(line_points);
4321 out <<
'\n' <<
'\n';
4327 out << face->vertex(0) <<
' ' << cell->level() <<
' '
4328 << cell->material_id() <<
'\n'
4329 << face->vertex(1) <<
' ' << cell->level() <<
' '
4330 << cell->material_id() <<
'\n'
4346 template <
int spacedim>
4357 const unsigned int n_additional_points =
4359 const unsigned int n_points = 2 + n_additional_points;
4363 std::unique_ptr<Quadrature<dim>> q_projector;
4364 std::vector<Point<1>> boundary_points;
4365 if (mapping !=
nullptr)
4367 boundary_points.resize(n_points);
4368 boundary_points[0][0] = 0;
4369 boundary_points[n_points - 1][0] = 1;
4370 for (
unsigned int i = 1; i < n_points - 1; ++i)
4371 boundary_points[i][0] = 1. * i / (n_points - 1);
4373 const std::vector<double> dummy_weights(n_points, 1. / n_points);
4374 const Quadrature<1> quadrature1d(boundary_points, dummy_weights);
4377 const QIterated<dim - 1> quadrature(quadrature1d, 1);
4378 q_projector = std::make_unique<Quadrature<dim>>(
4380 ReferenceCells::get_hypercube<dim>(), quadrature));
4383 for (
const auto &cell : tria.active_cell_iterators())
4386 out <<
"# cell " << cell <<
'\n';
4388 if (mapping ==
nullptr || n_points == 2 ||
4389 (!cell->has_boundary_lines() &&
4395 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4396 << cell->material_id() <<
'\n'
4397 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4398 << cell->material_id() <<
'\n'
4399 << cell->vertex(5) <<
' ' << cell->level() <<
' '
4400 << cell->material_id() <<
'\n'
4401 << cell->vertex(4) <<
' ' << cell->level() <<
' '
4402 << cell->material_id() <<
'\n'
4403 << cell->vertex(0) <<
' ' << cell->level() <<
' '
4404 << cell->material_id() <<
'\n'
4407 out << cell->vertex(2) <<
' ' << cell->level() <<
' '
4408 << cell->material_id() <<
'\n'
4409 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4410 << cell->material_id() <<
'\n'
4411 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4412 << cell->material_id() <<
'\n'
4413 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4414 << cell->material_id() <<
'\n'
4415 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4416 << cell->material_id() <<
'\n'
4420 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4421 << cell->material_id() <<
'\n'
4422 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4423 << cell->material_id() <<
'\n'
4425 out << cell->vertex(1) <<
' ' << cell->level() <<
' '
4426 << cell->material_id() <<
'\n'
4427 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4428 << cell->material_id() <<
'\n'
4430 out << cell->vertex(5) <<
' ' << cell->level() <<
' '
4431 << cell->material_id() <<
'\n'
4432 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4433 << cell->material_id() <<
'\n'
4435 out << cell->vertex(4) <<
' ' << cell->level() <<
' '
4436 << cell->material_id() <<
'\n'
4437 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4438 << cell->material_id() <<
'\n'
4444 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
4446 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4447 << cell->material_id() <<
'\n';
4451 for (
const unsigned int v : {3, 1})
4453 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4454 << cell->material_id() <<
'\n';
4465 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
4467 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4468 << cell->material_id() <<
'\n';
4472 for (
const unsigned int v : {1, 4})
4474 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4475 << cell->material_id() <<
'\n';
4479 for (
const unsigned int v : {2, 5})
4481 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4482 << cell->material_id() <<
'\n';
4489 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
4491 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4492 << cell->material_id() <<
'\n';
4496 for (
const unsigned int v : {2, 4, 3})
4498 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4499 << cell->material_id() <<
'\n';
4510 for (
const unsigned int face_no :
4513 const typename ::Triangulation<dim,
4514 spacedim>::face_iterator
4515 face = cell->face(face_no);
4517 if (face->at_boundary() &&
4522 cell->reference_cell(),
4524 cell->combined_face_orientation(face_no),
4525 n_points * n_points);
4526 for (
unsigned int i = 0; i < n_points - 1; ++i)
4527 for (
unsigned int j = 0; j < n_points - 1; ++j)
4532 q_projector->point(offset + i * n_points + j));
4533 out << p0 <<
' ' << cell->level() <<
' '
4534 << cell->material_id() <<
'\n';
4538 offset + (i + 1) * n_points + j)))
4539 <<
' ' << cell->level() <<
' '
4540 << cell->material_id() <<
'\n';
4544 offset + (i + 1) * n_points + j + 1)))
4545 <<
' ' << cell->level() <<
' '
4546 << cell->material_id() <<
'\n';
4549 q_projector->point(offset + i * n_points +
4551 <<
' ' << cell->level() <<
' '
4552 << cell->material_id() <<
'\n';
4554 out << p0 <<
' ' << cell->level() <<
' '
4555 << cell->material_id() <<
'\n';
4556 out <<
'\n' <<
'\n';
4561 for (
unsigned int l = 0;
4562 l < GeometryInfo<dim>::lines_per_face;
4565 const typename ::Triangulation<dim, spacedim>::
4566 line_iterator line = face->line(l);
4569 &
v1 = line->vertex(1);
4570 if (line->at_boundary() ||
4576 std::vector<Point<spacedim>> line_points;
4585 line_points.reserve(n_points);
4586 for (
unsigned int i = 0; i < n_points; ++i)
4587 line_points.push_back(
4590 (1 - boundary_points[i][0]) * u0 +
4591 boundary_points[i][0] * u1));
4592 internal::remove_collinear_points(line_points);
4595 << static_cast<unsigned
int>(
4600 out <<
v0 <<
' ' << cell->level() <<
' '
4601 << cell->material_id() <<
'\n'
4602 <<
v1 <<
' ' << cell->level() <<
' '
4603 << cell->material_id() <<
'\n';
4605 out <<
'\n' <<
'\n';
4622template <
int dim,
int spacedim>
4646 const unsigned int l)
4666 write_eps(const ::Triangulation<1, 2> &,
4676 write_eps(const ::Triangulation<1, 3> &,
4686 write_eps(const ::Triangulation<2, 3> &,
4697 template <
int dim,
int spacedim>
4699 write_eps(const ::Triangulation<dim, spacedim> &tria,
4705 using LineList = std::list<LineEntry>;
4745 for (
const auto &cell : tria.active_cell_iterators())
4746 for (
const unsigned
int line_no : cell->line_indices())
4748 typename ::Triangulation<dim, spacedim>::line_iterator
4749 line = cell->line(line_no);
4761 if (!line->has_children() &&
4762 (mapping ==
nullptr || !line->at_boundary()))
4782 line_list.emplace_back(
4783 Point<2>(line->vertex(0)[0], line->vertex(0)[1]),
4784 Point<2>(line->vertex(1)[0], line->vertex(1)[1]),
4785 line->user_flag_set(),
4795 if (mapping !=
nullptr)
4802 std::vector<
Point<dim - 1>> boundary_points(n_points);
4804 for (
unsigned int i = 0; i < n_points; ++i)
4805 boundary_points[i][0] = 1. * (i + 1) / (n_points + 1);
4807 const Quadrature<dim - 1> quadrature(boundary_points);
4810 ReferenceCells::get_hypercube<dim>(), quadrature));
4816 for (
const auto &cell : tria.active_cell_iterators())
4820 const typename ::Triangulation<dim, spacedim>::
4821 face_iterator face = cell->face(face_no);
4823 if (face->at_boundary())
4835 cell->reference_cell(),
4837 cell->combined_face_orientation(face_no),
4839 for (
unsigned int i = 0; i < n_points; ++i)
4843 cell, q_projector.point(offset + i)));
4844 const Point<2> p1(p1_dim[0], p1_dim[1]);
4846 line_list.emplace_back(p0,
4848 face->user_flag_set(),
4855 const Point<2> p1(p1_dim[0], p1_dim[1]);
4856 line_list.emplace_back(p0,
4858 face->user_flag_set(),
4892 const double z_angle = eps_flags_3.azimut_angle;
4893 const double turn_angle = eps_flags_3.turn_angle;
4895 -
std::sin(z_angle * 2. * pi / 360.) *
4896 std::sin(turn_angle * 2. * pi / 360.),
4897 +
std::sin(z_angle * 2. * pi / 360.) *
4898 std::cos(turn_angle * 2. * pi / 360.),
4899 -
std::cos(z_angle * 2. * pi / 360.));
4907 ((
Point<dim>(0, 0, 1) * view_direction) * view_direction);
4916 ((
Point<dim>(1, 0, 0) * view_direction) * view_direction) -
4917 ((
Point<dim>(1, 0, 0) * unit_vector1) * unit_vector1));
4921 for (
const auto &cell : tria.active_cell_iterators())
4922 for (
const unsigned
int line_no : cell->line_indices())
4924 typename ::Triangulation<dim, spacedim>::line_iterator
4925 line = cell->line(line_no);
4926 line_list.emplace_back(
4927 Point<2>(line->vertex(0) * unit_vector2,
4928 line->vertex(0) * unit_vector1),
4929 Point<2>(line->vertex(1) * unit_vector2,
4930 line->vertex(1) * unit_vector1),
4931 line->user_flag_set(),
4947 double x_min = tria.begin_active()->vertex(0)[0];
4948 double x_max = x_min;
4949 double y_min = tria.begin_active()->vertex(0)[1];
4950 double y_max = y_min;
4951 unsigned int max_level = line_list.begin()->level;
4953 for (LineList::const_iterator line = line_list.begin();
4954 line != line_list.end();
4957 x_min =
std::min(x_min, line->first[0]);
4958 x_min =
std::min(x_min, line->second[0]);
4960 x_max =
std::max(x_max, line->first[0]);
4961 x_max =
std::max(x_max, line->second[0]);
4963 y_min =
std::min(y_min, line->first[1]);
4964 y_min =
std::min(y_min, line->second[1]);
4966 y_max =
std::max(y_max, line->first[1]);
4967 y_max =
std::max(y_max, line->second[1]);
4969 max_level =
std::max(max_level, line->level);
4977 const double scale =
4978 (eps_flags_base.
size /
4989 std::time_t time1 = std::time(
nullptr);
4990 std::tm *time = std::localtime(&time1);
4991 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4992 <<
"%%Title: deal.II Output" <<
'\n'
4993 <<
"%%Creator: the deal.II library" <<
'\n'
4994 <<
"%%Creation Date: " << time->tm_year + 1900 <<
"/"
4995 << time->tm_mon + 1 <<
"/" << time->tm_mday <<
" - "
4996 << time->tm_hour <<
":" << std::setw(2) << time->tm_min <<
":"
4997 << std::setw(2) << time->tm_sec <<
'\n'
4998 <<
"%%BoundingBox: "
5002 <<
static_cast<unsigned int>(
5003 std::floor(((x_max - x_min) * scale) + 1))
5005 <<
static_cast<unsigned int>(
5006 std::floor(((y_max - y_min) * scale) + 1))
5015 out <<
"/m {moveto} bind def" <<
'\n'
5016 <<
"/x {lineto stroke} bind def" <<
'\n'
5017 <<
"/b {0 0 0 setrgbcolor} def" <<
'\n'
5018 <<
"/r {1 0 0 setrgbcolor} def" <<
'\n';
5025 out <<
"/l { neg " << (max_level) <<
" add "
5026 << (0.66666 /
std::max(1U, (max_level - 1)))
5027 <<
" mul 1 0.8 sethsbcolor} def" <<
'\n';
5037 if ((dim == 2) && (eps_flags_2.write_cell_numbers ||
5038 eps_flags_2.write_vertex_numbers))
5041 << (
"/R {rmoveto} bind def\n"
5042 "/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n"
5043 "dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n"
5044 "currentdict end definefont\n"
5045 "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5046 "[ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n"
5047 "{show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n"
5048 "{2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n"
5049 "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5050 "5 get stringwidth pop add}\n"
5051 "{pop} ifelse} forall} bind def\n"
5052 "/MCshow { currentpoint stroke m\n"
5053 "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
5057 out <<
"%%EndProlog" <<
'\n' <<
'\n';
5060 out << eps_flags_base.
line_width <<
" setlinewidth" <<
'\n';
5064 const Point<2> offset(x_min, y_min);
5066 for (LineList::const_iterator line = line_list.begin();
5067 line != line_list.end();
5070 out << line->level <<
" l " << (line->first - offset) *
scale <<
" m "
5071 << (line->second - offset) * scale <<
" x" <<
'\n';
5077 << (line->
second - offset) *
scale <<
" x" <<
'\n';
5081 if ((dim == 2) && (eps_flags_2.write_cell_numbers ==
true))
5083 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5085 for (
const auto &cell : tria.active_cell_iterators())
5087 out << (cell->center()[0] - offset[0]) * scale <<
' '
5088 << (cell->center()[1] - offset[1]) * scale <<
" m" <<
'\n'
5089 <<
"[ [(Helvetica) 12.0 0.0 true true (";
5090 if (eps_flags_2.write_cell_number_level)
5093 out << cell->index();
5096 <<
"] -6 MCshow" <<
'\n';
5101 if ((dim == 2) && (eps_flags_2.write_vertex_numbers ==
true))
5103 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5109 std::set<unsigned int> treated_vertices;
5110 for (
const auto &cell : tria.active_cell_iterators())
5112 if (treated_vertices.find(cell->vertex_index(vertex_no)) ==
5113 treated_vertices.
end())
5115 treated_vertices.insert(cell->vertex_index(vertex_no));
5117 out << (cell->vertex(vertex_no)[0] - offset[0]) * scale <<
' '
5118 << (cell->vertex(vertex_no)[1] - offset[1]) * scale
5120 <<
"[ [(Helvetica) 10.0 0.0 true true ("
5121 << cell->vertex_index(vertex_no) <<
")] "
5122 <<
"] -6 MCshow" <<
'\n';
5126 out <<
"showpage" <<
'\n';
5138template <
int dim,
int spacedim>
5148template <
int dim,
int spacedim>
5155 switch (output_format)
5205template <
int dim,
int spacedim>
5216#include "grid/grid_out.inst"
* * for(const auto &cell :triangulation.active_cell_iterators())
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< dim > &reference_cell, const unsigned int face_no, const types::geometric_orientation combined_orientation, const unsigned int n_quadrature_points)
Class which transforms dim - 1-dimensional quadrature rules to dim-dimensional face quadratures.
static Quadrature< dim > project_to_all_faces(const ReferenceCell< dim > &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
const Point< dim > & point(const unsigned int i) 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
cell_iterator end() const
const std::vector< bool > & get_used_vertices() const
const std::vector< ReferenceCell< dim > > & get_reference_cells() const
active_cell_iterator begin_active(const unsigned int level=0) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
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)
static ::ExceptionBase & ExcNeedsGMSHAPI()
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
const unsigned int n_procs
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)
* * if(update_pressure &update_flags) * compute_pressure(constitutive_request
* * * * std::vector< Number > ThermoPlasticMaterial< dim, ViscoplasticYieldLaw, Number >::get_state_parameters const
constexpr ReferenceCell< 3 > Hexahedron
constexpr ReferenceCell< 2 > Quadrilateral
constexpr ReferenceCell< 1 > Line
constexpr ReferenceCell< 2 > Triangle
constexpr ReferenceCell< 3 > Tetrahedron
constexpr ReferenceCell< 3 > Pyramid
constexpr ReferenceCell< 3 > Wedge
constexpr ReferenceCell< 0 > Vertex
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)
constexpr unsigned int invalid_unsigned_int
constexpr types::boundary_id internal_face_boundary_id
constexpr types::boundary_id invalid_boundary_id
constexpr types::manifold_id flat_manifold_id
constexpr types::subdomain_id artificial_subdomain_id
typename type_identity< T >::type type_identity_t
::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< dim > 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