54 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
59 const std::vector<
bool> &marked_vertices)
67 const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
69 Assert(tria.get_vertices().size() == marked_vertices.size() ||
70 marked_vertices.empty(),
72 marked_vertices.size()));
82 marked_vertices.empty() ||
83 std::equal(marked_vertices.begin(),
84 marked_vertices.end(),
85 tria.get_used_vertices().begin(),
86 [](
bool p,
bool q) { return !p || q; }),
88 "marked_vertices should be a subset of used vertices in the triangulation "
89 "but marked_vertices contains one or more vertices that are not used vertices!"));
97 const std::vector<bool> &used =
98 (marked_vertices.empty()) ? tria.get_used_vertices() : marked_vertices;
102 std::vector<bool>::const_iterator
first =
103 std::find(used.begin(), used.end(),
true);
117 double dist = (p - vertices[
j]).norm_square();
130 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
136 const std::vector<
bool> &marked_vertices)
139 if (mapping.preserves_vertex_locations() ==
true)
150 Assert(tria.get_vertices().size() == marked_vertices.size() ||
151 marked_vertices.empty(),
153 marked_vertices.size()));
163 marked_vertices.empty() ||
164 std::equal(marked_vertices.begin(),
165 marked_vertices.end(),
166 tria.get_used_vertices().begin(),
167 [](
bool p,
bool q) { return !p || q; }),
169 "marked_vertices should be a subset of used vertices in the triangulation "
170 "but marked_vertices contains one or more vertices that are not used vertices!"));
173 if (marked_vertices.size())
174 for (
auto it = vertices.begin();
it != vertices.end();)
176 if (marked_vertices[
it->first] ==
false)
178 vertices.erase(
it++);
191 template <
typename MeshType>
194 std::vector<typename MeshType::active_cell_iterator>
198 MeshType::space_dimension,
202 const unsigned int vertex)
205 const int spacedim = MeshType::space_dimension;
211 Assert(
mesh.get_triangulation().get_used_vertices()[vertex],
217 std::set<typename ::internal::
218 ActiveCellIterator<dim, spacedim, MeshType>::type>
221 typename ::internal::ActiveCellIterator<dim, spacedim, MeshType>::type
222 cell =
mesh.begin_active(),
258 for (; cell !=
endc; ++cell)
260 for (
const unsigned int v : cell->vertex_indices())
261 if (cell->vertex_index(v) == vertex)
274 const auto reference_cell = cell->reference_cell();
275 for (
const auto face :
276 reference_cell.faces_for_given_vertex(v))
277 if (!cell->at_boundary(face) &&
278 cell->neighbor(face)->is_active())
301 for (
unsigned int e = 0; e < cell->n_lines(); ++e)
302 if (cell->line(e)->has_children())
306 if (cell->line(e)->child(0)->vertex_index(1) == vertex)
329 return std::vector<typename ::internal::
330 ActiveCellIterator<dim, spacedim, MeshType>::type>(
338 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
344 std::set<typename MeshType<dim, spacedim>::active_cell_iterator>
346 std::set<typename MeshType<dim, spacedim>::active_cell_iterator>
350 typename ::internal::
351 ActiveCellIterator<dim, spacedim,
MeshType<dim, spacedim>>::type>
355 ActiveCellIterator<dim, spacedim,
MeshType<dim, spacedim>>::type>
360 using cell_iterator =
363 using cell_iterator = typename ::internal::
364 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type;
394 cell_iterator
it =
mesh.begin_active();
407 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
413 typename ::internal::
414 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type
418 const std::vector<bool> &marked_vertices,
419 const double tolerance)
432 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
436 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
438 std::pair<typename ::internal::
439 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
445 const std::vector<bool> &marked_vertices,
446 const double tolerance)
448 using active_cell_iterator = typename ::internal::
449 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type;
457 std::pair<active_cell_iterator, Point<dim>>
best_cell;
483 const auto n_active_cells =
mesh.get_triangulation().n_active_cells();
490 if (cell->is_artificial() ==
false)
493 if (marked_vertices.size() > 0)
496 for (
const auto &v : cell->vertex_indices())
498 if (marked_vertices[cell->vertex_index(v)])
511 mapping.transform_real_to_unit_cell(cell, p);
516 cell->reference_cell().closest_point(
p_cell).distance(
573 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
577 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
580 std::vector<std::pair<
581 typename ::internal::
582 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
588 const double tolerance,
589 const std::vector<bool> &marked_vertices)
592 mapping,
mesh, p, marked_vertices, tolerance);
603 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
607 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
610 std::vector<std::pair<
611 typename ::internal::
612 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
619 const double tolerance,
627 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
637 std::vector<typename MeshType<dim, spacedim>::active_cell_iterator>
640 if (
my_cell->reference_cell().is_hyper_cube())
648 for (
unsigned int d = 0; d < dim; ++d)
661 unsigned int neighbor_index =
664 if (!
my_cell->at_boundary(neighbor_index))
683 for (
unsigned int d = 0; d < dim; ++d)
694 if (vertex_to_cells !=
nullptr)
695 fu((*vertex_to_cells)[vertex_index]);
709 for (
unsigned int d = 0; d < dim; ++d)
715 unit_point[d] > 0.5 ? 1 : 0;
729 for (
unsigned int d = 0; d < 2; ++d)
746 const auto vertex_index =
749 if (vertex_to_cells !=
nullptr)
750 fu((*vertex_to_cells)[vertex_index]);
764 for (
const auto v :
my_cell->vertex_indices())
781 const auto vertex_index =
my_cell->vertex_index(v);
783 if (vertex_to_cells !=
nullptr)
784 fu((*vertex_to_cells)[vertex_index]);
796 mapping.transform_real_to_unit_cell(cell, p);
797 if (cell->reference_cell().contains_point(
p_unit, tolerance))
810 Point<dim>> &b) { return a.first < b.first; });
817 template <
typename MeshType>
822 const std::function<
bool(
const typename MeshType::active_cell_iterator &)>
827 mesh.get_triangulation().n_vertices(),
false);
838 for (
const auto &cell :
mesh.active_cell_iterators())
840 for (
const auto v : cell->vertex_indices())
851 for (
const auto &cell :
mesh.active_cell_iterators())
852 if (!predicate(cell))
853 for (
const auto v : cell->vertex_indices())
866 template <
typename MeshType>
871 const std::function<
bool(
const typename MeshType::cell_iterator &)>
873 const unsigned int level)
877 mesh.get_triangulation().n_vertices(),
false);
882 for (
typename MeshType::cell_iterator cell =
mesh.begin(
level);
886 for (
const unsigned int v : cell->vertex_indices())
893 for (
typename MeshType::cell_iterator cell =
mesh.begin(
level);
896 if (!predicate(cell))
897 for (
const unsigned int v : cell->vertex_indices())
911 template <
typename MeshType>
914 const std::vector<typename MeshType::active_cell_iterator> &cells)
916 for (
typename std::vector<
917 typename MeshType::active_cell_iterator>::const_iterator
it =
922 if ((*it)->is_locally_owned())
928 template <
typename MeshType>
931 const std::vector<typename MeshType::active_cell_iterator> &cells)
933 for (
typename std::vector<
934 typename MeshType::active_cell_iterator>::const_iterator
it =
939 if ((*it)->is_artificial())
948 template <
typename MeshType>
954 std::function<
bool(
const typename MeshType::active_cell_iterator &)>
957 const std::vector<typename MeshType::active_cell_iterator>
963 ExcMessage(
"Halo layer contains locally owned cells"));
965 ExcMessage(
"Halo layer contains artificial cells"));
972 template <
typename MeshType>
977 const std::function<
bool(
const typename MeshType::active_cell_iterator &)>
981 std::vector<typename MeshType::active_cell_iterator>
984 mesh.get_triangulation().n_vertices(),
false);
986 const unsigned int spacedim = MeshType::space_dimension;
996 for (
const auto &cell :
mesh.active_cell_iterators())
997 if (!predicate(cell))
999 for (
const unsigned int v : cell->vertex_indices())
1010 return std::vector<typename MeshType::active_cell_iterator>();
1014 for (
const auto &cell :
mesh.active_cell_iterators())
1015 if (predicate(cell))
1017 for (
const unsigned int v : cell->vertex_indices())
1030 const double DOUBLE_EPSILON = 100. * std::numeric_limits<double>::epsilon();
1033 for (
unsigned int d = 0; d < spacedim; ++d)
1039 std::vector<Point<spacedim>>
1048 for (
typename std::vector<typename MeshType::active_cell_iterator>::
1054 const std::pair<Point<spacedim>,
double>
1056 (*subdomain_boundary_cell_iterator)->enclosing_ball();
1073 for (
const auto &cell :
mesh.active_cell_iterators())
1076 if (predicate(cell))
1080 cell->enclosing_ball();
1088 for (
unsigned int d = 0; d < spacedim; ++d)
1091 bounding_box.first[d]) &&
1093 bounding_box.second[d]);
1117 template <
typename MeshType>
1127 std::function<
bool(
const typename MeshType::active_cell_iterator &)>
1130 const std::vector<typename MeshType::active_cell_iterator>
1142 "Ghost cells within layer_thickness contains locally owned cells."));
1147 "Ghost cells within layer_thickness contains artificial cells. "
1148 "The function compute_ghost_cell_layer_within_distance "
1149 "is probably called while using parallel::distributed::Triangulation. "
1150 "In such case please refer to the description of this function."));
1157 template <
typename MeshType>
1163 const std::function<
bool(
1165 active_cell_iterator &)>
1169 mesh.get_triangulation().n_vertices(),
false);
1171 const unsigned int spacedim = MeshType::space_dimension;
1178 for (
const auto &cell :
mesh.active_cell_iterators())
1179 if (predicate(cell))
1181 minp = cell->center();
1182 maxp = cell->center();
1188 for (
const auto &cell :
mesh.active_cell_iterators())
1189 if (predicate(cell))
1190 for (
const unsigned int v : cell->vertex_indices())
1196 for (
unsigned int d = 0; d < spacedim; ++d)
1208 template <
typename MeshType>
1210 std::list<std::pair<
1211 typename MeshType::cell_iterator,
1218 ExcMessage(
"The two meshes must be represent triangulations that "
1219 "have the same coarse meshes"));
1227#ifdef DEAL_II_WITH_MPI
1230 constexpr int spacedim = MeshType::space_dimension;
1232 *
>(&
mesh_1.get_triangulation()) !=
nullptr ||
1234 *
>(&
mesh_2.get_triangulation()) !=
nullptr)
1237 ExcMessage(
"This function can only be used with meshes "
1238 "corresponding to distributed Triangulations when "
1239 "both Triangulations are equal."));
1252 using CellList = std::list<std::pair<
typename MeshType::cell_iterator,
1253 typename MeshType::cell_iterator>>;
1257 typename MeshType::cell_iterator
cell_1 =
mesh_1.begin(0),
1263 typename CellList::iterator
cell_pair = cell_list.begin();
1274 for (
unsigned int c = 0; c <
cell_pair->first->n_children(); ++c)
1275 cell_list.emplace_back(
cell_pair->first->child(c),
1290 !
cell_pair->first->is_locally_owned()) ||
1292 !
cell_pair->second->is_locally_owned())))
1318 template <
int dim,
int spacedim>
1340 for (
const unsigned int v :
cell_1->vertex_indices())
1354 template <
typename MeshType>
1359 mesh_2.get_triangulation());
1364 template <
int dim,
int spacedim>
1365 std::pair<typename DoFHandler<dim, spacedim>::active_cell_iterator,
1371 const double tolerance)
1374 (mapping.
size() ==
mesh.get_fe_collection().size()),
1375 ExcMessage(
"Mapping collection needs to have either size 1 "
1376 "or size equal to the number of elements in "
1377 "the FECollection."));
1379 using cell_iterator =
1382 std::pair<cell_iterator, Point<dim>>
best_cell;
1386 if (mapping.
size() == 1)
1388 const std::vector<bool> marked_vertices = {};
1390 mapping[0],
mesh, p, marked_vertices, tolerance);
1423 const auto n_cells =
mesh.get_triangulation().n_cells();
1433 mapping[cell->active_fe_index()]
1434 .transform_real_to_unit_cell(cell, p);
1440 cell->reference_cell().closest_point(
p_cell).distance(
1493 template <
typename MeshType>
1498 Assert(cell->is_locally_owned(),
1499 ExcMessage(
"This function only makes sense if the cell for "
1500 "which you are asking for a patch, is locally "
1503 std::vector<typename MeshType::active_cell_iterator>
patch;
1504 patch.push_back(cell);
1505 for (
const unsigned int face_number : cell->face_indices())
1506 if (cell->face(face_number)->at_boundary() ==
false)
1508 if (cell->neighbor(face_number)->has_children() ==
false)
1509 patch.push_back(cell->neighbor(face_number));
1516 for (
unsigned int subface = 0;
1517 subface < cell->face(face_number)->n_children();
1520 cell->neighbor_child_on_subface(face_number, subface));
1526 typename MeshType::cell_iterator neighbor =
1527 cell->neighbor(face_number);
1528 while (neighbor->has_children())
1529 neighbor = neighbor->child(1 - face_number);
1531 Assert(neighbor->neighbor(1 - face_number) == cell,
1533 patch.push_back(neighbor);
1541 template <
class Container>
1542 std::vector<typename Container::cell_iterator>
1544 const std::vector<typename Container::active_cell_iterator> &
patch)
1548 "Vector containing patch cells should not be an empty vector!"));
1552 int min_level =
patch[0]->level();
1554 for (
unsigned int i = 0; i <
patch.size(); ++i)
1557 typename std::vector<
1558 typename Container::active_cell_iterator>::const_iterator
patch_cell;
1565 if ((*patch_cell)->level() == min_level)
1573 typename Container::cell_iterator parent = *
patch_cell;
1575 while (parent->level() > min_level)
1576 parent = parent->parent();
1581 return std::vector<typename Container::cell_iterator>(
uniform_cells.begin(),
1587 template <
class Container>
1590 const std::vector<typename Container::active_cell_iterator> &
patch,
1595 Container::space_dimension>::active_cell_iterator,
1599 const std::vector<typename Container::cell_iterator>
uniform_cells =
1603 std::vector<Point<Container::space_dimension>> vertices;
1608 typename std::vector<typename Container::cell_iterator>::const_iterator
1614 for (
const unsigned int v : (*uniform_cell)->vertex_indices())
1617 (*uniform_cell)->vertex(v);
1620 for (
unsigned int m = 0; m < i; ++m)
1622 if (position == vertices[m])
1625 cells[
k].vertices[v] = m;
1631 vertices.push_back(position);
1632 cells[
k].vertices[v] = i;
1643 unsigned int index = 0;
1646 Container::space_dimension>::cell_iterator,
1647 typename Container::cell_iterator>
1650 Container::space_dimension>::cell_iterator
1679 for (
unsigned int i = 0; i <
patch.size(); ++i)
1689 for (
const unsigned int v :
1710 Container::dimension,
1711 Container::space_dimension>::cell_iterator cell =
1719 if (cell->has_children())
1726 for (
unsigned int c = 0; c < cell->n_children(); ++c)
1768 Container::space_dimension>::cell_iterator
1773 if (cell->user_flag_set())
1779 Assert(cell->center().distance(
1781 1e-15 * cell->diameter(),
1789 Container::space_dimension>::cell_iterator,
1790 typename Container::cell_iterator>::iterator
1802 template <
int dim,
int spacedim>
1805 std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
1819 std::set<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
1822 std::vector<types::global_dof_index> local_dof_indices;
1828 std::vector<bool> user_flags;
1833 std::map<typename DoFHandler<dim, spacedim>::active_line_iterator,
1839 dof_handler.get_triangulation().save_user_flags(user_flags);
1841 dof_handler.get_triangulation())
1842 .clear_user_flags();
1846 cell = dof_handler.begin_active(),
1847 endc = dof_handler.end();
1848 for (; cell !=
endc; ++cell)
1854 if (cell->is_artificial() ==
false)
1856 for (
unsigned int l = 0; l < cell->n_lines(); ++l)
1857 if (cell->line(l)->has_children())
1858 for (
unsigned int c = 0; c < cell->line(l)->n_children();
1865 cell->line(l)->child(c)->set_user_flag();
1879 cell = dof_handler.begin_active(),
1880 endc = dof_handler.end();
1881 for (; cell !=
endc; ++cell)
1886 if (cell->is_artificial() ==
false)
1888 const unsigned int n_dofs_per_cell =
1889 cell->
get_fe().n_dofs_per_cell();
1890 local_dof_indices.resize(n_dofs_per_cell);
1894 cell->get_dof_indices(local_dof_indices);
1895 for (
unsigned int i = 0; i < n_dofs_per_cell; ++i)
1906 for (
const unsigned int f : cell->face_indices())
1908 if (cell->face(f)->has_children())
1910 for (
unsigned int c = 0; c < cell->face(f)->n_children();
1925 Assert(cell->face(f)->child(c)->has_children() ==
false,
1928 const unsigned int n_dofs_per_face =
1929 cell->
get_fe().n_dofs_per_face(f, c);
1932 cell->face(f)->child(c)->get_dof_indices(
1934 for (
unsigned int i = 0; i < n_dofs_per_face; ++i)
1939 else if ((cell->face(f)->at_boundary() ==
false) &&
1940 (cell->neighbor_is_coarser(f)))
1957 std::pair<unsigned int, unsigned int>
1959 cell->neighbor_of_coarser_neighbor(f);
1963 const unsigned int n_dofs_per_face =
1967 cell->neighbor(f)->face(
face_no)->get_dof_indices(
1969 for (
unsigned int i = 0; i < n_dofs_per_face; ++i)
1975 for (
unsigned int c = 0;
1976 c < cell->neighbor(f)->face(
face_no)->n_children();
1982 const unsigned int n_dofs_per_face =
1989 ->has_children() ==
false,
1995 for (
unsigned int i = 0; i < n_dofs_per_face; ++i)
2013 for (
unsigned int l = 0; l < cell->n_lines(); ++l)
2015 if (cell->line(l)->has_children())
2017 for (
unsigned int c = 0;
2018 c < cell->line(l)->n_children();
2021 Assert(cell->line(l)->child(c)->has_children() ==
2027 const unsigned int n_dofs_per_line =
2028 2 * cell->
get_fe().n_dofs_per_vertex() +
2029 cell->
get_fe().n_dofs_per_line();
2032 cell->line(l)->child(c)->get_dof_indices(
2034 for (
unsigned int i = 0; i < n_dofs_per_line; ++i)
2043 else if (cell->line(l)->user_flag_set() ==
true)
2052 const unsigned int n_dofs_per_line =
2053 2 * cell->
get_fe().n_dofs_per_vertex() +
2054 cell->
get_fe().n_dofs_per_line();
2058 for (
unsigned int i = 0; i < n_dofs_per_line; ++i)
2062 for (
unsigned int c = 0; c <
parent_line->n_children();
2069 const unsigned int n_dofs_per_line =
2070 2 * cell->
get_fe().n_dofs_per_vertex() +
2071 cell->
get_fe().n_dofs_per_line();
2076 for (
unsigned int i = 0; i < n_dofs_per_line; ++i)
2093 dof_handler.get_triangulation())
2094 .load_user_flags(user_flags);
2101 std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
2106 std::set<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
::
2109 for (;
it != it_end; ++
it)
2119 template <
typename CellIterator>
2122 std::set<std::pair<CellIterator, unsigned int>> &
pairs1,
2125 const unsigned int direction,
2131 static const int space_dim = CellIterator::AccessorType::space_dimension;
2137 constexpr int dim = CellIterator::AccessorType::dimension;
2138 constexpr int spacedim = CellIterator::AccessorType::space_dimension;
2143 if (!(((
pairs1.size() > 0) &&
2144 (
dynamic_cast<const parallel::fullydistributed::
2145 Triangulation<dim, spacedim> *
>(
2146 &
pairs1.begin()->first->get_triangulation()) !=
nullptr)) ||
2150 *
>(&
pairs2.begin()->first->get_triangulation()) !=
nullptr))))
2152 ExcMessage(
"Unmatched faces on periodic boundaries"));
2160 typename std::set<std::pair<CellIterator, unsigned int>>::const_iterator;
2165 const CellIterator
cell1 =
it1->first;
2166 const CellIterator
cell2 =
it2->first;
2169 if (
const std::optional<unsigned char> orientation =
2182 orientation.value(),
2198 constexpr int dim = CellIterator::AccessorType::dimension;
2199 constexpr int spacedim = CellIterator::AccessorType::space_dimension;
2200 if (!(((
pairs1.size() > 0) &&
2201 (
dynamic_cast<const parallel::fullydistributed::
2202 Triangulation<dim, spacedim> *
>(
2203 &
pairs1.begin()->first->get_triangulation()) !=
nullptr)) ||
2207 *
>(&
pairs2.begin()->first->get_triangulation()) !=
nullptr))))
2209 ExcMessage(
"Unmatched faces on periodic boundaries"));
2215 template <
typename MeshType>
2220 const unsigned int direction,
2227 static const int space_dim = MeshType::space_dimension;
2237 std::set<std::pair<typename MeshType::cell_iterator, unsigned int>>
pairs1;
2238 std::set<std::pair<typename MeshType::cell_iterator, unsigned int>>
pairs2;
2240 for (
typename MeshType::cell_iterator cell =
mesh.begin(0);
2241 cell !=
mesh.end(0);
2244 const typename MeshType::face_iterator
face_1 =
2245 cell->face(2 * direction);
2246 const typename MeshType::face_iterator
face_2 =
2247 cell->face(2 * direction + 1);
2251 const std::pair<typename MeshType::cell_iterator, unsigned int>
2252 pair1 = std::make_pair(cell, 2 * direction);
2258 const std::pair<typename MeshType::cell_iterator, unsigned int>
2259 pair2 = std::make_pair(cell, 2 * direction + 1);
2265 ExcMessage(
"Unmatched faces on periodic boundaries"));
2268 ExcMessage(
"No new periodic face pairs have been found. "
2269 "Are you sure that you've selected the correct boundary "
2270 "id's and that the coarsest level mesh is colorized?"));
2288 "Found a face match with non standard orientation. "
2289 "This function is only suitable for meshes with cells "
2290 "in default orientation"));
2297 template <
typename MeshType>
2303 const unsigned int direction,
2310 static const int space_dim = MeshType::space_dimension;
2318 std::set<std::pair<typename MeshType::cell_iterator, unsigned int>>
pairs1;
2319 std::set<std::pair<typename MeshType::cell_iterator, unsigned int>>
pairs2;
2321 for (
typename MeshType::cell_iterator cell =
mesh.begin(0);
2322 cell !=
mesh.end(0);
2325 for (
const unsigned int i : cell->face_indices())
2327 const typename MeshType::face_iterator face = cell->face(i);
2328 if (face->at_boundary() && face->boundary_id() ==
b_id1)
2330 const std::pair<typename MeshType::cell_iterator, unsigned int>
2331 pair1 = std::make_pair(cell, i);
2335 if (face->at_boundary() && face->boundary_id() ==
b_id2)
2337 const std::pair<typename MeshType::cell_iterator, unsigned int>
2338 pair2 = std::make_pair(cell, i);
2350 if (!(((
pairs1.size() > 0) &&
2353 *
>(&
pairs1.begin()->first->get_triangulation()) !=
nullptr)) ||
2357 *
>(&
pairs2.begin()->first->get_triangulation()) !=
nullptr))))
2359 ExcMessage(
"Unmatched faces on periodic boundaries"));
2365 &
mesh.begin()->get_triangulation()) !=
nullptr)),
2366 ExcMessage(
"No new periodic face pairs have been found. "
2367 "Are you sure that you've selected the correct boundary "
2368 "id's and that the coarsest level mesh is colorized?"));
2386 template <
int spacedim>
2390 const unsigned int direction,
2400 if (matrix.m() == spacedim)
2401 for (
unsigned int i = 0; i < spacedim; ++i)
2402 for (
unsigned int j = 0;
j < spacedim; ++
j)
2403 distance[i] += matrix(i,
j) *
point1[
j];
2407 distance += offset -
point2;
2409 for (
unsigned int i = 0; i < spacedim; ++i)
2415 if (
std::abs(distance[i]) > 1.e-10)
2424 template <
typename FaceIterator>
2425 std::optional<unsigned char>
2429 const unsigned int direction,
2433 Assert(matrix.m() == matrix.n(),
2434 ExcMessage(
"The supplied matrix must be a square matrix"));
2436 static const int dim = FaceIterator::AccessorType::dimension;
2440 std::array<unsigned int, GeometryInfo<dim>::vertices_per_face>
2449 for (
unsigned int i = 0; i <
face1->n_vertices(); ++i)
2452 for (
unsigned int i = 0; i <
face1->n_vertices(); ++i)
2486 const auto reference_cell =
face1->reference_cell();
2489 return std::make_optional(reference_cell.get_combined_orientation(
2496 return std::nullopt;
2501#include "grid_tools_dof_handlers.inst"
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
Abstract base class for mapping classes.
static constexpr unsigned char default_combined_face_orientation()
static constexpr unsigned int dimension
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcVertexNotUsed(unsigned int arg1)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::line_iterator line_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
static const unsigned int invalid_unsigned_int
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 > abs(const ::VectorizedArray< Number, width > &)
unsigned int global_dof_index