133 dealii::Triangulation<dim> &triangulation)
const override
137 dealii::Triangulation<dim, dim> tria1;
138 tria1.set_mesh_smoothing(triangulation.get_mesh_smoothing());
143 if constexpr (dim == 1) {
144 dealii::GridGenerator::
145 subdivided_hyper_rectangle_with_simplices<dim, dim>(
147 }
else if constexpr (dim == 2) {
148 dealii::GridGenerator::subdivided_hyper_rectangle_with_simplices(
153 }
else if constexpr (dim == 3) {
154 dealii::GridGenerator::subdivided_hyper_rectangle_with_simplices(
164 if constexpr (dim == 1) {
165 dealii::GridGenerator::subdivided_hyper_rectangle<dim, dim>(
167 }
else if constexpr (dim == 2) {
168 dealii::GridGenerator::subdivided_hyper_rectangle(
173 }
else if constexpr (dim == 3) {
174 dealii::GridGenerator::subdivided_hyper_rectangle(
182 triangulation.copy_triangulation(tria1);
191 triangulation.set_all_manifold_ids(1);
192 triangulation.set_manifold(1, grading);
197 for (
auto cell : triangulation.active_cell_iterators()) {
198 for (
auto f : cell->face_indices()) {
199 auto face = cell->face(f);
200 if (!face->at_boundary())
202 const auto position = face->center();
209 if constexpr (dim >= 2) {
216 if constexpr (dim == 3) {
225 std::vector<int> directions;
231 "For prescribing periodic boundaries in x-direction, "
232 "both, the left and right boundary conditions must "
233 "be set to periodic"));
234 directions.push_back(0);
241 "For prescribing periodic boundaries in y-direction, "
242 "both, the bottom and top boundary conditions must "
243 "be set to periodic"));
244 directions.push_back(1);
251 "For prescribing periodic boundaries in z-direction, "
252 "both, the back and front boundary conditions must "
253 "be set to periodic"));
254 directions.push_back(2);
257#ifndef BUG_COLLECT_PERIODIC_FACES_INSTANTIATION
258 if (!directions.empty()) {
259 std::vector<dealii::GridTools::PeriodicFacePair<
260 typename dealii::Triangulation<dim>::cell_iterator>>
263 for (
const auto direction : directions)
264 dealii::GridTools::collect_periodic_faces(
270 triangulation.add_periodicity(periodic_faces);