12 if constexpr (dim != 3 || spacedim != 3)
17 "The Fichera oven mesh is only supported in 3D space with 3D elements."));
22 const std::vector<std::string> arguments =
25 if (arguments.size() < 2)
29 "The Fichera oven grid requires at least 2 arguments: "
30 "(bottom_left : top_right [: colorize]). "
31 "Points are given as x,y,z and colorize as true/false."));
35 std::stringstream bottom_left_stream(arguments[0]);
36 std::vector<double> bottom_left_coords;
37 std::string coord_str;
38 while (getline(bottom_left_stream, coord_str,
','))
39 bottom_left_coords.push_back(std::stod(coord_str));
41 AssertThrow(bottom_left_coords.size() ==
static_cast<unsigned int>(dim),
42 ExcMessage(
"The bottom_left point must have exactly " +
43 std::to_string(dim) +
" coordinates (x,y,z format)."));
45 this->
bottom_left = Point<dim>(bottom_left_coords[0],
46 bottom_left_coords[1],
47 bottom_left_coords[2]);
50 std::stringstream top_right_stream(arguments[1]);
51 std::vector<double> top_right_coords;
52 while (getline(top_right_stream, coord_str,
','))
53 top_right_coords.push_back(std::stod(coord_str));
55 AssertThrow(top_right_coords.size() ==
static_cast<unsigned int>(dim),
56 ExcMessage(
"The top_right point must have exactly " +
57 std::to_string(dim) +
" coordinates (x,y,z format)."));
59 Point<dim>(top_right_coords[0], top_right_coords[1], top_right_coords[2]);
63 (arguments.size() > 2 && arguments[2] ==
"true") ? true :
false;
72 Triangulation<3> bulk_tria;
73 std::vector<unsigned int> repetitions = {2, 2, 3};
74 GridGenerator::subdivided_hyper_rectangle(bulk_tria,
83 std::set<Triangulation<3>::active_cell_iterator> cells_to_remove;
84 for (
const auto &cell : bulk_tria.active_cell_iterators())
86 const Point<3> cell_center = cell->center();
89 if ((cell_center[0] > dimensions[0] / 2) &&
90 (cell_center[1] > dimensions[1] / 2) &&
91 (cell_center[2] > dimensions[2] / 3))
93 cells_to_remove.insert(cell);
96 if ((cell_center[0] > dimensions[0] / 2) &&
97 (cell_center[1] < dimensions[1] / 2) &&
98 (cell_center[2] > 2. * dimensions[2] / 3))
100 cells_to_remove.insert(cell);
103 if ((cell_center[0] < dimensions[0] / 2) &&
104 (cell_center[1] > dimensions[1] / 2) &&
105 (cell_center[2] > 2. * dimensions[2] / 3))
107 cells_to_remove.insert(cell);
112 GridGenerator::create_triangulation_with_removed_cells(bulk_tria,
123 for (
const auto &face : triangulation.active_face_iterators())
124 if (face->at_boundary())
126 const Point<3> face_center = face->center();
127 if (std::abs(face_center[2] - dimensions[2]) < 1e-12)
128 face->set_boundary_id(1);