]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change cell type passed to DiscreteQuadratureGenerator::generate()
authorSimon Sticko <simon@sticko.se>
Fri, 22 Apr 2022 11:41:56 +0000 (13:41 +0200)
committerSimon Sticko <simon@sticko.se>
Fri, 22 Apr 2022 11:56:59 +0000 (13:56 +0200)
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.

include/deal.II/non_matching/quadrature_generator.h
source/non_matching/quadrature_generator.cc
source/non_matching/quadrature_generator.inst.in
tests/non_matching/discrete_quadrature_generator.cc

index 38dfae22e0529df82ae7a070a16a1a74cd5b00ea..833df1d6cdaded7e57fa1ef665bc7c5696b9be92 100644 (file)
@@ -511,10 +511,8 @@ namespace NonMatching
      * Construct immersed quadratures rules based on the discrete level
      * set vector over the incoming cell.
      */
-    template <bool level_dof_access>
     void
-    generate(
-      const TriaIterator<DoFCellAccessor<dim, dim, level_dof_access>> &cell);
+    generate(const typename Triangulation<dim>::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 <bool level_dof_access>
     void
-    generate(
-      const TriaIterator<DoFCellAccessor<dim, dim, level_dof_access>> &cell,
-      const unsigned int face_index);
+    generate(const typename Triangulation<dim>::active_cell_iterator &cell,
+             const unsigned int face_index);
 
   private:
     /**
index 1f5ba03a164f647ec675f1aae2c9e87495cfc774..66aa18850ea9e00258cfcd76e32cef51360e9301 100644 (file)
@@ -1887,10 +1887,9 @@ namespace NonMatching
 
 
   template <int dim>
-  template <bool level_dof_access>
   void
   DiscreteQuadratureGenerator<dim>::generate(
-    const TriaIterator<DoFCellAccessor<dim, dim, level_dof_access>> &cell)
+    const typename Triangulation<dim>::active_cell_iterator &cell)
   {
     reference_space_level_set->set_active_cell(cell);
     const BoundingBox<dim> unit_box = create_unit_bounding_box<dim>();
@@ -1917,11 +1916,10 @@ namespace NonMatching
 
 
   template <int dim>
-  template <bool level_dof_access>
   void
   DiscreteFaceQuadratureGenerator<dim>::generate(
-    const TriaIterator<DoFCellAccessor<dim, dim, level_dof_access>> &cell,
-    const unsigned int                                               face_index)
+    const typename Triangulation<dim>::active_cell_iterator &cell,
+    const unsigned int                                       face_index)
   {
     reference_space_level_set->set_active_cell(cell);
     const BoundingBox<dim> unit_box = create_unit_bounding_box<dim>();
index d956a98bd16893dc2d2f01150ecd96ee03020720..1522b14d8593a2f9e19f5a7b18f6053d9a05abf7 100644 (file)
@@ -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<deal_II_dimension>::generate(
-      const TriaIterator<
-        DoFCellAccessor<deal_II_dimension, deal_II_dimension, lda>> &);
-
-    template void
-    NonMatching::DiscreteFaceQuadratureGenerator<deal_II_dimension>::generate(
-      const TriaIterator<
-        DoFCellAccessor<deal_II_dimension, deal_II_dimension, lda>> &,
-      const unsigned int);
-  }
index 8501821fd5cdd70c4a6a96f3cbee849a5ce30c7c..6afaf4ba09047921ee9248a6096b7804c2e7f28c 100644 (file)
@@ -138,7 +138,7 @@ Test<dim>::test_discrete_quadrature_generator()
 {
   NonMatching::DiscreteQuadratureGenerator<dim> 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<dim>::test_discrete_face_quadrature_generator()
   NonMatching::DiscreteFaceQuadratureGenerator<dim> 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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.