]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Do not use deprecated extract_locally_* functions in code-gallery. 161/head
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 8 Sep 2023 21:19:27 +0000 (15:19 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 8 Sep 2023 21:19:27 +0000 (15:19 -0600)
Distributed_LDG_Method/LDGPoisson.cc
Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc
NavierStokes_TRBDF2_DG/navier_stokes_TRBDF2_DG.cc
cdr/solver/cdr.cc
goal_oriented_elastoplasticity/elastoplastic.cc
time_dependent_navier_stokes/time_dependent_navier_stokes.cc
two_phase_flow/LevelSetSolver.cc
two_phase_flow/MultiPhase.cc
two_phase_flow/NavierStokesSolver.cc
two_phase_flow/TestLevelSet.cc
two_phase_flow/TestNavierStokes.cc

index 3fd0b1f1943ef7ffecdb6d282017d27008446192..6cbf74c4ca3f2bdfcd39de4e1ddc281d74b8de44 100644 (file)
@@ -320,15 +320,14 @@ make_dofs()
   // Now we get the locally owned dofs, that is the dofs that our local
   // to this processor. These dofs corresponding entries in the
   // matrix and vectors that we will write to.
-  IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
+  const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
 
   // In additon to the locally owned dofs, we also need the the locally
   // relevant dofs.  These are the dofs that have read access to and we
   // need in order to do computations on our processor, but, that
   // we do not have the ability to write to.
-  IndexSet locally_relevant_dofs;
-  DoFTools::extract_locally_relevant_dofs(dof_handler,
-                                          locally_relevant_dofs);
+  const IndexSet locally_relevant_dofs =
+    DoFTools::extract_locally_relevant_dofs(dof_handler);
 
   const std::vector<types::global_dof_index> dofs_per_component =
     DoFTools::count_dofs_per_fe_component(dof_handler);
index d49ce9b176fbe7b80ea10536e6df7e633a1150e8..1760e7f184d542cf3c11caf11b05f8deff4eefae 100644 (file)
@@ -207,8 +207,8 @@ void LaserHeating<dim>::setup_system ()
             << dof_handler.n_dofs()
             << std::endl;
 
-  locally_owned_dofs = dof_handler.locally_owned_dofs();
-  DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs);
+  locally_owned_dofs    = dof_handler.locally_owned_dofs();
+  locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs (dof_handler);
 
   // we want to output solution, so here should have ghost cells
   old_solution_T.reinit     (locally_owned_dofs,locally_relevant_dofs,mpi_communicator);
index 5572ab50467846c3db1ceeca04ae66fdb8668fae..f5b0f80ac55648a3bcfad651eef100bd32ae78d0 100644 (file)
@@ -2709,8 +2709,7 @@ namespace NS_TRBDF2 {
     TimerOutput::Scope t(time_table, "Refine mesh");
 
     /*--- We first create a proper vector for computing estimator ---*/
-    IndexSet locally_relevant_dofs;
-    DoFTools::extract_locally_relevant_dofs(dof_handler_velocity, locally_relevant_dofs);
+    const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler_velocity);
     LinearAlgebra::distributed::Vector<double> tmp_velocity;
     tmp_velocity.reinit(dof_handler_velocity.locally_owned_dofs(), locally_relevant_dofs, MPI_COMM_WORLD);
     tmp_velocity = u_n;
index 4b62f1e10bab527111de4c6d1445741595c41b34..aebc298166383a5e45703070746952cafc47127d 100644 (file)
@@ -162,8 +162,8 @@ CDRProblem<dim>::setup_dofs()
   dof_handler.distribute_dofs(fe);
   pcout << "Number of degrees of freedom: " << dof_handler.n_dofs()
         << std::endl;
-  locally_owned_dofs = dof_handler.locally_owned_dofs();
-  DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+  locally_owned_dofs    = dof_handler.locally_owned_dofs();
+  locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
 
   constraints.clear();
   constraints.reinit(locally_relevant_dofs);
