]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also use std::next for ++object.begin_active().
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 27 Aug 2021 17:30:16 +0000 (11:30 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 2 Sep 2021 20:37:10 +0000 (14:37 -0600)
36 files changed:
tests/distributed_grids/tria_settings_01.cc
tests/dofs/sparsity_pattern_02.cc
tests/dofs/sparsity_pattern_03.cc
tests/dofs/sparsity_pattern_04.cc
tests/fe/nedelec_crash_hp.cc
tests/fe/nedelec_face_interpolation.cc
tests/grid/grid_generator_07.cc
tests/grid/mesh_3d_12.cc
tests/grid/mesh_3d_13.cc
tests/grid/mesh_3d_14.cc
tests/grid/mesh_3d_15.cc
tests/grid/mesh_3d_17.cc
tests/grid/mesh_3d_2.cc
tests/grid/mesh_3d_21.cc
tests/grid/mesh_3d_3.cc
tests/grid/n_faces_01.cc
tests/grid/union_triangulation.cc
tests/hp/crash_07.cc
tests/hp/crash_12.cc
tests/hp/error_prediction_02.cc
tests/hp/face_domination_01.cc
tests/hp/face_domination_02.cc
tests/hp/face_domination_04.cc
tests/hp/fe_nothing_dominates.h
tests/hp/hp_constraints_common.h
tests/hp/hp_constraints_common_no_support.h
tests/hp/hp_fe_values_copy.cc
tests/integrators/laplacian_02.cc
tests/lac/constraints.cc
tests/manifold/transfinite_manifold_11.cc
tests/mpi/codim_01.cc
tests/mpi/hp_unify_dof_indices_01.cc
tests/mpi/hp_unify_dof_indices_07.cc
tests/numerics/project_common.h
tests/numerics/project_parallel_common.h
tests/serialization/hp_dof_handler_01.cc

index 7056a4ff5566a2759a567499451e0615b51bf044..7e5f06aa2ed08d18b6173458e7da5db57122156b 100644 (file)
@@ -43,7 +43,7 @@ testit(parallel::distributed::Triangulation<dim> &tr)
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
 
-  (++tr.begin_active())->set_refine_flag();
+  (std::next(tr.begin_active()))->set_refine_flag();
   tr.execute_coarsening_and_refinement();
 
   tr.begin_active()->set_refine_flag();
index 87d10d34fe737b0af6700963f94a36838f533ea9..449c2e84149e71fb330245eee0fe0e3bf0586d86 100644 (file)
@@ -65,7 +65,7 @@ check()
   else
     GridGenerator::hyper_cube(triangulation_2, -1, 1);
   triangulation_2.refine_global(1);
-  (++triangulation_2.begin_active())->set_refine_flag();
+  (std::next(triangulation_2.begin_active()))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
   (++triangulation_2.begin_active(2))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
index d8e74dbe9be7f86326f7558018cdffd9b4169c9f..7221450af8ea9a33590e6c5eece797d771f1a4cd 100644 (file)
@@ -68,7 +68,7 @@ check()
   else
     GridGenerator::hyper_cube(triangulation_2, -1, 1);
   triangulation_2.refine_global(1);
-  (++triangulation_2.begin_active())->set_refine_flag();
+  (std::next(triangulation_2.begin_active()))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
   (++triangulation_2.begin_active(2))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
index 4f3939bb7e5559ece07ac5356d0ce18d79afa022..508548eaead062ddcf5a194e3fd5b485e39ff8a6 100644 (file)
@@ -69,7 +69,7 @@ check()
   else
     GridGenerator::hyper_cube(triangulation_2, -1, 1);
   triangulation_2.refine_global(1);
-  (++triangulation_2.begin_active())->set_refine_flag();
+  (std::next(triangulation_2.begin_active()))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
   (++triangulation_2.begin_active(2))->set_refine_flag();
   triangulation_2.execute_coarsening_and_refinement();
index 593bf88be3b01c49ae783148e72bce2c64eb8382..2470c5f698c8e8c77fa5337f6c9f8a48dae003ca 100644 (file)
@@ -68,7 +68,7 @@ test()
                                             Point<dim>(),
                                             (dim == 3 ? Point<dim>(2, 1, 1) :
                                                         Point<dim>(2, 1)));
-  (++triangulation.begin_active())->set_refine_flag();
+  (std::next(triangulation.begin_active()))->set_refine_flag();
   triangulation.execute_coarsening_and_refinement();
 
   hp::FECollection<dim> fe;
