]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify a few places using cell->as_dof_handler_iterator(..). 15727/head
authorSimon Sticko <simon@sticko.se>
Wed, 12 Jul 2023 07:08:50 +0000 (09:08 +0200)
committerSimon Sticko <simon@sticko.se>
Thu, 13 Jul 2023 08:38:47 +0000 (10:38 +0200)
source/non_matching/mesh_classifier.cc
source/non_matching/quadrature_generator.cc
tests/base/cell_data_storage_01.cc
tests/base/cell_data_storage_02.cc
tests/base/quadrature_point_data.cc
tests/base/quadrature_point_data_02.cc
tests/base/quadrature_point_data_03.cc
tests/bits/step-51.cc
tests/bits/step-51p.cc

index 78b1dfb2ffca78370760f85dfdce30a98910d43f..743342bad1ccbfec877bd289580d066b3301a025 100644 (file)
@@ -157,11 +157,7 @@ namespace NonMatching
         const unsigned int                                       face_index,
         Vector<double> &local_levelset_values)
       {
-        typename DoFHandler<dim>::active_cell_iterator cell_with_dofs(
-          &dof_handler->get_triangulation(),
-          cell->level(),
-          cell->index(),
-          dof_handler);
+        const auto cell_with_dofs = cell->as_dof_handler_iterator(*dof_handler);
 
         const unsigned int n_dofs_per_face =
           dof_handler->get_fe().n_dofs_per_face();
@@ -183,11 +179,7 @@ namespace NonMatching
       DiscreteLevelSetDescription<dim, VectorType>::active_fe_index(
         const typename Triangulation<dim>::active_cell_iterator &cell) const
       {
-        typename DoFHandler<dim>::active_cell_iterator cell_with_dofs(
-          &dof_handler->get_triangulation(),
-          cell->level(),
-          cell->index(),
-          dof_handler);
+        const auto cell_with_dofs = cell->as_dof_handler_iterator(*dof_handler);
 
         return cell_with_dofs->active_fe_index();
       }
index bfc731b6b3119db1ac6ee5d94c5fedb2e1ee475a..df5e9bb56cc8212fd46180e3cfeb63615bad5005 100644 (file)
@@ -1440,11 +1440,8 @@ namespace NonMatching
             "The incoming cell must belong to the triangulation associated with "
             "the DoFHandler passed to the constructor."));
 
-        const typename DoFHandler<dim>::active_cell_iterator dof_handler_cell(
-          &dof_handler->get_triangulation(),
-          cell->level(),
-          cell->index(),
-          dof_handler);
+        const auto dof_handler_cell =
+          cell->as_dof_handler_iterator(*dof_handler);
 
         // Save the element and the local dof values, since this is what we need
         // to evaluate the function.