index eca6183078f3eb44f5de13af6b3093c62acf3ac0..5a145276a98775eba46ec861969a00db9db65322 100644 (file)
@@ -4066,10 +4066,9 @@ namespace ElastoPlastic
             << dof_handler.n_dofs()
             << std::endl;
 
-      locally_owned_dofs = dof_handler.locally_owned_dofs();
-      locally_relevant_dofs.clear();
-      DoFTools::extract_locally_relevant_dofs(dof_handler,
-                                              locally_relevant_dofs);
+      locally_owned_dofs    = dof_handler.locally_owned_dofs();
+      locally_relevant_dofs =
+        DoFTools::extract_locally_relevant_dofs(dof_handler);
     }
 
     /* setup hanging nodes and Dirichlet constraints */
index 060f42c5f24e7200add4f861fd11dc6f7ac7005c..0a1f75609d39dbeb9ba8328559d4c446896e68a9 100644 (file)
@@ -653,7 +653,7 @@ namespace fluid
     owned_partitioning[0] = dof_handler.locally_owned_dofs().get_view(0, dof_u);
     owned_partitioning[1] =
       dof_handler.locally_owned_dofs().get_view(dof_u, dof_u + dof_p);
-    DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
+    locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler);
     relevant_partitioning.resize(2);
     relevant_partitioning[0] = locally_relevant_dofs.get_view(0, dof_u);
     relevant_partitioning[1] =
index feddd4b20c30da10726be2ad7a0f8ffb12d074d9..7aa2d8a3eb8f44da527dee52fe0d7a461de86806 100644 (file)
@@ -424,12 +424,12 @@ void LevelSetSolver<dim>::setup()
   ////////////////////////////
   // setup system LS
   dof_handler_LS.distribute_dofs (fe_LS);
-  locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_LS,locally_relevant_dofs_LS);
+  locally_owned_dofs_LS    = dof_handler_LS.locally_owned_dofs ();
+  locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
   // setup system U
   dof_handler_U.distribute_dofs (fe_U);
-  locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_U,locally_relevant_dofs_U);
+  locally_owned_dofs_U    = dof_handler_U.locally_owned_dofs ();
+  locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
   //////////////////////
   // INIT CONSTRAINTS //
   //////////////////////
index 9c2d8a75442628ee40381ba5471154fcda419c14..6a07370c695bbe4878075577873dce51fdd637af 100644 (file)
@@ -187,19 +187,16 @@ void MultiPhase<dim>::setup()
 {
   // setup system LS
   dof_handler_LS.distribute_dofs (fe_LS);
-  locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
-                                           locally_relevant_dofs_LS);
+  locally_owned_dofs_LS    = dof_handler_LS.locally_owned_dofs ();
+  locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
   // setup system U
   dof_handler_U.distribute_dofs (fe_U);
-  locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_U,
-                                           locally_relevant_dofs_U);
+  locally_owned_dofs_U    = dof_handler_U.locally_owned_dofs ();
+  locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
   // setup system P //
   dof_handler_P.distribute_dofs (fe_P);
-  locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_P,
-                                           locally_relevant_dofs_P);
+  locally_owned_dofs_P    = dof_handler_P.locally_owned_dofs ();
+  locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs (dof_handler_P);
   // init vectors for phi
   locally_relevant_solution_phi.reinit(locally_owned_dofs_LS,locally_relevant_dofs_LS,mpi_communicator);
   locally_relevant_solution_phi = 0;
index 742284798f31021aa695b234e57c00a823c90349..628b160a412ff5cc5b1172c0578cd1d4bb0a41a9 100644 (file)
@@ -472,16 +472,16 @@ void NavierStokesSolver<dim>::setup_DOF()
   degree_MAX=std::max(degree_LS,degree_U);
   // setup system LS
   dof_handler_LS.distribute_dofs(fe_LS);
-  locally_owned_dofs_LS=dof_handler_LS.locally_owned_dofs();
-  DoFTools::extract_locally_relevant_dofs(dof_handler_LS,locally_relevant_dofs_LS);
+  locally_owned_dofs_LS    = dof_handler_LS.locally_owned_dofs();
+  locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs(dof_handler_LS);
   // setup system U
   dof_handler_U.distribute_dofs(fe_U);
