From 01f604d8b383ea53fa22d38046f24432661d74ff Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Tue, 30 Jun 2020 22:21:02 +0200 Subject: [PATCH] Remove GeometryInfro from a few files --- include/deal.II/dofs/dof_accessor.templates.h | 2 +- .../fe/fe_tools_interpolate.templates.h | 6 +- include/deal.II/grid/grid_tools.h | 7 +- .../deal.II/matrix_free/face_setup_internal.h | 6 +- .../matrix_free/matrix_free.templates.h | 5 +- include/deal.II/meshworker/loop.h | 3 +- include/deal.II/meshworker/mesh_loop.h | 4 +- .../deal.II/multigrid/mg_constrained_dofs.h | 2 +- .../numerics/error_estimator.templates.h | 4 +- .../numerics/matrix_creator.templates.h | 8 +- .../vector_tools_boundary.templates.h | 80 +++++++------------ .../vector_tools_constraints.templates.h | 4 +- .../numerics/vector_tools_rhs.templates.h | 8 +- 13 files changed, 57 insertions(+), 82 deletions(-) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 830fd3ca35..069a0eb539 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -2408,7 +2408,7 @@ DoFCellAccessor:: GeometryInfo::faces_per_cell> face_iterators; - for (unsigned int i : GeometryInfo::face_indices()) + for (unsigned int i : this->face_indices()) face_iterators[i] = dealii::internal::DoFCellAccessorImplementation::get_face( *this, i, std::integral_constant()); diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index adb96ff720..d567cdcb56 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -162,7 +162,7 @@ namespace FETools (constraints.n_constraints() == 0)); if (hanging_nodes_not_allowed) - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell1->face_indices()) Assert(cell1->at_boundary(face) || cell1->neighbor(face)->level() == cell1->level(), ExcHangingNodesNotAllowed()); @@ -315,7 +315,7 @@ namespace FETools (cell->get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); if (hanging_nodes_not_allowed) - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) Assert(cell->at_boundary(face) || cell->neighbor(face)->level() == cell->level(), ExcHangingNodesNotAllowed()); @@ -648,7 +648,7 @@ namespace FETools (dof1.get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); if (hanging_nodes_not_allowed) - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) Assert(cell->at_boundary(face) || cell->neighbor(face)->level() == cell->level(), ExcHangingNodesNotAllowed()); diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 3d6e6fd29a..aebd0cd7db 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -3215,7 +3215,7 @@ namespace GridTools cell = triangulation.begin_active(), endc = triangulation.end(); for (; cell != endc; ++cell) - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->has_children() && !cell->face(face)->at_boundary()) { @@ -3231,7 +3231,7 @@ namespace GridTools cell = triangulation.begin_active(), endc = triangulation.end(); for (; cell != endc; ++cell) - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->has_children() && !cell->face(face)->at_boundary()) { @@ -3296,8 +3296,7 @@ namespace GridTools std::vector &active_neighbors) { active_neighbors.clear(); - for (const unsigned int n : - GeometryInfo::face_indices()) + for (const unsigned int n : cell->face_indices()) if (!cell->at_boundary(n)) { if (MeshType::dimension == 1) diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index ae3b6b2d04..c9a1ede8ce 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -203,7 +203,7 @@ namespace internal continue; typename dealii::Triangulation::cell_iterator dcell( &triangulation, cell_levels[i].first, cell_levels[i].second); - for (const unsigned int f : GeometryInfo::face_indices()) + for (const unsigned int f : dcell->face_indices()) { if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f)) continue; @@ -571,7 +571,7 @@ namespace internal &triangulation, cell_levels[i].first, cell_levels[i].second); if (use_active_cells) Assert(dcell->is_active(), ExcNotImplemented()); - for (auto f : GeometryInfo::face_indices()) + for (const auto f : dcell->face_indices()) { if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f)) face_is_owned[dcell->face(f)->index()] = @@ -767,7 +767,7 @@ namespace internal &triangulation, cell_levels[cell].first, cell_levels[cell].second); - for (const unsigned int f : GeometryInfo::face_indices()) + for (const auto f : dcell->face_indices()) { // boundary face if (face_is_owned[dcell->face(f)->index()] == diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index e9a0888b2c..9aadc8521f 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -628,7 +628,7 @@ namespace internal new_indices.clear(); typename dealii::Triangulation::cell_iterator dcell( &tria, cell_level_index[cell].first, cell_level_index[cell].second); - for (auto f : GeometryInfo::face_indices()) + for (auto f : dcell->face_indices()) { // Only inner faces couple different cells if (dcell->at_boundary(f) == false && @@ -931,8 +931,7 @@ namespace internal for (const auto &cell : dof_handler[no]->cell_iterators_on_level(mg_level + 1)) if (cell->level_subdomain_id() == task_info.my_pid) - for (const unsigned int f : - GeometryInfo::face_indices()) + for (const unsigned int f : cell->face_indices()) if ((cell->at_boundary(f) == false || cell->has_periodic_neighbor(f) == true) && cell->level() > diff --git a/include/deal.II/meshworker/loop.h b/include/deal.II/meshworker/loop.h index 151fb67661..ee9293abb0 100644 --- a/include/deal.II/meshworker/loop.h +++ b/include/deal.II/meshworker/loop.h @@ -243,8 +243,7 @@ namespace MeshWorker info.post_cell(dof_info); if (integrate_interior_face || integrate_boundary) - for (const unsigned int face_no : GeometryInfo< - ITERATOR::AccessorType::Container::dimension>::face_indices()) + for (const unsigned int face_no : cell->face_indices()) { typename ITERATOR::AccessorType::Container::face_iterator face = cell->face(face_no); diff --git a/include/deal.II/meshworker/mesh_loop.h b/include/deal.II/meshworker/mesh_loop.h index 21a22c2b32..79445a8ef9 100644 --- a/include/deal.II/meshworker/mesh_loop.h +++ b/include/deal.II/meshworker/mesh_loop.h @@ -340,9 +340,7 @@ namespace MeshWorker cell_worker(cell, scratch, copy); if (flags & (work_on_faces | work_on_boundary)) - for (const unsigned int face_no : - GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) { if (cell->at_boundary(face_no) && !cell->has_periodic_neighbor(face_no)) diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index d60ac04867..7a1f228f7b 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -277,7 +277,7 @@ MGConstrainedDoFs::initialize(const DoFHandler &dof) for (; cell != endc; ++cell) if (cell->level_subdomain_id() != numbers::artificial_subdomain_id) { - for (auto f : GeometryInfo::face_indices()) + for (auto f : cell->face_indices()) if (cell->has_periodic_neighbor(f) && cell->periodic_neighbor(f)->level() == cell->level()) { diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index 921395dbd2..beb539b0aa 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -881,7 +881,7 @@ namespace internal local_face_integrals.clear(); // loop over all faces of this cell - for (const unsigned int face_no : GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) { const typename DoFHandler::face_iterator face = cell->face(face_no); @@ -1290,7 +1290,7 @@ KellyErrorEstimator::estimate( const unsigned int present_cell = cell->active_cell_index(); // loop over all faces of this cell - for (const unsigned int face_no : GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) { Assert(face_integrals.find(cell->face(face_no)) != face_integrals.end(), diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index 2a7d2bab03..bbbdf0467a 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -982,7 +982,7 @@ namespace MatrixCreator copy_data.cell_matrix.clear(); copy_data.cell_vector.clear(); - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) // check if this face is on that part of the boundary we are // interested in if (boundary_functions.find(cell->face(face)->boundary_id()) != @@ -1199,7 +1199,7 @@ namespace MatrixCreator // inefficient, so we copy the dofs into a set, which enables binary // searches. unsigned int pos(0); - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : copy_data.cell->face_indices()) { // check if this face is on that part of // the boundary we are interested in @@ -1420,7 +1420,7 @@ namespace MatrixCreator copy_data.cell_vector.clear(); - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) // check if this face is on that part of // the boundary we are interested in if (boundary_functions.find(cell->face(face)->boundary_id()) != @@ -1653,7 +1653,7 @@ namespace MatrixCreator // inefficient, so we copy the dofs into a set, which enables binary // searches. unsigned int pos(0); - for (const unsigned int face : GeometryInfo::face_indices()) + for (const unsigned int face : copy_data.cell->face_indices()) { // check if this face is on that part of // the boundary we are interested in diff --git a/include/deal.II/numerics/vector_tools_boundary.templates.h b/include/deal.II/numerics/vector_tools_boundary.templates.h index 4566f8ebb6..df11dd947a 100644 --- a/include/deal.II/numerics/vector_tools_boundary.templates.h +++ b/include/deal.II/numerics/vector_tools_boundary.templates.h @@ -96,8 +96,7 @@ namespace VectorTools if (dim == 1) { for (const auto &cell : dof.active_cell_iterators()) - for (const unsigned int direction : - GeometryInfo::face_indices()) + for (const unsigned int direction : cell->face_indices()) if (cell->at_boundary(direction) && (function_map.find(cell->face(direction)->boundary_id()) != function_map.end())) @@ -220,8 +219,7 @@ namespace VectorTools for (auto const &cell : dof.active_cell_iterators()) if (!cell->is_artificial()) - for (const unsigned int face_no : - GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) { const FiniteElement &fe = cell->get_fe(); @@ -704,7 +702,7 @@ namespace VectorTools // Assert that there are no hanging nodes at the boundary int level = -1; for (const auto &cell : dof.active_cell_iterators()) - for (auto f : GeometryInfo::face_indices()) + for (auto f : cell->face_indices()) { if (cell->at_boundary(f)) { @@ -930,11 +928,10 @@ namespace VectorTools const unsigned int dim = 3; const unsigned int spacedim = 3; - hp_fe_values.reinit( - cell, - (cell->active_fe_index() * GeometryInfo::faces_per_cell + face) * - GeometryInfo::lines_per_face + - line); + hp_fe_values.reinit(cell, + (cell->active_fe_index() * cell->n_faces() + face) * + GeometryInfo::lines_per_face + + line); // Initialize the required // objects. @@ -1104,9 +1101,7 @@ namespace VectorTools { const unsigned int spacedim = dim; hp_fe_values.reinit(cell, - cell->active_fe_index() * - GeometryInfo::faces_per_cell + - face); + cell->active_fe_index() * cell->n_faces() + face); // Initialize the required // objects. const FEValues &fe_values = hp_fe_values.get_present_fe_values(); @@ -1610,8 +1605,7 @@ namespace VectorTools { for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // if the FE is a @@ -1705,8 +1699,7 @@ namespace VectorTools for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // if the FE is a @@ -1841,8 +1834,7 @@ namespace VectorTools { for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // if the FE is a FE_Nothing object there is no work to do @@ -1933,8 +1925,7 @@ namespace VectorTools for (; cell != dof_handler.end(); ++cell) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // if the FE is a FE_Nothing object there is no work to do @@ -2043,11 +2034,10 @@ namespace VectorTools const FiniteElement &fe = cell->get_fe(); // reinit for this cell, face and line. - hp_fe_values.reinit( - cell, - (cell->active_fe_index() * GeometryInfo::faces_per_cell + face) * - GeometryInfo::lines_per_face + - line); + hp_fe_values.reinit(cell, + (cell->active_fe_index() * cell->n_faces() + face) * + GeometryInfo::lines_per_face + + line); // Initialize the required objects. const FEValues &fe_values = hp_fe_values.get_present_fe_values(); @@ -2899,8 +2889,7 @@ namespace VectorTools { if (cell->at_boundary() && cell->is_locally_owned()) { - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) { if (cell->face(face)->boundary_id() == boundary_component) @@ -3023,8 +3012,7 @@ namespace VectorTools { if (cell->at_boundary() && cell->is_locally_owned()) { - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) { if (cell->face(face)->boundary_id() == boundary_component) @@ -3444,8 +3432,7 @@ namespace VectorTools { for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // if the FE is a @@ -3473,9 +3460,8 @@ namespace VectorTools } fe_values.reinit(cell, - face + - cell->active_fe_index() * - GeometryInfo::faces_per_cell); + face + cell->active_fe_index() * + cell->n_faces()); const std::vector> &jacobians = @@ -3513,8 +3499,7 @@ namespace VectorTools for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // This is only implemented, if the FE is a @@ -3531,9 +3516,8 @@ namespace VectorTools } fe_values.reinit(cell, - face + - cell->active_fe_index() * - GeometryInfo::faces_per_cell); + face + cell->active_fe_index() * + cell->n_faces()); const std::vector> &jacobians = @@ -3615,8 +3599,7 @@ namespace VectorTools { for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // This is only @@ -3636,9 +3619,8 @@ namespace VectorTools } fe_values.reinit(cell, - face + - cell->active_fe_index() * - GeometryInfo::faces_per_cell); + face + cell->active_fe_index() * + cell->n_faces()); const std::vector> &jacobians = @@ -3669,8 +3651,7 @@ namespace VectorTools for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->at_boundary() && cell->is_locally_owned()) - for (const unsigned int face : - GeometryInfo::face_indices()) + for (const unsigned int face : cell->face_indices()) if (cell->face(face)->boundary_id() == boundary_component) { // This is only @@ -3690,9 +3671,8 @@ namespace VectorTools } fe_values.reinit(cell, - face + - cell->active_fe_index() * - GeometryInfo::faces_per_cell); + face + cell->active_fe_index() * + cell->n_faces()); const std::vector> &jacobians = diff --git a/include/deal.II/numerics/vector_tools_constraints.templates.h b/include/deal.II/numerics/vector_tools_constraints.templates.h index 58d9526b8d..11e202ecab 100644 --- a/include/deal.II/numerics/vector_tools_constraints.templates.h +++ b/include/deal.II/numerics/vector_tools_constraints.templates.h @@ -540,7 +540,7 @@ namespace VectorTools std::set::iterator b_id; for (; cell != endc; ++cell) if (!cell->is_artificial()) - for (const unsigned int face_no : GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) if ((b_id = boundary_ids.find(cell->face(face_no)->boundary_id())) != boundary_ids.end()) { @@ -1114,7 +1114,7 @@ namespace VectorTools std::vector> cell_vector_dofs; for (const auto &cell : dof_handler.active_cell_iterators()) if (!cell->is_artificial()) - for (const unsigned int face_no : GeometryInfo::face_indices()) + for (const unsigned int face_no : cell->face_indices()) if ((b_id = boundary_ids.find(cell->face(face_no)->boundary_id())) != boundary_ids.end()) { diff --git a/include/deal.II/numerics/vector_tools_rhs.templates.h b/include/deal.II/numerics/vector_tools_rhs.templates.h index 14778511b9..96fe8feb5d 100644 --- a/include/deal.II/numerics/vector_tools_rhs.templates.h +++ b/include/deal.II/numerics/vector_tools_rhs.templates.h @@ -73,7 +73,7 @@ namespace VectorTools std::vector rhs_values(n_q_points); for (; cell != endc; ++cell) - for (unsigned int face : GeometryInfo::face_indices()) + for (unsigned int face : cell->face_indices()) if (cell->face(face)->at_boundary() && (boundary_ids.empty() || (boundary_ids.find(cell->face(face)->boundary_id()) != @@ -104,7 +104,7 @@ namespace VectorTools Vector(n_components)); for (; cell != endc; ++cell) - for (unsigned int face : GeometryInfo::face_indices()) + for (unsigned int face : cell->face_indices()) if (cell->face(face)->at_boundary() && (boundary_ids.empty() || (boundary_ids.find(cell->face(face)->boundary_id()) != @@ -218,7 +218,7 @@ namespace VectorTools std::vector rhs_values; for (; cell != endc; ++cell) - for (unsigned int face : GeometryInfo::face_indices()) + for (unsigned int face : cell->face_indices()) if (cell->face(face)->at_boundary() && (boundary_ids.empty() || (boundary_ids.find(cell->face(face)->boundary_id()) != @@ -256,7 +256,7 @@ namespace VectorTools std::vector> rhs_values; for (; cell != endc; ++cell) - for (unsigned int face : GeometryInfo::face_indices()) + for (unsigned int face : cell->face_indices()) if (cell->face(face)->at_boundary() && (boundary_ids.empty() || (boundary_ids.find(cell->face(face)->boundary_id()) != -- 2.39.5