index 015cef56d15cc2367718985669cda8582f1c36ca..de070aaf2ca8dd3d10a4473d8079409646e99fb4 100644 (file)
@@ -93,8 +93,8 @@ check_qph(Triangulation<dim> &tr,
   for (cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->is_locally_owned())
       {
-        typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                &dof_handler);
+        const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
+
         fe_values.reinit(dof_cell);
         const std::vector<Point<dim>> &q_points =
           fe_values.get_quadrature_points();
@@ -159,8 +159,7 @@ test()
     for (cell = tr.begin_active(); cell != tr.end(); ++cell)
       if (cell->is_locally_owned())
         {
-          typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                  &dof_handler);
+          const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
           fe_values.reinit(dof_cell);
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
index f38853c2a62580ba9271bc6ea416caf5862fc5ca..9c077943d0c35afe4342c4c15320f5d862064ff6 100644 (file)
@@ -97,8 +97,7 @@ test()
     for (cell = tr.begin_active(); cell != tr.end(); ++cell)
       if (cell->is_locally_owned())
         {
-          typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                  &dof_handler);
+          const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
           fe_values.reinit(dof_cell);
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
index f806ecfe328d7612de667fd88c90ee7391c89a28..c7b130753b40cac2f70b7a5199a98a8dc69634e9 100644 (file)
@@ -116,8 +116,8 @@ check_qph(parallel::distributed::Triangulation<dim> &tr,
   for (cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->is_locally_owned())
       {
-        typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                &dof_handler);
+        const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
+
         fe_values.reinit(dof_cell);
         const std::vector<Point<dim>> &q_points =
           fe_values.get_quadrature_points();
@@ -163,8 +163,7 @@ test()
     for (cell = tr.begin_active(); cell != tr.end(); ++cell)
       if (cell->is_locally_owned())
         {
-          typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                  &dof_handler);
+          const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
           fe_values.reinit(dof_cell);
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
index ca2100610cde1a7f623d66ebbeab9a3d6954e5d6..e9fa1815082f380869dba197978f8f74d9a3e048 100644 (file)
@@ -120,8 +120,8 @@ check_qph(parallel::distributed::Triangulation<dim> &tr,
   for (cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->is_locally_owned())
       {
-        typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                &dof_handler);
+        const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
+
         fe_values.reinit(dof_cell);
         const std::vector<Point<dim>> &q_points =
           fe_values.get_quadrature_points();
@@ -172,8 +172,7 @@ test()
     for (cell = tr.begin_active(); cell != tr.end(); ++cell)
       if (cell->is_locally_owned())
         {
-          typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                  &dof_handler);
+          const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
           fe_values.reinit(dof_cell);
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
index ab7da7856b7edf0cd41f0792c27452ee572fcc5b..0ccb9c2ab9fe487c61149de06fa1c33b29729e4f 100644 (file)
@@ -127,8 +127,8 @@ check_qph(parallel::distributed::Triangulation<dim> &tr,
   for (cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->is_locally_owned())
       {
-        typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                &dof_handler);
+        const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
+
         fe_values.reinit(dof_cell);
         const std::vector<Point<dim>> &q_points =
           fe_values.get_quadrature_points();
@@ -178,8 +178,7 @@ test()
     for (cell = tr.begin_active(); cell != tr.end(); ++cell)
       if (cell->is_locally_owned())
         {
-          typename DoFHandler<dim>::active_cell_iterator dof_cell(*cell,
-                                                                  &dof_handler);
+          const auto dof_cell = cell->as_dof_handler_iterator(dof_handler);
           fe_values.reinit(dof_cell);
           const std::vector<Point<dim>> &q_points =
             fe_values.get_quadrature_points();
index 894dac5053691f42de857d4a3d9943eeab012462..93c481358ca867578a7085d063d664b181396752 100644 (file)
@@ -574,10 +574,7 @@ namespace Step51
     ScratchData &                                         scratch,
     PerTaskData &                                         task_data)
   {
-    typename DoFHandler<dim>::active_cell_iterator loc_cell(&triangulation,
-                                                            cell->level(),
-                                                            cell->index(),
-                                                            &dof_handler_local);
+    const auto loc_cell = cell->as_dof_handler_iterator(dof_handler_local);
 
     const unsigned int n_q_points =
       scratch.fe_values_local.get_quadrature().size();
@@ -890,10 +887,7 @@ namespace Step51
     PostProcessScratchData &                              scratch,
     unsigned int &)
   {
-    typename DoFHandler<dim>::active_cell_iterator loc_cell(&triangulation,
-                                                            cell->level(),
-                                                            cell->index(),
-                                                            &dof_handler_local);
+    const auto loc_cell = cell->as_dof_handler_iterator(dof_handler_local);
 
     scratch.fe_values_local.reinit(loc_cell);
     scratch.fe_values.reinit(cell);
index e765ed70606497798623767518fd8ba5635a6243..3e0849978311970b31f48a4f08746fe82d60b86f 100644 (file)
@@ -574,10 +574,7 @@ namespace Step51
     ScratchData &                                         scratch,
     PerTaskData &                                         task_data)
   {
-    typename DoFHandler<dim>::active_cell_iterator loc_cell(&triangulation,
-                                                            cell->level(),
-                                                            cell->index(),
-                                                            &dof_handler_local);
+    const auto loc_cell = cell->as_dof_handler_iterator(dof_handler_local);
 
     const unsigned int n_q_points =
       scratch.fe_values_local.get_quadrature().size();
@@ -888,10 +885,7 @@ namespace Step51
     PostProcessScratchData &                              scratch,
     unsigned int &)
   {
-    typename DoFHandler<dim>::active_cell_iterator loc_cell(&triangulation,
-                                                            cell->level(),
-                                                            cell->index(),
-                                                            &dof_handler_local);
+    const auto loc_cell = cell->as_dof_handler_iterator(dof_handler_local);
 
     scratch.fe_values_local.reinit(loc_cell);
     scratch.fe_values.reinit(cell);

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.