-  locally_owned_dofs_U=dof_handler_U.locally_owned_dofs();
-  DoFTools::extract_locally_relevant_dofs(dof_handler_U,locally_relevant_dofs_U);
-  // setup system P //
+  locally_owned_dofs_U    = dof_handler_U.locally_owned_dofs();
+  locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs(dof_handler_U);
+  // setup system P
   dof_handler_P.distribute_dofs(fe_P);
-  locally_owned_dofs_P=dof_handler_P.locally_owned_dofs();
-  DoFTools::extract_locally_relevant_dofs(dof_handler_P,locally_relevant_dofs_P);
+  locally_owned_dofs_P    = dof_handler_P.locally_owned_dofs();
+  locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs(dof_handler_P);
 }
 
 template<int dim>
index 541a56fde08647c1ce9fa274945b67ddb768326b..0f5146abbf49fce28a7f133eae7f0029649e25b1 100644 (file)
@@ -285,19 +285,16 @@ void TestLevelSet<dim>::setup()
   degree = std::max(degree_LS,degree_U);
   // setup system LS
   dof_handler_LS.distribute_dofs (fe_LS);
-  locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
-                                           locally_relevant_dofs_LS);
+  locally_owned_dofs_LS    = dof_handler_LS.locally_owned_dofs ();
+  locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
   // setup system U
   dof_handler_U.distribute_dofs (fe_U);
-  locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_U,
-                                           locally_relevant_dofs_U);
+  locally_owned_dofs_U    = dof_handler_U.locally_owned_dofs ();
+  locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
   // setup system U for disp field
   dof_handler_U_disp_field.distribute_dofs (fe_U_disp_field);
-  locally_owned_dofs_U_disp_field = dof_handler_U_disp_field.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_U_disp_field,
-                                           locally_relevant_dofs_U_disp_field);
+  locally_owned_dofs_U_disp_field    = dof_handler_U_disp_field.locally_owned_dofs ();
+  locally_relevant_dofs_U_disp_field = DoFTools::extract_locally_relevant_dofs (dof_handler_U_disp_field);
   // init vectors for phi
   locally_relevant_solution_phi.reinit(locally_owned_dofs_LS,
                                        locally_relevant_dofs_LS,
index 0e074ac260d5b6a8d35dbfc43cca5c94cb37a6d7..e7e9720e7573c7f22fc84678d12b6b825eaaaae5 100644 (file)
@@ -170,19 +170,16 @@ void TestNavierStokes<dim>::setup()
 {
   // setup system LS
   dof_handler_LS.distribute_dofs (fe_LS);
-  locally_owned_dofs_LS = dof_handler_LS.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_LS,
-                                           locally_relevant_dofs_LS);
+  locally_owned_dofs_LS    = dof_handler_LS.locally_owned_dofs ();
+  locally_relevant_dofs_LS = DoFTools::extract_locally_relevant_dofs (dof_handler_LS);
   // setup system U
   dof_handler_U.distribute_dofs (fe_U);
-  locally_owned_dofs_U = dof_handler_U.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_U,
-                                           locally_relevant_dofs_U);
+  locally_owned_dofs_U    = dof_handler_U.locally_owned_dofs ();
+  locally_relevant_dofs_U = DoFTools::extract_locally_relevant_dofs (dof_handler_U);
   // setup system P //
   dof_handler_P.distribute_dofs (fe_P);
-  locally_owned_dofs_P = dof_handler_P.locally_owned_dofs ();
-  DoFTools::extract_locally_relevant_dofs (dof_handler_P,
-                                           locally_relevant_dofs_P);
+  locally_owned_dofs_P    = dof_handler_P.locally_owned_dofs ();
+  locally_relevant_dofs_P = DoFTools::extract_locally_relevant_dofs (dof_handler_P);
   init_constraints();
   // init vectors for rho
   locally_relevant_solution_rho.reinit (locally_owned_dofs_LS,locally_relevant_dofs_LS,mpi_communicator);

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.