From 04af890ca4a57ebedabd429790d06d3556293dfe Mon Sep 17 00:00:00 2001 From: Simon Sticko Date: Fri, 22 Apr 2022 13:41:56 +0200 Subject: [PATCH] Change cell type passed to DiscreteQuadratureGenerator::generate() The cell passed to the generate()-functions does not need to have dofs associated with it. The cell will be cast to an iterator of the correct type internally. Change the parameter type of the generate function to Triangulation::active_cell_iterator. --- .../deal.II/non_matching/quadrature_generator.h | 10 +++------- source/non_matching/quadrature_generator.cc | 8 +++----- source/non_matching/quadrature_generator.inst.in | 15 --------------- .../non_matching/discrete_quadrature_generator.cc | 4 ++-- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/include/deal.II/non_matching/quadrature_generator.h b/include/deal.II/non_matching/quadrature_generator.h index 38dfae22e0..833df1d6cd 100644 --- a/include/deal.II/non_matching/quadrature_generator.h +++ b/include/deal.II/non_matching/quadrature_generator.h @@ -511,10 +511,8 @@ namespace NonMatching * Construct immersed quadratures rules based on the discrete level * set vector over the incoming cell. */ - template void - generate( - const TriaIterator> &cell); + generate(const typename Triangulation::active_cell_iterator &cell); private: /** @@ -566,11 +564,9 @@ namespace NonMatching * Construct immersed quadratures rules based on the discrete level * set vector over the incoming face described by cell and face index. */ - template void - generate( - const TriaIterator> &cell, - const unsigned int face_index); + generate(const typename Triangulation::active_cell_iterator &cell, + const unsigned int face_index); private: /** diff --git a/source/non_matching/quadrature_generator.cc b/source/non_matching/quadrature_generator.cc index 1f5ba03a16..66aa18850e 100644 --- a/source/non_matching/quadrature_generator.cc +++ b/source/non_matching/quadrature_generator.cc @@ -1887,10 +1887,9 @@ namespace NonMatching template - template void DiscreteQuadratureGenerator::generate( - const TriaIterator> &cell) + const typename Triangulation::active_cell_iterator &cell) { reference_space_level_set->set_active_cell(cell); const BoundingBox unit_box = create_unit_bounding_box(); @@ -1917,11 +1916,10 @@ namespace NonMatching template - template void DiscreteFaceQuadratureGenerator::generate( - const TriaIterator> &cell, - const unsigned int face_index) + const typename Triangulation::active_cell_iterator &cell, + const unsigned int face_index) { reference_space_level_set->set_active_cell(cell); const BoundingBox unit_box = create_unit_bounding_box(); diff --git a/source/non_matching/quadrature_generator.inst.in b/source/non_matching/quadrature_generator.inst.in index d956a98bd1..1522b14d85 100644 --- a/source/non_matching/quadrature_generator.inst.in +++ b/source/non_matching/quadrature_generator.inst.in @@ -93,18 +93,3 @@ for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS) const VEC &, const AdditionalData &); } - -// Template generate function -for (deal_II_dimension : DIMENSIONS; lda : BOOL) - { - template void - NonMatching::DiscreteQuadratureGenerator::generate( - const TriaIterator< - DoFCellAccessor> &); - - template void - NonMatching::DiscreteFaceQuadratureGenerator::generate( - const TriaIterator< - DoFCellAccessor> &, - const unsigned int); - } diff --git a/tests/non_matching/discrete_quadrature_generator.cc b/tests/non_matching/discrete_quadrature_generator.cc index 8501821fd5..6afaf4ba09 100644 --- a/tests/non_matching/discrete_quadrature_generator.cc +++ b/tests/non_matching/discrete_quadrature_generator.cc @@ -138,7 +138,7 @@ Test::test_discrete_quadrature_generator() { NonMatching::DiscreteQuadratureGenerator quadrature_generator( q_collection1D, dof_handler, level_set); - quadrature_generator.generate(dof_handler.begin_active()); + quadrature_generator.generate(triangulation.begin_active()); print_quadrature(quadrature_generator.get_inside_quadrature()); print_quadrature(quadrature_generator.get_outside_quadrature()); @@ -154,7 +154,7 @@ Test::test_discrete_face_quadrature_generator() NonMatching::DiscreteFaceQuadratureGenerator face_quadrature_generator( q_collection1D, dof_handler, level_set); - const auto &cell = dof_handler.begin_active(); + const auto &cell = triangulation.begin_active(); for (const auto f : cell->face_indices()) { face_quadrature_generator.generate(cell, f); -- 2.39.5