33#include <boost/archive/binary_oarchive.hpp>
35#ifdef DEAL_II_GMSH_WITH_API
54 const bool write_faces,
55 const bool write_diameter,
56 const bool write_measure,
57 const bool write_all_faces)
58 : write_cells(write_cells)
59 , write_faces(write_faces)
60 , write_diameter(write_diameter)
61 , write_measure(write_measure)
62 , write_all_faces(write_all_faces)
68 param.declare_entry(
"Write cells",
71 "Write the mesh connectivity as DX grid cells");
72 param.declare_entry(
"Write faces",
75 "Write faces of cells. These may be boundary faces "
76 "or all faces between mesh cells, according to "
77 "\"Write all faces\"");
78 param.declare_entry(
"Write diameter",
81 "If cells are written, additionally write their"
82 " diameter as data for visualization");
83 param.declare_entry(
"Write measure",
86 "Write the volume of each cell as data");
87 param.declare_entry(
"Write all faces",
90 "Write all faces, not only boundary");
104 Msh::Msh(
const bool write_faces,
const bool write_lines)
105 : write_faces(write_faces)
106 , write_lines(write_lines)
126 const bool write_faces,
127 const bool write_lines)
128 : write_preamble(write_preamble)
129 , write_faces(write_faces)
130 , write_lines(write_lines)
155 const unsigned int n_extra_curved_line_points,
156 const bool curved_inner_cells,
157 const bool write_additional_boundary_lines)
158 : write_cell_numbers(write_cell_numbers)
159 , n_extra_curved_line_points(n_extra_curved_line_points)
160 , curved_inner_cells(curved_inner_cells)
161 , write_additional_boundary_lines(write_additional_boundary_lines)
183 const unsigned int size,
184 const double line_width,
185 const bool color_lines_on_user_flag,
186 const unsigned int n_boundary_face_points,
187 const bool color_lines_level)
188 : size_type(size_type)
190 , line_width(line_width)
191 , color_lines_on_user_flag(color_lines_on_user_flag)
192 , n_boundary_face_points(n_boundary_face_points)
193 , color_lines_level(color_lines_level)
200 param.declare_entry(
"Size by",
203 "Depending on this parameter, either the "
205 "of the eps is scaled to \"Size\"");
206 param.declare_entry(
"Size",
209 "Size of the output in points");
210 param.declare_entry(
"Line width",
213 "Width of the lines drawn in points");
214 param.declare_entry(
"Color by flag",
217 "Draw lines with user flag set in different color");
218 param.declare_entry(
"Boundary points",
221 "Number of points on boundary edges. "
222 "Increase this beyond 2 to see curved boundaries.");
223 param.declare_entry(
"Color by level",
226 "Draw different colors according to grid level.");
233 if (
param.get(
"Size by") ==
"width")
235 else if (
param.get(
"Size by") ==
"height")
247 const unsigned int size,
248 const double line_width,
249 const bool color_lines_on_user_flag,
250 const unsigned int n_boundary_face_points)
254 color_lines_on_user_flag,
255 n_boundary_face_points)
273 const unsigned int size,
274 const double line_width,
275 const bool color_lines_on_user_flag,
276 const unsigned int n_boundary_face_points,
277 const bool write_cell_numbers,
278 const bool write_cell_number_level,
279 const bool write_vertex_numbers,
280 const bool color_lines_level)
284 color_lines_on_user_flag,
285 n_boundary_face_points,
287 , write_cell_numbers(write_cell_numbers)
288 , write_cell_number_level(write_cell_number_level)
289 , write_vertex_numbers(write_vertex_numbers)
296 param.declare_entry(
"Cell number",
299 "(2d only) Write cell numbers"
300 " into the centers of cells");
301 param.declare_entry(
"Level number",
304 "(2d only) if \"Cell number\" is true, write "
305 "numbers in the form level.number");
306 param.declare_entry(
"Vertex number",
309 "Write numbers for each vertex");
317 write_cell_numbers =
param.get_bool(
"Cell number");
318 write_cell_number_level =
param.get_bool(
"Level number");
319 write_vertex_numbers =
param.get_bool(
"Vertex number");
325 const unsigned int size,
326 const double line_width,
327 const bool color_lines_on_user_flag,
328 const unsigned int n_boundary_face_points,
329 const double azimut_angle,
330 const double turn_angle)
334 color_lines_on_user_flag,
335 n_boundary_face_points)
336 , azimut_angle(azimut_angle)
337 , turn_angle(turn_angle)
344 param.declare_entry(
"Azimuth",
347 "Azimuth of the view point, that is, the angle "
348 "in the plane from the x-axis.");
349 param.declare_entry(
"Elevation",
352 "Elevation of the view point above the xy-plane.");
360 azimut_angle = 90 -
param.get_double(
"Elevation");
361 turn_angle =
param.get_double(
"Azimuth");
367 : draw_boundary(
true)
368 , color_by(material_id)
370 , n_boundary_face_points(0)
376 , boundary_thickness(3)
410 const unsigned int boundary_line_thickness,
413 const int azimuth_angle,
414 const int polar_angle,
416 const bool convert_level_number_to_height,
417 const bool label_level_number,
418 const bool label_cell_index,
419 const bool label_material_id,
420 const bool label_subdomain_id,
421 const bool draw_colorbar,
422 const bool draw_legend,
423 const bool label_boundary_id)
426 , line_thickness(line_thickness)
427 , boundary_line_thickness(boundary_line_thickness)
429 , background(background)
430 , azimuth_angle(azimuth_angle)
431 , polar_angle(polar_angle)
433 , convert_level_number_to_height(convert_level_number_to_height)
434 , level_height_factor(0.3f)
435 , cell_font_scaling(1.f)
436 , label_level_number(label_level_number)
437 , label_cell_index(label_cell_index)
438 , label_material_id(label_material_id)
439 , label_subdomain_id(label_subdomain_id)
440 , label_level_subdomain_id(
false)
441 , label_boundary_id(label_boundary_id)
442 , draw_colorbar(draw_colorbar)
443 , draw_legend(draw_legend)
447 : draw_bounding_box(
false)
466 : default_format(none)
646 return "none|dx|gnuplot|eps|ucd|xfig|msh|svg|mathgl|vtk|vtu";
653 param.declare_entry(
"Format",
657 param.enter_subsection(
"DX");
659 param.leave_subsection();
661 param.enter_subsection(
"Msh");
663 param.leave_subsection();
665 param.enter_subsection(
"Ucd");
667 param.leave_subsection();
669 param.enter_subsection(
"Gnuplot");
671 param.leave_subsection();
673 param.enter_subsection(
"Eps");
678 param.leave_subsection();
680 param.enter_subsection(
"XFig");
682 param.leave_subsection();
684 param.enter_subsection(
"MathGL");
686 param.leave_subsection();
688 param.enter_subsection(
"Vtk");
690 param.leave_subsection();
692 param.enter_subsection(
"Vtu");
694 param.leave_subsection();
704 param.enter_subsection(
"DX");
706 param.leave_subsection();
708 param.enter_subsection(
"Msh");
710 param.leave_subsection();
712 param.enter_subsection(
"Ucd");
714 param.leave_subsection();
716 param.enter_subsection(
"Gnuplot");
718 param.leave_subsection();
720 param.enter_subsection(
"Eps");
724 param.leave_subsection();
726 param.enter_subsection(
"XFig");
728 param.leave_subsection();
730 param.enter_subsection(
"MathGL");
732 param.leave_subsection();
734 param.enter_subsection(
"Vtk");
736 param.leave_subsection();
738 param.enter_subsection(
"Vtu");
740 param.leave_subsection();
779template <
int dim,
int spacedim>
782 std::ostream &out)
const
788 const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
789 const std::vector<bool> &vertex_used = tria.get_used_vertices();
791 const unsigned int n_vertices = tria.n_used_vertices();
798 std::vector<unsigned int> renumber(vertices.size());
802 for (
unsigned int i = 0; i < vertices.size(); ++i)
808 out <<
"object \"vertices\" class array type float rank 1 shape " << dim
809 <<
" items " << n_vertices <<
" data follows" <<
'\n';
811 for (
unsigned int i = 0; i < vertices.size(); ++i)
813 out <<
'\t' << vertices[i] <<
'\n';
819 const unsigned int n_cells = tria.n_active_cells();
820 const unsigned int n_faces =
828 out <<
"object \"cells\" class array type int rank 1 shape "
832 for (
const auto &cell : tria.active_cell_iterators())
840 out <<
"attribute \"element type\" string \"";
848 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
853 out <<
"object \"material\" class array type int rank 0 items " << n_cells
854 <<
" data follows" <<
'\n';
855 for (
const auto &cell : tria.active_cell_iterators())
856 out <<
' ' << cell->material_id();
857 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
859 out <<
"object \"level\" class array type int rank 0 items " << n_cells
860 <<
" data follows" <<
'\n';
861 for (
const auto &cell : tria.active_cell_iterators())
862 out <<
' ' << cell->level();
863 out <<
'\n' <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
867 out <<
"object \"measure\" class array type float rank 0 items "
868 << n_cells <<
" data follows" <<
'\n';
869 for (
const auto &cell : tria.active_cell_iterators())
870 out <<
'\t' << cell->measure();
872 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
878 out <<
"object \"diameter\" class array type float rank 0 items "
879 << n_cells <<
" data follows" <<
'\n';
880 for (
const auto &cell : tria.active_cell_iterators())
881 out <<
'\t' << cell->diameter();
883 <<
"attribute \"dep\" string \"connections\"" <<
'\n'
890 out <<
"object \"faces\" class array type int rank 1 shape "
894 for (
const auto &cell : tria.active_cell_iterators())
896 for (
const unsigned int f : cell->face_indices())
904 << renumber[face->vertex_index(
909 out <<
"attribute \"element type\" string \"";
915 <<
"attribute \"ref\" string \"positions\"" <<
'\n'
921 out <<
"object \"boundary\" class array type int rank 0 items " << n_faces
922 <<
" data follows" <<
'\n';
923 for (
const auto &cell : tria.active_cell_iterators())
929 <<
static_cast<std::make_signed_t<types::boundary_id>
>(
930 cell->face(f)->boundary_id());
934 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
938 out <<
"object \"face measure\" class array type float rank 0 items "
939 << n_faces <<
" data follows" <<
'\n';
940 for (
const auto &cell : tria.active_cell_iterators())
943 out <<
' ' << cell->face(f)->measure();
946 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
951 out <<
"object \"face diameter\" class array type float rank 0 items "
952 << n_faces <<
" data follows" <<
'\n';
953 for (
const auto &cell : tria.active_cell_iterators())
956 out <<
' ' << cell->face(f)->diameter();
959 out <<
"attribute \"dep\" string \"connections\"" <<
'\n' <<
'\n';
974 out <<
"object \"deal data\" class field" <<
'\n'
975 <<
"component \"positions\" value \"vertices\"" <<
'\n'
976 <<
"component \"connections\" value \"cells\"" <<
'\n';
980 out <<
"object \"cell data\" class field" <<
'\n'
981 <<
"component \"positions\" value \"vertices\"" <<
'\n'
982 <<
"component \"connections\" value \"cells\"" <<
'\n';
983 out <<
"component \"material\" value \"material\"" <<
'\n';
984 out <<
"component \"level\" value \"level\"" <<
'\n';
986 out <<
"component \"measure\" value \"measure\"" <<
'\n';
988 out <<
"component \"diameter\" value \"diameter\"" <<
'\n';
993 out <<
"object \"face data\" class field" <<
'\n'
994 <<
"component \"positions\" value \"vertices\"" <<
'\n'
995 <<
"component \"connections\" value \"faces\"" <<
'\n';
996 out <<
"component \"boundary\" value \"boundary\"" <<
'\n';
998 out <<
"component \"measure\" value \"face measure\"" <<
'\n';
1000 out <<
"component \"diameter\" value \"face diameter\"" <<
'\n';
1003 out <<
'\n' <<
"object \"grid data\" class group" <<
'\n';
1005 out <<
"member \"cells\" value \"cell data\"" <<
'\n';
1007 out <<
"member \"faces\" value \"face data\"" <<
'\n';
1008 out <<
"end" <<
'\n';
1019template <
int dim,
int spacedim>
1022 std::ostream &out)
const
1029 const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
1030 const std::vector<bool> &vertex_used = tria.get_used_vertices();
1032 const unsigned int n_vertices = tria.n_used_vertices();
1050 out <<
"@f$NOD" <<
'\n' << n_vertices <<
'\n';
1055 for (
unsigned int i = 0; i < vertices.size(); ++i)
1059 <<
" " << vertices[i];
1060 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1066 out <<
"@f$ENDNOD" <<
'\n'
1068 << tria.n_active_cells() +
1074 {0, 1, 5, 4, 2, 3, 7, 6}};
1078 for (
const auto &cell : tria.active_cell_iterators())
1080 out << cell->active_cell_index() + 1 <<
' '
1081 << cell->reference_cell().gmsh_element_type() <<
' '
1082 << cell->material_id() <<
' ' << cell->subdomain_id() <<
' '
1083 << cell->n_vertices() <<
' ';
1087 for (
const unsigned int vertex : cell->vertex_indices())
1089 if (cell->reference_cell() == ReferenceCells::get_hypercube<dim>())
1090 out << cell->vertex_index(
1095 else if (cell->reference_cell() == ReferenceCells::get_simplex<dim>())
1096 out << cell->vertex_index(vertex) + 1 <<
' ';
1114 out <<
"@f$ENDELM\n";
1124template <
int dim,
int spacedim>
1127 std::ostream &out)
const
1134 const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
1135 const std::vector<bool> &vertex_used = tria.get_used_vertices();
1137 const unsigned int n_vertices = tria.n_used_vertices();
1145 std::time_t
time1 = std::time(
nullptr);
1146 std::tm *time = std::localtime(&
time1);
1148 <<
"# This file was generated by the deal.II library." <<
'\n'
1149 <<
"# Date = " << time->tm_year + 1900 <<
"/" << time->tm_mon + 1
1150 <<
"/" << time->tm_mday <<
'\n'
1151 <<
"# Time = " << time->tm_hour <<
":" << std::setw(2) << time->tm_min
1152 <<
":" << std::setw(2) << time->tm_sec <<
'\n'
1154 <<
"# For a description of the UCD format see the AVS Developer's guide."
1160 out << n_vertices <<
' '
1161 << tria.n_active_cells() +
1170 for (
unsigned int i = 0; i < vertices.size(); ++i)
1174 <<
" " << vertices[i];
1175 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
1182 for (
const auto &cell : tria.active_cell_iterators())
1184 out << cell->active_cell_index() + 1 <<
' ' << cell->material_id() <<
' ';
1241template <
int dim,
int spacedim>
1259 const int spacedim = 2;
1265 out <<
"#FIG 3.2\nLandscape\nCenter\nInches" << std::endl
1266 <<
"A4\n100.00\nSingle"
1269 <<
"-3" << std::endl
1270 <<
"# generated by deal.II GridOut class" << std::endl
1271 <<
"# reduce first number to scale up image" << std::endl
1272 <<
"1200 2" << std::endl;
1275 unsigned int colno = 32;
1276 out <<
"0 " <<
colno++ <<
" #ff0000" << std::endl;
1277 out <<
"0 " <<
colno++ <<
" #ff8000" << std::endl;
1278 out <<
"0 " <<
colno++ <<
" #ffd000" << std::endl;
1279 out <<
"0 " <<
colno++ <<
" #ffff00" << std::endl;
1280 out <<
"0 " <<
colno++ <<
" #c0ff00" << std::endl;
1281 out <<
"0 " <<
colno++ <<
" #80ff00" << std::endl;
1282 out <<
"0 " <<
colno++ <<
" #00f000" << std::endl;
1283 out <<
"0 " <<
colno++ <<
" #00f0c0" << std::endl;
1284 out <<
"0 " <<
colno++ <<
" #00f0ff" << std::endl;
1285 out <<
"0 " <<
colno++ <<
" #00c0ff" << std::endl;
1286 out <<
"0 " <<
colno++ <<
" #0080ff" << std::endl;
1287 out <<
"0 " <<
colno++ <<
" #0040ff" << std::endl;
1288 out <<
"0 " <<
colno++ <<
" #0000c0" << std::endl;
1289 out <<
"0 " <<
colno++ <<
" #5000ff" << std::endl;
1290 out <<
"0 " <<
colno++ <<
" #8000ff" << std::endl;
1291 out <<
"0 " <<
colno++ <<
" #b000ff" << std::endl;
1292 out <<
"0 " <<
colno++ <<
" #ff00ff" << std::endl;
1293 out <<
"0 " <<
colno++ <<
" #ff80ff" << std::endl;
1295 for (
unsigned int i = 0; i < 8; ++i)
1296 out <<
"0 " <<
colno++ <<
" #" << std::hex << 32 * i + 31 << 32 * i + 31
1297 << 32 * i + 31 << std::dec << std::endl;
1299 for (
unsigned int i = 1; i < 16; ++i)
1300 out <<
"0 " <<
colno++ <<
" #00" << std::hex << 16 * i + 15 << std::dec
1301 <<
"00" << std::endl;
1303 for (
unsigned int i = 1; i < 16; ++i)
1304 out <<
"0 " <<
colno++ <<
" #" << std::hex << 16 * i + 15 << 16 * i + 15
1305 << std::dec <<
"00" << std::endl;
1307 for (
unsigned int i = 1; i < 16; ++i)
1308 out <<
"0 " <<
colno++ <<
" #" << std::hex << 16 * i + 15 << std::dec
1309 <<
"0000" << std::endl;
1311 for (
unsigned int i = 1; i < 16; ++i)
1312 out <<
"0 " <<
colno++ <<
" #" << std::hex << 16 * i + 15 <<
"00"
1313 << 16 * i + 15 << std::dec << std::endl;
1315 for (
unsigned int i = 1; i < 16; ++i)
1316 out <<
"0 " <<
colno++ <<
" #0000" << std::hex << 16 * i + 15 << std::dec
1319 for (
unsigned int i = 1; i < 16; ++i)
1320 out <<
"0 " <<
colno++ <<
" #00" << std::hex << 16 * i + 15 << 16 * i + 15
1321 << std::dec << std::endl;
1328 for (
const auto &cell : tria.cell_iterators())
1343 out << cell->material_id() + 32;
1346 out << cell->level() + 8;
1349 out << cell->subdomain_id() + 32;
1352 out << cell->level_subdomain_id() + 32;
1361 (900 + cell->material_id()))
1367 <<
nv + 1 << std::endl;
1373 for (
unsigned int k = 0;
k <=
nv; ++
k)
1381 out <<
'\t' << ((d == 0) ? val : -val);
1386 static const unsigned int face_reorder[4] = {2, 1, 3, 0};
1416 for (
unsigned int k = 0;
1427 out <<
'\t' << ((d == 0) ? val : -val);
1444#ifdef DEAL_II_GMSH_WITH_API
1445template <
int dim,
int spacedim>
1454 const std::array<std::vector<unsigned int>, 8>
dealii_to_gmsh = {
1461 {{0, 1, 2, 3, 4, 5}},
1462 {{0, 1, 3, 2, 4, 5, 7, 6}}}};
1466 const auto &vertices = tria.get_vertices();
1467 std::vector<double> coords(3 * vertices.size());
1468 std::vector<std::size_t>
nodes(vertices.size());
1472 for (
const auto &p : vertices)
1474 for (
unsigned int d = 0; d < spacedim; ++d)
1475 coords[i * 3 + d] = p[d];
1487 using IdPair = std::pair<types::material_id, types::manifold_id>;
1492 for (
const auto &cell : tria.active_cell_iterators())
1494 set_of_pairs.insert({cell->material_id(), cell->manifold_id()});
1495 for (
const auto &f : cell->face_iterators())
1497 (f->boundary_id() != 0 &&
1499 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1501 for (
const auto l : cell->line_indices())
1503 const auto &f = cell->line(l);
1505 (f->boundary_id() != 0 &&
1507 set_of_pairs.insert({f->boundary_id(), f->manifold_id()});
1520 std::vector<std::vector<std::vector<std::size_t>>>
element_ids(
1522 std::vector<std::vector<std::vector<std::size_t>>>
element_nodes(
1529 const auto type = element->reference_cell();
1534 for (
const auto v : element->vertex_indices())
1550 [&](
const auto &element,
1552 const auto struct_dim = element->structure_dimension;
1553 const auto manifold_id = element->manifold_id();
1557 (boundary_or_material_id != 0 &&
1572 for (
const auto &cell : tria.active_cell_iterators())
1575 for (
const auto &face : cell->face_iterators())
1578 for (
const auto l : cell->line_indices())
1584 gmsh::option::setNumber(
"General.Verbosity", 0);
1585 gmsh::model::add(
"Grid generated in deal.II");
1588 gmsh::model::addDiscreteEntity(p.first, p.second);
1589 gmsh::model::mesh::addNodes(p.first, p.second,
nodes, coords);
1593 for (
unsigned int t = 1; t < 8; ++t)
1599 gmsh::model::mesh::addElementsByType(
entity_tag + 1,
1609 const auto &d =
it.first;
1615 if (d == dim && boundary_id != 0)
1617 static_cast<int>(boundary_id));
1618 else if (d < dim && boundary_id != 0)
1628 sep +
"ManifoldID:" +
1631 gmsh::model::addPhysicalGroup(d, {
entity_tag}, -1);
1682template <
int dim,
int spacedim>
1685 std::ostream & )
const
1688 ExcMessage(
"Mesh output in SVG format is not implemented for anything "
1689 "other than two-dimensional meshes in two-dimensional "
1690 "space. That's because three-dimensional meshes are best "
1691 "viewed in programs that allow changing the viewpoint, "
1692 "but SVG format does not allow this: It is an inherently "
1693 "2d format, and for three-dimensional meshes would "
1694 "require choosing one, fixed viewpoint."
1696 "You probably want to output your mesh in a format such "
1697 "as VTK, VTU, or gnuplot."));
1706 unsigned int min_level, max_level;
1714 Assert(height != 0 || width != 0,
1715 ExcMessage(
"You have to set at least one of width and height"));
1742 double x_min = tria.begin()->vertex(0)[0];
1744 double y_min = tria.begin()->vertex(0)[1];
1749 min_level = max_level = tria.begin()->level();
1755 std::set<unsigned int> levels;
1767 for (
const auto &cell : tria.cell_iterators())
1769 for (
unsigned int vertex_index = 0; vertex_index < cell->n_vertices();
1772 if (cell->vertex(vertex_index)[0] <
x_min)
1773 x_min = cell->vertex(vertex_index)[0];
1774 if (cell->vertex(vertex_index)[0] >
x_max)
1775 x_max = cell->vertex(vertex_index)[0];
1777 if (cell->vertex(vertex_index)[1] <
y_min)
1778 y_min = cell->vertex(vertex_index)[1];
1779 if (cell->vertex(vertex_index)[1] >
y_max)
1780 y_max = cell->vertex(vertex_index)[1];
1783 if (
static_cast<unsigned int>(cell->level()) < min_level)
1784 min_level = cell->level();
1785 if (
static_cast<unsigned int>(cell->level()) > max_level)
1786 max_level = cell->level();
1789 levels.insert(cell->level());
1790 if (cell->is_active())
1802 const unsigned int n_levels = levels.size();
1805 const unsigned int n_subdomains =
subdomains.size();
1929 point[0] = tria.begin()->vertex(0)[0];
1930 point[1] = tria.begin()->vertex(0)[1];
1938 (
static_cast<float>(tria.begin()->level()) /
1939 static_cast<float>(n_levels)) *
1952 for (
const auto &cell : tria.cell_iterators())
1954 point[0] = cell->vertex(0)[0];
1955 point[1] = cell->vertex(0)[1];
1962 (
static_cast<float>(cell->level()) /
static_cast<float>(n_levels)) *
1982 point[0] = cell->vertex(1)[0];
1983 point[1] = cell->vertex(1)[1];
2001 point[0] = cell->vertex(2)[0];
2002 point[1] = cell->vertex(2)[1];
2020 if (cell->n_vertices() == 4)
2022 point[0] = cell->vertex(3)[0];
2023 point[1] = cell->vertex(3)[1];
2042 if (
static_cast<unsigned int>(cell->level()) == min_level)
2051 width =
static_cast<unsigned int>(
2053 else if (height == 0)
2054 height =
static_cast<unsigned int>(
2059 static_cast<unsigned int>(.5 + (height / 100.) * 1.75);
2075 .5 + height * .175);
2087 out <<
"<svg width=\"" << width +
additional_width <<
"\" height=\"" << height
2088 <<
"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">" <<
'\n'
2095 <<
" <linearGradient id=\"background_gradient\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\""
2096 << height <<
"\">" <<
'\n'
2097 <<
" <stop offset=\"0\" style=\"stop-color:white\"/>" <<
'\n'
2098 <<
" <stop offset=\"1\" style=\"stop-color:lightsteelblue\"/>" <<
'\n'
2099 <<
" </linearGradient>" <<
'\n';
2105 out <<
"<!-- internal style sheet -->" <<
'\n'
2106 <<
"<style type=\"text/css\"><![CDATA[" <<
'\n';
2110 out <<
" rect.background{fill:url(#background_gradient)}" <<
'\n';
2112 out <<
" rect.background{fill:white}" <<
'\n';
2114 out <<
" rect.background{fill:none}" <<
'\n';
2117 out <<
" rect{fill:none; stroke:rgb(25,25,25); stroke-width:"
2119 <<
" text{font-family:Helvetica; text-anchor:middle; fill:rgb(25,25,25)}"
2121 <<
" line{stroke:rgb(25,25,25); stroke-width:"
2123 <<
" path{fill:none; stroke:rgb(25,25,25); stroke-width:"
2125 <<
" circle{fill:white; stroke:black; stroke-width:2}" <<
'\n'
2137 for (
unsigned int index = 0; index < n; ++index)
2147 h = .6 - (index / (n - 1.)) * .6;
2156 unsigned int i =
static_cast<unsigned int>(h * 6);
2158 double f = h * 6 - i;
2165 r = 255,
g =
static_cast<unsigned int>(.5 + 255 * t);
2168 r =
static_cast<unsigned int>(.5 + 255 *
q),
g = 255;
2171 g = 255, b =
static_cast<unsigned int>(.5 + 255 * t);
2174 g =
static_cast<unsigned int>(.5 + 255 *
q), b = 255;
2177 r =
static_cast<unsigned int>(.5 + 255 * t), b = 255;
2180 r = 255, b =
static_cast<unsigned int>(.5 + 255 *
q);
2205 <<
',' << b <<
"); "
2206 <<
"stroke:rgb(25,25,25); stroke-width:"
2210 <<
static_cast<unsigned int>(.5 + .75 *
r) <<
','
2211 <<
static_cast<unsigned int>(.5 + .75 *
g) <<
','
2212 <<
static_cast<unsigned int>(.5 + .75 * b) <<
"); "
2213 <<
"stroke:rgb(20,20,20); stroke-width:"
2217 <<
',' << b <<
"); "
2218 <<
"stroke:rgb(25,25,25); stroke-width:"
2225 out <<
"]]></style>" <<
'\n' <<
'\n';
2228 out <<
" <rect class=\"background\" width=\"" << width <<
"\" height=\""
2229 << height <<
"\"/>" <<
'\n';
2236 x_offset =
static_cast<unsigned int>(.5 + (height / 100.) *
2239 x_offset =
static_cast<unsigned int>(.5 + height * .025);
2242 <<
" <text x=\"" <<
x_offset <<
"\" y=\""
2243 <<
static_cast<unsigned int>(.5 + height * .0525) <<
'\"'
2244 <<
" style=\"font-weight:100; fill:lightsteelblue; text-anchor:start; font-family:Courier; font-size:"
2245 <<
static_cast<unsigned int>(.5 + height * .045) <<
"px\">"
2247 <<
"</text>" <<
'\n';
2266 out <<
" <!-- cells -->" <<
'\n';
2271 for (
const auto &cell : tria.cell_iterators_on_level(
level_index))
2281 out <<
" class=\"p";
2283 if (!cell->is_active() &&
2290 out << cell->material_id();
2296 if (cell->is_active())
2297 out << cell->subdomain_id() + 2;
2302 out << cell->level_subdomain_id() + 2;
2313 point[0] = cell->vertex(0)[0];
2314 point[1] = cell->vertex(0)[1];
2320 (
static_cast<float>(cell->level()) /
2321 static_cast<float>(n_levels)) *
2338 <<
static_cast<unsigned int>(
2346 point[0] = cell->vertex(1)[0];
2347 point[1] = cell->vertex(1)[1];
2362 <<
static_cast<unsigned int>(
2370 if (cell->n_vertices() == 4)
2372 point[0] = cell->vertex(3)[0];
2373 point[1] = cell->vertex(3)[1];
2388 <<
static_cast<unsigned int>(
2397 point[0] = cell->vertex(2)[0];
2398 point[1] = cell->vertex(2)[1];
2413 <<
static_cast<unsigned int>(
2421 point[0] = cell->vertex(0)[0];
2422 point[1] = cell->vertex(0)[1];
2437 <<
static_cast<unsigned int>(
2443 out <<
"\"/>" <<
'\n';
2450 point[0] = cell->center()[0];
2451 point[1] = cell->center()[1];
2457 (
static_cast<float>(cell->level()) /
2458 static_cast<float>(n_levels)) *
2476 static_cast<unsigned int>(
2483 <<
static_cast<unsigned int>(
2490 <<
static_cast<unsigned int>(
2500 out << cell->level();
2507 out << cell->index();
2516 cell->material_id());
2524 if (cell->is_active())
2525 out <<
static_cast<std::make_signed_t<types::subdomain_id>
>(
2526 cell->subdomain_id());
2539 cell->level_subdomain_id());
2542 out <<
"</text>" <<
'\n';
2549 for (
auto faceIndex : cell->face_indices())
2553 point[0] = cell->face(
faceIndex)->vertex(0)[0];
2554 point[1] = cell->face(
faceIndex)->vertex(0)[1];
2560 (
static_cast<float>(cell->level()) /
2561 static_cast<float>(n_levels)) *
2572 out <<
" <line x1=\""
2573 <<
static_cast<unsigned int>(
2582 <<
static_cast<unsigned int>(
2591 point[0] = cell->face(
faceIndex)->vertex(1)[0];
2592 point[1] = cell->face(
faceIndex)->vertex(1)[1];
2598 (
static_cast<float>(cell->level()) /
2599 static_cast<float>(n_levels)) *
2611 <<
static_cast<unsigned int>(
2620 <<
static_cast<unsigned int>(
2642 static_cast<unsigned int>(
2645 cell->level() - 4. +
2648 point[0] = cell->face(
faceIndex)->center()[0];
2649 point[1] = cell->face(
faceIndex)->center()[1];
2655 (
static_cast<float>(cell->level()) /
2656 static_cast<float>(n_levels)) *
2667 const unsigned int xc =
static_cast<unsigned int>(
2674 const unsigned int yc =
static_cast<unsigned int>(
2681 out <<
" <circle cx=\"" <<
xc <<
"\" cy=\"" <<
yc
2685 out <<
" <text x=\"" <<
xc <<
"\" y=\"" <<
yc
2687 <<
"px\" dominant-baseline=\"middle\">"
2688 <<
static_cast<int>(
2690 <<
"</text>" <<
'\n';
2702 out <<
'\n' <<
" <!-- legend -->" <<
'\n';
2718 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2720 <<
"\" height=\"" <<
static_cast<unsigned int>(.5 + height * .215)
2723 out <<
" <text x=\""
2725 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2727 <<
static_cast<unsigned int>(.5 +
2730 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2733 <<
"</text>" <<
'\n';
2737 out <<
" <text x=\""
2739 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2741 <<
static_cast<unsigned int>(.5 +
2744 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2753 out <<
"</text>" <<
'\n';
2758 out <<
" <text x=\""
2760 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2762 <<
static_cast<unsigned int>(.5 +
2765 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2773 out <<
"</text>" <<
'\n';
2778 out <<
" <text x=\""
2780 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2782 <<
static_cast<unsigned int>(.5 +
2785 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2793 out <<
"</text>" <<
'\n';
2798 out <<
" <text x= \""
2800 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2802 <<
static_cast<unsigned int>(.5 +
2805 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2812 out <<
"</text>" <<
'\n';
2817 out <<
" <text x= \""
2819 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2821 <<
static_cast<unsigned int>(.5 +
2824 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2826 <<
"level_subdomain_id"
2827 <<
"</text>" <<
'\n';
2832 out <<
" <text x=\""
2834 static_cast<unsigned int>(.5 + (height / 100.) * 1.25)
2836 <<
static_cast<unsigned int>(.5 +
2839 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2842 <<
"</text>" <<
'\n';
2844 out <<
" <text x= \""
2846 static_cast<unsigned int>(.5 + (height / 100.) * 2.)
2848 <<
static_cast<unsigned int>(.5 +
2851 <<
"\" style=\"text-anchor:start; font-style:oblique; font-size:"
2854 <<
"</text>" <<
'\n';
2863 <<
static_cast<unsigned int>(
2865 <<
"\" style=\"text-anchor:start; font-size:" <<
font_size <<
"px\">"
2874 out <<
'\n' <<
" <!-- colorbar -->" <<
'\n';
2877 <<
static_cast<unsigned int>(
2880 <<
"\" style=\"text-anchor:start; font-weight:bold; font-size:"
2886 out <<
"material_id";
2889 out <<
"level_number";
2892 out <<
"subdomain_id";
2895 out <<
"level_subdomain_id";
2901 out <<
"</text>" <<
'\n';
2906 static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
2914 for (
unsigned int index = 0; index < n; ++index)
2936 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2942 out <<
" <text x=\""
2944 <<
static_cast<unsigned int>(.5 + (height / 100.) *
2947 static_cast<unsigned int>(.5 +
font_size * .35)
2949 <<
" style=\"text-anchor:start; font-size:"
2950 <<
static_cast<unsigned int>(.5 +
font_size) <<
"px";
2952 if (index == 0 || index == n - 1)
2953 out <<
"; font-weight:bold";
2962 out <<
"</text>" <<
'\n';
2970 out <<
'\n' <<
"</svg>";
2986template <
int dim,
int spacedim>
2989 std::ostream &out)
const
2996 const std::time_t
time1 = std::time(
nullptr);
2997 const std::tm *time = std::localtime(&
time1);
3001 <<
"\n# This file was generated by the deal.II library."
3002 <<
"\n# Date = " << time->tm_year + 1900 <<
"/" << std::setfill(
'0')
3003 << std::setw(2) << time->tm_mon + 1 <<
"/" << std::setfill(
'0')
3004 << std::setw(2) << time->tm_mday <<
"\n# Time = " << std::setfill(
'0')
3005 << std::setw(2) << time->tm_hour <<
":" << std::setfill(
'0')
3006 << std::setw(2) << time->tm_min <<
":" << std::setfill(
'0')
3007 << std::setw(2) << time->tm_sec <<
"\n#"
3008 <<
"\n# For a description of the MathGL script format see the MathGL manual. "
3010 <<
"\n# Note: This file is understood by MathGL v2.1 and higher only, and can "
3011 <<
"\n# be quickly viewed in a graphical environment using \'mglview\'. "
3017 const std::string
axes =
"xyz";
3032 out <<
"\nsetsize 800 800";
3033 out <<
"\nrotate 0 0";
3036 out <<
"\nsetsize 800 800";
3037 out <<
"\nrotate 60 40";
3046 <<
"\n# Vertex ordering."
3047 <<
"\n# list <vertex order> <vertex indices>"
3056 out <<
"\nlist f 0 1 2 3" <<
'\n';
3060 <<
"\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"
3069 <<
"\n# List of vertices."
3070 <<
"\n# list <id> <vertices>"
3076 for (
const auto &cell : tria.active_cell_iterators())
3078 for (
unsigned int i = 0; i < dim; ++i)
3085 out <<
"\nlist " <<
axes[i] << cell->active_cell_index() <<
" ";
3087 out << cell->vertex(
j)[i] <<
" ";
3094 <<
"\n# List of cells to quadplot."
3095 <<
"\n# quadplot <vertex order> <id> <style>"
3097 for (
unsigned int i = 0; i < tria.n_active_cells(); ++i)
3099 out <<
"\nquadplot f ";
3100 for (
unsigned int j = 0;
j < dim; ++
j)
3101 out <<
axes[
j] << i <<
" ";
3126 template <
int dim,
int spacedim,
typename ITERATOR,
typename END>
3134 for (; cell != end; ++cell)
3137 patch.reference_cell = cell->reference_cell();
3138 patch.n_subdivisions = 1;
3139 patch.data.reinit(5, cell->n_vertices());
3143 patch.vertices[v] = cell->vertex(v);
3144 patch.data(0, v) = cell->level();
3146 static_cast<std::make_signed_t<types::manifold_id>
>(
3147 cell->manifold_id());
3149 static_cast<std::make_signed_t<types::material_id>
>(
3150 cell->material_id());
3151 if (cell->is_active())
3153 static_cast<std::make_signed_t<types::subdomain_id>
>(
3154 cell->subdomain_id());
3156 patch.data(3, v) = -1;
3158 static_cast<std::make_signed_t<types::subdomain_id>
>(
3159 cell->level_subdomain_id());
3161 patches.push_back(
patch);
3167 std::vector<std::string>
3170 std::vector<std::string> v(5);
3175 v[4] =
"level_subdomain";
3182 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3185 std::vector<typename Triangulation<3, 3>::active_line_iterator>
res;
3187 std::vector<bool> flags;
3188 tria.save_user_flags_line(flags);
3191 for (
auto face : tria.active_face_iterators())
3194 const auto line = face->line(l);
3195 if (line->user_flag_set() || line->has_children())
3198 line->set_user_flag();
3199 if (line->at_boundary())
3200 res.emplace_back(line);
3211 template <
int dim,
int spacedim>
3212 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3224 std::vector<typename Triangulation<3, 3>::active_line_iterator>
3227 std::vector<typename Triangulation<3, 3>::active_line_iterator>
res;
3229 std::vector<bool> flags;
3230 tria.save_user_flags_line(flags);
3233 for (
auto face : tria.active_face_iterators())
3236 const auto line = face->line(l);
3237 if (line->user_flag_set() || line->has_children())
3240 line->set_user_flag();
3242 (line->boundary_id() != 0 &&
3244 res.emplace_back(line);
3254 template <
int dim,
int spacedim>
3255 std::vector<typename Triangulation<dim, spacedim>::active_line_iterator>
3266 template <
int dim,
int spacedim>
3267 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3270 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3274 for (
auto face : tria.active_face_iterators())
3277 res.push_back(face);
3288 template <
int dim,
int spacedim>
3289 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3292 std::vector<typename Triangulation<dim, spacedim>::active_face_iterator>
3296 for (
auto face : tria.active_face_iterators())
3299 (face->boundary_id() != 0 &&
3301 res.push_back(face);
3309template <
int dim,
int spacedim>
3312 std::ostream &out)
const
3317 const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
3319 const auto n_vertices = vertices.size();
3321 out <<
"# vtk DataFile Version 3.0\n"
3322 <<
"Triangulation generated with deal.II\n"
3324 <<
"DATASET UNSTRUCTURED_GRID\n"
3325 <<
"POINTS " << n_vertices <<
" double\n";
3328 for (
const auto &v : vertices)
3331 for (
unsigned int d = spacedim + 1; d <= 3; ++d)
3347 "At least one of the flags (output_cells, output_faces, output_edges) has to be enabled!"));
3363 for (
const auto &cell : tria.active_cell_iterators())
3367 for (
const auto &face : faces)
3376 out <<
"\nCELLS " << n_cells <<
' ' <<
cells_size <<
'\n';
3392 {1, 3, 5, 9, 10, 14, 13, 12}};
3394 {0, 1, 3, 2, 4, 5, 7, 6}};
3398 for (
const auto &cell : tria.active_cell_iterators())
3400 out << cell->n_vertices();
3401 for (
const unsigned int i : cell->vertex_indices())
3404 const auto reference_cell = cell->reference_cell();
3414 out << cell->vertex_index(i);
3427 for (
const auto &face : faces)
3429 out << face->n_vertices();
3430 for (
const unsigned int i : face->vertex_indices())
3434 face->n_vertices() ?
3444 for (
const unsigned int i :
edge->vertex_indices())
3445 out <<
' ' <<
edge->vertex_index(i);
3450 out <<
"\nCELL_TYPES " << n_cells <<
'\n';
3453 for (
const auto &cell : tria.active_cell_iterators())
3460 for (
const auto &face : faces)
3471 out <<
"\n\nCELL_DATA " << n_cells <<
'\n'
3472 <<
"SCALARS MaterialID int 1\n"
3473 <<
"LOOKUP_TABLE default\n";
3478 for (
const auto &cell : tria.active_cell_iterators())
3481 cell->material_id())
3488 for (
const auto &face : faces)
3491 face->boundary_id())
3501 edge->boundary_id())
3506 out <<
"\n\nSCALARS ManifoldID int 1\n"
3507 <<
"LOOKUP_TABLE default\n";
3512 for (
const auto &cell : tria.active_cell_iterators())
3515 cell->manifold_id())
3522 for (
const auto &face : faces)
3525 face->manifold_id())
3535 edge->manifold_id())
3548template <
int dim,
int spacedim>
3551 std::ostream &out)
const
3559 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3560 patches.reserve(tria.n_active_cells());
3568 std::tuple<
unsigned int,
3576 out <<
" </UnstructuredGrid>\n";
3577 out <<
"<dealiiData encoding=\"base64\">";
3583 out <<
"\n</dealiiData>\n";
3584 out <<
"</VTKFile>\n";
3595template <
int dim,
int spacedim>
3603 std::vector<DataOutBase::Patch<dim, spacedim>> patches;
3604 const unsigned int n_datasets = 4;
3611 const auto reference_cells = tria.get_reference_cells();
3615 const auto &reference_cell = reference_cells[0];
3617 const unsigned int n_q_points = reference_cell.n_vertices();
3619 for (
const auto &cell : tria.cell_iterators())
3623 if (cell->has_children())
3631 if (cell->has_children() &&
3634 else if (cell->is_active() &&
3635 cell->level_subdomain_id() ==
3642 patch.data.reinit(n_datasets, n_q_points);
3643 patch.points_are_available =
false;
3644 patch.reference_cell = reference_cell;
3646 for (
unsigned int vertex = 0; vertex < n_q_points; ++vertex)
3648 patch.vertices[vertex] = cell->vertex(vertex);
3649 patch.data(0, vertex) = cell->level();
3650 if (cell->is_active())
3651 patch.data(1, vertex) =
static_cast<double>(
3652 static_cast<std::make_signed_t<types::subdomain_id>
>(
3653 cell->subdomain_id()));
3655 patch.data(1, vertex) = -1.0;
3656 patch.data(2, vertex) =
static_cast<double>(
3657 static_cast<std::make_signed_t<types::subdomain_id>
>(
3658 cell->level_subdomain_id()));
3659 patch.data(3, vertex) = tria.locally_owned_subdomain();
3662 for (
auto f : reference_cell.face_indices())
3664 patches.push_back(
patch);
3679 if (
tr->locally_owned_subdomain() == 0)
3687 if (
pos == std::string::npos)
3693 for (
unsigned int i = 0; i <
n_procs; ++i)
3703 data_out.attach_triangulation(*
tr);
3710 data_out.add_data_vector(
dummy_vector,
"level_subdomain");
3711 data_out.add_data_vector(
dummy_vector,
"proc_writing");
3713 data_out.build_patches();
3721 std::tuple<
unsigned int,
3783template <
int dim,
int spacedim>
3788 unsigned int n_faces = 0;
3790 for (
const auto &face : tria.active_face_iterators())
3791 if ((face->at_boundary()) && (face->boundary_id() != 0))
3799template <
int dim,
int spacedim>
3810 .clear_user_flags_line();
3812 unsigned int n_lines = 0;
3814 for (
const auto &cell : tria.active_cell_iterators())
3816 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3817 (cell->line(l)->user_flag_set() ==
false))
3820 cell->line(l)->set_user_flag();
3836 std::ostream &)
const
3845 std::ostream &)
const
3853 std::ostream &)
const
3862 std::ostream &)
const
3870 std::ostream &)
const
3879 std::ostream &)
const
3888 std::ostream &)
const
3896 std::ostream &)
const
3903template <
int dim,
int spacedim>
3907 std::ostream &out)
const
3911 for (
const auto &face : tria.active_face_iterators())
3912 if (face->at_boundary() && (face->boundary_id() != 0))
3915 << face->reference_cell().gmsh_element_type() <<
' ';
3917 <<
static_cast<unsigned int>(face->boundary_id()) <<
' '
3918 << face->n_vertices();
3920 for (
const unsigned int vertex : face->vertex_indices())
3924 << face->vertex_index(
3929 out <<
' ' << face->vertex_index(vertex) + 1;
3942template <
int dim,
int spacedim>
3946 std::ostream &out)
const
3957 .clear_user_flags_line();
3959 for (
const auto &cell : tria.active_cell_iterators())
3961 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
3962 (cell->line(l)->user_flag_set() ==
false))
3967 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
3970 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
3972 << cell->line(l)->vertex_index(
3981 cell->line(l)->set_user_flag();
3997 std::ostream &)
const
4005 std::ostream &)
const
4013 std::ostream &)
const
4021 std::ostream &)
const
4029 std::ostream &)
const
4038 std::ostream &)
const
4047 std::ostream &)
const
4055 std::ostream &)
const
4062template <
int dim,
int spacedim>
4066 std::ostream &out)
const
4071 for (
const auto &face : tria.active_face_iterators())
4072 if (face->at_boundary() && (face->boundary_id() != 0))
4075 <<
static_cast<unsigned int>(face->boundary_id()) <<
" ";
4088 for (
unsigned int vertex = 0;
4091 out << face->vertex_index(
4104template <
int dim,
int spacedim>
4108 std::ostream &out)
const
4119 .clear_user_flags_line();
4121 for (
const auto &cell : tria.active_cell_iterators())
4123 if (cell->line(l)->at_boundary() && (cell->line(l)->boundary_id() != 0) &&
4124 (cell->line(l)->user_flag_set() ==
false))
4127 <<
static_cast<unsigned int>(cell->line(l)->boundary_id())
4130 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
4131 out << cell->line(l)->vertex_index(
4141 cell->line(l)->set_user_flag();
4165 template <
int spacedim>
4169 while (points.size() > 2)
4177 points.erase(points.begin() + 1);
4185 template <
int spacedim>
4194 for (
const auto &cell : tria.active_cell_iterators())
4197 out <<
"# cell " << cell <<
'\n';
4199 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4200 << cell->material_id() <<
'\n'
4201 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4202 << cell->material_id() <<
'\n'
4215 template <
int spacedim>
4233 std::vector<
Point<dim - 1>> boundary_points;
4234 if (mapping !=
nullptr)
4236 boundary_points.resize(n_points);
4237 boundary_points[0][0] = 0;
4238 boundary_points[n_points - 1][0] = 1;
4239 for (
unsigned int i = 1; i < n_points - 1; ++i)
4240 boundary_points[i][0] = 1. * i / (n_points - 1);
4242 const std::vector<double>
dummy_weights(n_points, 1. / n_points);
4246 ReferenceCells::get_hypercube<dim>(), quadrature);
4250 {0, 1, 5, 4, 2, 3, 7, 6}};
4251 for (
const auto &cell : tria.active_cell_iterators())
4254 out <<
"# cell " << cell <<
'\n';
4256 if (mapping ==
nullptr ||
4267 out << cell->vertex(dim == 3 ?
4272 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4273 << cell->material_id() <<
'\n'
4281 for (
const unsigned int face_no :
4284 const typename ::Triangulation<dim,
4285 spacedim>::face_iterator
4287 if (dim != spacedim || face->at_boundary() ||
4298 cell->reference_cell(),
4300 cell->combined_face_orientation(
face_no),
4302 for (
unsigned int i = 0; i < n_points; ++i)
4304 mapping->transform_unit_to_real_cell(
4312 out <<
'\n' <<
'\n';
4318 out << face->vertex(0) <<
' ' << cell->level() <<
' '
4319 << cell->material_id() <<
'\n'
4320 << face->vertex(1) <<
' ' << cell->level() <<
' '
4321 << cell->material_id() <<
'\n'
4337 template <
int spacedim>
4355 std::vector<Point<1>> boundary_points;
4356 if (mapping !=
nullptr)
4358 boundary_points.resize(n_points);
4359 boundary_points[0][0] = 0;
4360 boundary_points[n_points - 1][0] = 1;
4361 for (
unsigned int i = 1; i < n_points - 1; ++i)
4362 boundary_points[i][0] = 1. * i / (n_points - 1);
4364 const std::vector<double>
dummy_weights(n_points, 1. / n_points);
4371 ReferenceCells::get_hypercube<dim>(), quadrature));
4374 for (
const auto &cell : tria.active_cell_iterators())
4377 out <<
"# cell " << cell <<
'\n';
4379 if (mapping ==
nullptr || n_points == 2 ||
4380 (!cell->has_boundary_lines() &&
4386 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4387 << cell->material_id() <<
'\n'
4388 << cell->vertex(1) <<
' ' << cell->level() <<
' '
4389 << cell->material_id() <<
'\n'
4390 << cell->vertex(5) <<
' ' << cell->level() <<
' '
4391 << cell->material_id() <<
'\n'
4392 << cell->vertex(4) <<
' ' << cell->level() <<
' '
4393 << cell->material_id() <<
'\n'
4394 << cell->vertex(0) <<
' ' << cell->level() <<
' '
4395 << cell->material_id() <<
'\n'
4398 out << cell->vertex(2) <<
' ' << cell->level() <<
' '
4399 << cell->material_id() <<
'\n'
4400 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4401 << cell->material_id() <<
'\n'
4402 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4403 << cell->material_id() <<
'\n'
4404 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4405 << cell->material_id() <<
'\n'
4406 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4407 << cell->material_id() <<
'\n'
4411 out << cell->vertex(0) <<
' ' << cell->level() <<
' '
4412 << cell->material_id() <<
'\n'
4413 << cell->vertex(2) <<
' ' << cell->level() <<
' '
4414 << cell->material_id() <<
'\n'
4416 out << cell->vertex(1) <<
' ' << cell->level() <<
' '
4417 << cell->material_id() <<
'\n'
4418 << cell->vertex(3) <<
' ' << cell->level() <<
' '
4419 << cell->material_id() <<
'\n'
4421 out << cell->vertex(5) <<
' ' << cell->level() <<
' '
4422 << cell->material_id() <<
'\n'
4423 << cell->vertex(7) <<
' ' << cell->level() <<
' '
4424 << cell->material_id() <<
'\n'
4426 out << cell->vertex(4) <<
' ' << cell->level() <<
' '
4427 << cell->material_id() <<
'\n'
4428 << cell->vertex(6) <<
' ' << cell->level() <<
' '
4429 << cell->material_id() <<
'\n'
4435 for (
const unsigned int v : {0, 1, 2, 0, 3, 2})
4437 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4438 << cell->material_id() <<
'\n';
4442 for (
const unsigned int v : {3, 1})
4444 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4445 << cell->material_id() <<
'\n';
4456 for (
const unsigned int v : {0, 1, 2, 0, 3, 4, 5, 3})
4458 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4459 << cell->material_id() <<
'\n';
4463 for (
const unsigned int v : {1, 4})
4465 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4466 << cell->material_id() <<
'\n';
4470 for (
const unsigned int v : {2, 5})
4472 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4473 << cell->material_id() <<
'\n';
4480 for (
const unsigned int v : {0, 1, 3, 2, 0, 4, 1})
4482 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4483 << cell->material_id() <<
'\n';
4487 for (
const unsigned int v : {2, 4, 3})
4489 out << cell->vertex(v) <<
' ' << cell->level() <<
' '
4490 << cell->material_id() <<
'\n';
4501 for (
const unsigned int face_no :
4504 const typename ::Triangulation<dim,
4505 spacedim>::face_iterator
4508 if (face->at_boundary() &&
4513 cell->reference_cell(),
4515 cell->combined_face_orientation(
face_no),
4516 n_points * n_points);
4517 for (
unsigned int i = 0; i < n_points - 1; ++i)
4518 for (
unsigned int j = 0;
j < n_points - 1; ++
j)
4521 mapping->transform_unit_to_real_cell(
4524 out <<
p0 <<
' ' << cell->level() <<
' '
4525 << cell->material_id() <<
'\n';
4526 out << (mapping->transform_unit_to_real_cell(
4529 offset + (i + 1) * n_points +
j)))
4530 <<
' ' << cell->level() <<
' '
4531 << cell->material_id() <<
'\n';
4532 out << (mapping->transform_unit_to_real_cell(
4535 offset + (i + 1) * n_points +
j + 1)))
4536 <<
' ' << cell->level() <<
' '
4537 << cell->material_id() <<
'\n';
4538 out << (mapping->transform_unit_to_real_cell(
4542 <<
' ' << cell->level() <<
' '
4543 << cell->material_id() <<
'\n';
4545 out <<
p0 <<
' ' << cell->level() <<
' '
4546 << cell->material_id() <<
'\n';
4547 out <<
'\n' <<
'\n';
4552 for (
unsigned int l = 0;
4556 const typename ::Triangulation<dim, spacedim>
::
4560 &
v1 = line->vertex(1);
4561 if (line->at_boundary() ||
4572 u0 = mapping->transform_real_to_unit_cell(cell,
4574 u1 = mapping->transform_real_to_unit_cell(cell,
4576 for (
unsigned int i = 0; i < n_points; ++i)
4578 mapping->transform_unit_to_real_cell(
4580 (1 - boundary_points[i][0]) *
u0 +
4581 boundary_points[i][0] *
u1));
4590 out <<
v0 <<
' ' << cell->level() <<
' '
4591 << cell->material_id() <<
'\n'
4592 <<
v1 <<
' ' << cell->level() <<
' '
4593 << cell->material_id() <<
'\n';
4595 out <<
'\n' <<
'\n';
4612template <
int dim,
int spacedim>
4636 const unsigned int l)
4687 template <
int dim,
int spacedim>
4689 write_eps(const ::Triangulation<dim, spacedim> &tria,
4695 using LineList = std::list<LineEntry>;
4710 const unsigned int n_points =
eps_flags_base.n_boundary_face_points;
4735 for (
const auto &cell : tria.active_cell_iterators())
4738 typename ::Triangulation<dim, spacedim>::line_iterator
4751 if (!line->has_children() &&
4752 (mapping ==
nullptr || !line->at_boundary()))
4773 Point<2>(line->vertex(0)[0], line->vertex(0)[1]),
4774 Point<2>(line->vertex(1)[0], line->vertex(1)[1]),
4775 line->user_flag_set(),
4785 if (mapping !=
nullptr)
4792 std::vector<
Point<dim - 1>> boundary_points(n_points);
4794 for (
unsigned int i = 0; i < n_points; ++i)
4795 boundary_points[i][0] = 1. * (i + 1) / (n_points + 1);
4797 const Quadrature<dim - 1> quadrature(boundary_points);
4800 ReferenceCells::get_hypercube<dim>(), quadrature));
4806 for (
const auto &cell : tria.active_cell_iterators())
4810 const typename ::Triangulation<dim, spacedim>
::
4813 if (face->at_boundary())
4825 cell->reference_cell(),
4827 cell->combined_face_orientation(
face_no),
4829 for (
unsigned int i = 0; i < n_points; ++i)
4832 mapping->transform_unit_to_real_cell(
4838 face->user_flag_set(),
4848 face->user_flag_set(),
4882 const double z_angle = eps_flags_3.azimut_angle;
4883 const double turn_angle = eps_flags_3.turn_angle;
4911 for (
const auto &cell : tria.active_cell_iterators())
4914 typename ::Triangulation<dim, spacedim>::line_iterator
4921 line->user_flag_set(),
4937 double x_min = tria.begin_active()->vertex(0)[0];
4939 double y_min = tria.begin_active()->vertex(0)[1];
4941 unsigned int max_level =
line_list.begin()->level;
4943 for (LineList::const_iterator line =
line_list.begin();
4959 max_level =
std::max(max_level, line->level);
4967 const double scale =
4979 std::time_t
time1 = std::time(
nullptr);
4980 std::tm *time = std::localtime(&
time1);
4981 out <<
"%!PS-Adobe-2.0 EPSF-1.2" <<
'\n'
4982 <<
"%%Title: deal.II Output" <<
'\n'
4983 <<
"%%Creator: the deal.II library" <<
'\n'
4984 <<
"%%Creation Date: " << time->tm_year + 1900 <<
"/"
4985 << time->tm_mon + 1 <<
"/" << time->tm_mday <<
" - "
4986 << time->tm_hour <<
":" << std::setw(2) << time->tm_min <<
":"
4987 << std::setw(2) << time->tm_sec <<
'\n'
4988 <<
"%%BoundingBox: "
4992 <<
static_cast<unsigned int>(
4995 <<
static_cast<unsigned int>(
5005 out <<
"/m {moveto} bind def" <<
'\n'
5006 <<
"/x {lineto stroke} bind def" <<
'\n'
5007 <<
"/b {0 0 0 setrgbcolor} def" <<
'\n'
5008 <<
"/r {1 0 0 setrgbcolor} def" <<
'\n';
5015 out <<
"/l { neg " << (max_level) <<
" add "
5016 << (0.66666 /
std::max(1U, (max_level - 1)))
5017 <<
" mul 1 0.8 sethsbcolor} def" <<
'\n';
5027 if ((dim == 2) && (eps_flags_2.write_cell_numbers ||
5028 eps_flags_2.write_vertex_numbers))
5031 << (
"/R {rmoveto} bind def\n"
5032 "/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont\n"
5033 "dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall\n"
5034 "currentdict end definefont\n"
5035 "/MFshow {{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5036 "[ currentpoint ] exch dup 2 get 0 exch rmoveto dup dup 5 get exch 4 get\n"
5037 "{show} {stringwidth pop 0 rmoveto}ifelse dup 3 get\n"
5038 "{2 get neg 0 exch rmoveto pop} {pop aload pop moveto}ifelse} forall} bind def\n"
5039 "/MFwidth {0 exch {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont\n"
5040 "5 get stringwidth pop add}\n"
5041 "{pop} ifelse} forall} bind def\n"
5042 "/MCshow { currentpoint stroke m\n"
5043 "exch dup MFwidth -2 div 3 -1 roll R MFshow } def\n")
5047 out <<
"%%EndProlog" <<
'\n' <<
'\n';
5056 for (LineList::const_iterator line =
line_list.begin();
5060 out << line->level <<
" l " << (line->first - offset) *
scale <<
" m "
5061 << (line->second - offset) * scale <<
" x" <<
'\n';
5063 out << ((line->colorize &&
eps_flags_base.color_lines_on_user_flag) ?
5067 << (line->
second - offset) *
scale <<
" x" <<
'\n';
5071 if ((dim == 2) && (eps_flags_2.write_cell_numbers ==
true))
5073 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5075 for (
const auto &cell : tria.active_cell_iterators())
5077 out << (cell->center()[0] - offset[0]) * scale <<
' '
5078 << (cell->center()[1] - offset[1]) * scale <<
" m" <<
'\n'
5079 <<
"[ [(Helvetica) 12.0 0.0 true true (";
5080 if (eps_flags_2.write_cell_number_level)
5083 out << cell->index();
5086 <<
"] -6 MCshow" <<
'\n';
5091 if ((dim == 2) && (eps_flags_2.write_vertex_numbers ==
true))
5093 out <<
"(Helvetica) findfont 140 scalefont setfont" <<
'\n';
5100 for (
const auto &cell : tria.active_cell_iterators())
5107 out << (cell->vertex(
vertex_no)[0] - offset[0]) * scale <<
' '
5108 << (cell->vertex(
vertex_no)[1] - offset[1]) * scale
5110 <<
"[ [(Helvetica) 10.0 0.0 true true ("
5111 << cell->vertex_index(
vertex_no) <<
")] "
5112 <<
"] -6 MCshow" <<
'\n';
5116 out <<
"showpage" <<
'\n';
5128template <
int dim,
int spacedim>
5138template <
int dim,
int spacedim>
5195template <
int dim,
int spacedim>
5206#include "grid/grid_out.inst"
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
static DataSetDescriptor face(const ReferenceCell &reference_cell, const unsigned int face_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points)
static Quadrature< dim > project_to_all_faces(const ReferenceCell &reference_cell, const hp::QCollection< dim - 1 > &quadrature)
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInvalidState()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
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)
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)
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
::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)
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