index 04a1250e5f7fece59f2733f0211c4008132078a9..23c4c83fffe4ea853fd5b0bbaf34de55b556e8a7 100644 (file)
@@ -52,7 +52,7 @@ test(unsigned p1, unsigned p2)
                                             Point<dim>(),
                                             (dim == 3 ? Point<dim>(2, 1, 1) :
                                                         Point<dim>(2, 1)));
-  (++triangulation.begin_active())->set_refine_flag();
+  (std::next(triangulation.begin_active()))->set_refine_flag();
   triangulation.execute_coarsening_and_refinement();
 
   hp::FECollection<dim> fe;
index c0fec6fa3ff8b7e0f7b3cf81c608475d305a319b..b0fa62f4f59c6c35b63b14cc0c1f8ee26f790143 100644 (file)
@@ -42,7 +42,7 @@ test(std::ostream &out)
   // makes a bunch of vertices unused
   std::set<typename Triangulation<dim>::active_cell_iterator> cells_to_remove;
   for (typename Triangulation<dim>::active_cell_iterator cell =
-         ++triangulation.begin_active();
+         std::next(triangulation.begin_active());
        cell != triangulation.end();
        ++cell)
     cells_to_remove.insert(cell);
index dd0b4fbc0225292a7878772f4af7d3b348e652e7..fb49f71bb9d023ecff672765f8e9965c2373441d 100644 (file)
@@ -73,7 +73,7 @@ check_this(Triangulation<3> &tria)
 void
 check(Triangulation<3> &tria)
 {
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   deallog << "Initial check" << std::endl;
index eaa7be7dd95bbed291f2b9257d60d018b0790798..bd0abeedb432cc51784ad4f420600b3fffc28f78 100644 (file)
@@ -83,7 +83,7 @@ check_this(Triangulation<3> &tria)
 void
 check(Triangulation<3> &tria)
 {
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   deallog << "Initial check" << std::endl;
index ad96418864ee0b5b501754cba9d259f37d30128c..99e451176586a992f9aa79280d9c8a2344e44f9f 100644 (file)
@@ -103,7 +103,7 @@ check_this(Triangulation<3> &tria)
 void
 check(Triangulation<3> &tria)
 {
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   deallog << "Initial check" << std::endl;
index 83326838014bdaf70ef6fd554f46e7ac8a681556..058f9c2bb28da4d5f9effc8c7168253da6e38365 100644 (file)
@@ -96,7 +96,7 @@ check_this(Triangulation<3> &tria)
 void
 check(Triangulation<3> &tria)
 {
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   deallog << "Initial check" << std::endl;
index 551cc1dc74da6fb9da42dd008d896eff65621652..41ec5da22ac5d972bd20b2cba226b00fc715ab28 100644 (file)
@@ -44,7 +44,7 @@ check(Triangulation<3> &tria)
 
   deallog << "Coarse cell 1 vertices:" << std::endl;
   for (unsigned int i = 0; i < 8; ++i)
-    deallog << ' ' << (++tria.begin_active())->vertex_index(i);
+    deallog << ' ' << (std::next(tria.begin_active()))->vertex_index(i);
   deallog << std::endl;
 
 
index ce848bee07373ab797aeca9260d8c7d33a71813b..7926c8c9192ad2e9a34227eb8da2ef0d6b3ce0e6 100644 (file)
@@ -66,6 +66,6 @@ main()
   // we know that from the second
   // cell, the common face must have
   // wrong orientation. check this
-  Assert((++coarse_grid.begin_active())->face_orientation(5) == false,
+  Assert((std::next(coarse_grid.begin_active()))->face_orientation(5) == false,
          ExcInternalError());
 }
index 4469a2b8187a25e9d14d195c0ad383b67a9c9e59..e6fea6e1419f7afd6a32b97e1db01a24b7611665 100644 (file)
@@ -104,7 +104,7 @@ check_this(Triangulation<3> &tria)
 void
 check(Triangulation<3> &tria)
 {
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   deallog << "Initial check" << std::endl;
index b594dab630419d0cdceea616c76484ae9267ac6d..d19555f67fd6a23adebc267a2e661c2a3d9c7bd7 100644 (file)
@@ -42,7 +42,7 @@ main()
   create_two_cubes(coarse_grid);
 
   const Triangulation<3>::active_cell_iterator cells[2] = {
-    coarse_grid.begin_active(), ++coarse_grid.begin_active()};
+    coarse_grid.begin_active(), std::next(coarse_grid.begin_active())};
 
   // output all vertices
   for (unsigned int c = 0; c < 2; ++c)
index 6a52e66659aa5d6899ca5ff909230cccca25916f..cd026369a02d85428784fa8dbe13f538e2542eb7 100644 (file)
@@ -34,7 +34,7 @@ test()
   GridGenerator::hyper_cube(tria);
   tria.refine_global(2);
   tria.begin_active()->set_coarsen_flag();
-  (++(tria.begin_active()))->set_coarsen_flag();
+  (std::next((tria.begin_active())))->set_coarsen_flag();
   tria.execute_coarsening_and_refinement();
 
   std::map<typename Triangulation<dim, spacedim>::face_iterator, unsigned int>
index 1b994ff71089c8b00be6e30d5da2d63cff7baf9d..7679101b634086376b638477a544f972d3d52cfc 100644 (file)
@@ -47,7 +47,7 @@ test()
   // similar for second grid, but
   // different cell
   tria_2.refine_global(1);
-  (++tria_2.begin_active())->set_refine_flag();
+  (std::next(tria_2.begin_active()))->set_refine_flag();
   tria_2.execute_coarsening_and_refinement();
 
   GridGenerator::create_union_triangulation(tria_1, tria_2, tria_3);
index b2d5df05860dfe27d510b37ccdcf92fc95f7317b..7c62caa374d3ff9ee2fa3be1ee0dc0cd3ee14dce 100644 (file)
@@ -104,7 +104,7 @@ main()
        cell != dof_handler.end();
        ++cell, ++cell_no)
     cell->set_active_fe_index(0);
-  (++dof_handler.begin_active())->set_active_fe_index(1);
+  (std::next(dof_handler.begin_active()))->set_active_fe_index(1);
   dof_handler.distribute_dofs(fe);
 
   deallog << "n_dofs=" << dof_handler.n_dofs() << std::endl;
index 2f9d3f0fba2820192e21e28a2d6adc16a155a82d..af3cf901973c79679863befb0fb6d4e8260f9606 100644 (file)
@@ -73,7 +73,7 @@ test()
                                             Point<dim>(),
                                             (dim == 3 ? Point<dim>(2, 1, 1) :
                                                         Point<dim>(2, 1)));
-  (++triangulation.begin_active())->set_refine_flag();
+  (std::next(triangulation.begin_active()))->set_refine_flag();
   triangulation.execute_coarsening_and_refinement();
 
   hp::FECollection<dim> fe;
index eb180b07ce0f573036380e693043a5d94324d695..002b2475d9b80e62b65f7039a4e16006131704a7 100644 (file)
@@ -46,7 +46,7 @@ test()
   TestGrids::hyper_line(tria, 4);
 
   tria.begin_active()->set_refine_flag();
-  (++tria.begin_active())->set_refine_flag();
+  (std::next(tria.begin_active()))->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   hp::FECollection<dim> fes;
index d253650635acf5279921619d338dd9a38139dbc7..db9452c9e427776b8a5ea6f184d20381837e73a4 100644 (file)
@@ -80,7 +80,7 @@ main()
   dof_handler.distribute_dofs(fe_collection);
 
   print_dofs(dof_handler.begin_active());
-  print_dofs(++dof_handler.begin_active());
+  print_dofs(std::next(dof_handler.begin_active()));
 
   AffineConstraints<double> constraints;
   constraints.clear();
index 0922a1320240c024f32c6710a9092b36f853605f..799f52409b92aa98e06625a953c2c0af40ce8c2d 100644 (file)
@@ -82,7 +82,7 @@ main()
   dof_handler.distribute_dofs(fe_collection);
 
   print_dofs(dof_handler.begin_active());
-  print_dofs(++dof_handler.begin_active());
+  print_dofs(std::next(dof_handler.begin_active()));
 
   AffineConstraints<double> constraints;
   constraints.clear();
index e6443f0eb06649130000c110ad84139b8f2168ec..ad5d33e8d1e9aae9e39d5b5cb810fc74e2909e34 100644 (file)
@@ -89,7 +89,7 @@ main()
 
       deallog << "RTNodal of degree " << i << std::endl;
       print_dofs(dof_handler.begin_active());
-      print_dofs(++dof_handler.begin_active());
+      print_dofs(std::next(dof_handler.begin_active()));
 
       AffineConstraints<double> constraints;
       constraints.clear();
index 1836c0bac3d436b5c959773623c64e9b2f7de6bb..96f30ee00a07beeec6fadcb18f768dd2e5e97462 100644 (file)
@@ -60,7 +60,7 @@ project(const hp::FECollection<dim> &fe_collection,
   TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
-  (++(dofh.begin_active()))->set_active_fe_index(1);
+  (std::next((dofh.begin_active())))->set_active_fe_index(1);
   dofh.distribute_dofs(fe_collection);
 
   // make constraints
index 336d360c57313737bfdc50c5427a3e7f28444409..be8da58b1156026a4cac628bee74db286f41646b 100644 (file)
@@ -304,10 +304,10 @@ test_with_2d_deformed_refined_mesh(const hp::FECollection<dim> &fe)
             triangulation.begin_active()->set_refine_flag();
             break;
           case 1:
-            (++(triangulation.begin_active()))->set_refine_flag();
+            (std::next((triangulation.begin_active())))->set_refine_flag();
             break;
           case 2:
-            (++(++(triangulation.begin_active())))->set_refine_flag();
+            (std::next((++(triangulation.begin_active()))))->set_refine_flag();
             break;
           default:
             Assert(false, ExcNotImplemented());
@@ -349,7 +349,7 @@ test_interpolation_base(const hp::FECollection<dim> &    fe,
 
   if (do_refine)
     {
-      (++triangulation.begin_active())->set_refine_flag();
+      (std::next(triangulation.begin_active()))->set_refine_flag();
       triangulation.execute_coarsening_and_refinement();
     }
 
index d92cc8c9983851ab40fab9255c8fd959b49c1569..7766de0c754a36dc950a55cff231ff6b344745df 100644 (file)
@@ -305,10 +305,10 @@ test_with_2d_deformed_refined_mesh(const hp::FECollection<dim> &fe)
             triangulation.begin_active()->set_refine_flag();
             break;
           case 1:
-            (++(triangulation.begin_active()))->set_refine_flag();
+            (std::next((triangulation.begin_active())))->set_refine_flag();
             break;
           case 2:
-            (++(++(triangulation.begin_active())))->set_refine_flag();
+            (std::next((++(triangulation.begin_active()))))->set_refine_flag();
             break;
           default:
             Assert(false, ExcNotImplemented());
@@ -350,7 +350,7 @@ test_interpolation_base(const hp::FECollection<dim> &    fe,
 
   if (do_refine)
     {
-      (++triangulation.begin_active())->set_refine_flag();
+      (std::next(triangulation.begin_active()))->set_refine_flag();
       triangulation.execute_coarsening_and_refinement();
     }
 
index 764fb9b3983d9636b571b9d0e10bdf5a84a1c902..c45712e972cbfbaf591b84e7aa08fe2dc3369f48 100644 (file)
@@ -73,7 +73,7 @@ test()
   hp_fe_values1.reinit(cell1);
 
   // Now make a copy of the object and initialize it for the second cell
-  const auto        cell2 = ++dof_handler.begin_active();
+  const auto        cell2 = std::next(dof_handler.begin_active());
   hp::FEValues<dim> hp_fe_values2(hp_fe_values1);
   hp_fe_values2.reinit(cell2);
 
index 08d90f80b427230d4494ecf0f31ee70e7939b2e4..da05905504a3b8887373df82bc35a8bfcc1fb05f 100644 (file)
@@ -104,7 +104,8 @@ test_face(const FiniteElement<dim> &fe, bool diff = false)
   std::vector<types::global_dof_index> indices2(fe.dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator cell1 = dof.begin_active();
-  typename DoFHandler<dim>::active_cell_iterator cell2 = ++dof.begin_active();
+  typename DoFHandler<dim>::active_cell_iterator cell2 =
+    std::next(dof.begin_active());
 
   cell1->get_dof_indices(indices1);
   cell2->get_dof_indices(indices2);
index 96b801d6d2e9ed4c44b15c80c2734535983b9251..3baf5100e7bb84420b4a9ba0335e06738a510c45 100644 (file)
@@ -231,11 +231,11 @@ make_tria(Triangulation<3> &tria, int step)
 
               case 7:
                 tria.begin_active()->set_refine_flag();
-                (++tria.begin_active())->set_refine_flag();
+                (std::next(tria.begin_active()))->set_refine_flag();
                 break;
               case 8:
                 tria.begin_active()->set_refine_flag();
-                (++(++(++tria.begin_active())))->set_refine_flag();
+                (std::next((++(++tria.begin_active()))))->set_refine_flag();
                 break;
             };
 
index eb217d85e691d74d8e162be4a61e7db79590d59e..70d4d6938e15ea2f6cf7df3e9cacbff09172232b 100644 (file)
@@ -101,7 +101,7 @@ main()
 
   {
     triangulation.set_all_manifold_ids(3);
-    const auto center_cell  = ++triangulation.begin_active();
+    const auto center_cell  = std::next(triangulation.begin_active());
     const auto lower_radial = center_cell->face(2);
     const auto upper_radial = center_cell->face(3);
     lower_radial->set_manifold_id(1);
index 4b9752b24f0d35dde762402f334915dd03c7a39a..65b8e95962743bbeb611a99246146e470c7aceae 100644 (file)
@@ -69,7 +69,7 @@ test(std::ostream & /*out*/)
   tr.refine_global();
 
   tr.begin_active()->set_refine_flag();
-  (++(tr.begin_active()))->set_refine_flag();
+  (std::next((tr.begin_active())))->set_refine_flag();
 
   tr.execute_coarsening_and_refinement();
 
index 60a0c6ab808d7fadff69dee7207268ea100dac2d..8f47d8e2985a6ed2ede7e2f9a195cdae61e16514 100644 (file)
@@ -61,8 +61,8 @@ test()
   DoFHandler<dim> dof_handler(triangulation);
   if (dof_handler.begin_active()->is_locally_owned())
     dof_handler.begin_active()->set_active_fe_index(0);
-  if ((++dof_handler.begin_active())->is_locally_owned())
-    (++dof_handler.begin_active())->set_active_fe_index(1);
+  if ((std::next(dof_handler.begin_active()))->is_locally_owned())
+    (std::next(dof_handler.begin_active()))->set_active_fe_index(1);
   dof_handler.distribute_dofs(fe);
 
   log_dof_diagnostics(dof_handler);
index febfc6c9fff1fcc7a86d609585df7923996a5d27..b0190ef4e70c8fa4e7fee849b127d63f0f30913b 100644 (file)
@@ -67,8 +67,8 @@ test()
   DoFHandler<dim> dof_handler(triangulation);
   if (dof_handler.begin_active()->is_locally_owned())
     dof_handler.begin_active()->set_active_fe_index(0);
-  if ((++dof_handler.begin_active())->is_locally_owned())
-    (++dof_handler.begin_active())->set_active_fe_index(1);
+  if ((std::next(dof_handler.begin_active()))->is_locally_owned())
+    (std::next(dof_handler.begin_active()))->set_active_fe_index(1);
   dof_handler.distribute_dofs(fe);
 
   AffineConstraints<double> constraints;
index 301a9265ded900342f6703b7b7aff351adf111b9..9063d483b7b8eab202506542f1ac362f776f7147 100644 (file)
@@ -328,10 +328,10 @@ test_with_2d_deformed_refined_mesh(const FiniteElement<dim> &fe,
             triangulation.begin_active()->set_refine_flag();
             break;
           case 1:
-            (++(triangulation.begin_active()))->set_refine_flag();
+            (std::next((triangulation.begin_active())))->set_refine_flag();
             break;
           case 2:
-            (++(++(triangulation.begin_active())))->set_refine_flag();
+            (std::next((++(triangulation.begin_active()))))->set_refine_flag();
             break;
           default:
             Assert(false, ExcNotImplemented());
index f1909ab84a327668d5110c255e05a1baf8e6bbdb..8f7a7a87ccfee4aa3512a7b843cf116e8eb4971f 100644 (file)
@@ -341,10 +341,10 @@ test_with_2d_deformed_refined_mesh(const FiniteElement<dim> &fe,
             triangulation.begin_active()->set_refine_flag();
             break;
           case 1:
-            (++(triangulation.begin_active()))->set_refine_flag();
+            (std::next((triangulation.begin_active())))->set_refine_flag();
             break;
           case 2:
-            (++(++(triangulation.begin_active())))->set_refine_flag();
+            (std::next((++(triangulation.begin_active()))))->set_refine_flag();
             break;
           default:
             Assert(false, ExcNotImplemented());
index e0bba589bf796b1adb9c64e40c4e04bae80bb642..90a3b4b25f11b5bff54be7ae517e5b7d4b4cec69 100644 (file)
@@ -193,8 +193,8 @@ test()
   dof_1.begin_active()->set_future_fe_index(0);
   dof_2.begin_active()->set_future_fe_index(0);
 
-  (++dof_1.begin_active())->set_future_fe_index(1);
-  (++dof_2.begin_active())->set_future_fe_index(1);
+  (std::next(dof_1.begin_active()))->set_future_fe_index(1);
+  (std::next(dof_2.begin_active()))->set_future_fe_index(1);
 
   // right now, both hp::DoFHandlers are the same. Renumber one of them
   DoFRenumbering::random(dof_1);

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.