]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the use of deprecated functions in tutorials.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 27 Jan 2020 17:42:04 +0000 (10:42 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 5 Feb 2020 00:25:26 +0000 (17:25 -0700)
13 files changed:
examples/doxygen/block_dynamic_sparsity_pattern.cc
examples/step-20/step-20.cc
examples/step-21/step-21.cc
examples/step-22/step-22.cc
examples/step-31/step-31.cc
examples/step-32/step-32.cc
examples/step-43/step-43.cc
examples/step-44/step-44.cc
examples/step-45/step-45.cc
examples/step-46/doc/intro.dox
examples/step-55/step-55.cc
examples/step-56/step-56.cc
examples/step-57/step-57.cc

index 9b9b76653a16484e796c30f6a156d06a38ea69ce..b82fcdff2032f82870892922253abbc11b8f56a5 100644 (file)
@@ -53,8 +53,8 @@ int main()
   DoFTools::make_hanging_node_constraints(dof, constraints);
   constraints.close();
 
-  std::vector<unsigned int> dofs_per_block(fe.n_blocks());
-  DoFTools::count_dofs_per_block(dof, dofs_per_block);
+  const std::vector<unsigned int> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof);
 
   BlockDynamicSparsityPattern dsp(fe.n_blocks(), fe.n_blocks());
   for (unsigned int i = 0; i < fe.n_blocks(); ++i)
index 98d412490b0cb80ba0f9001a7bcba8df83f4591a..4447d85ca023e18d716909bf8a90880fbf1088ae 100644 (file)
@@ -341,11 +341,11 @@ namespace Step20
 
     // The next thing is that we want to figure out the sizes of these blocks
     // so that we can allocate an appropriate amount of space. To this end, we
-    // call the DoFTools::count_dofs_per_component() function that
+    // call the DoFTools::count_dofs_per_fe_component() function that
     // counts how many shape functions are non-zero for a particular vector
     // component. We have <code>dim+1</code> vector components, and
-    // DoFTools::count_dofs_per_component() will count how many shape functions
-    // belong to each of these components.
+    // DoFTools::count_dofs_per_fe_component() will count how many shape
+    // functions belong to each of these components.
     //
     // There is one problem here. As described in the documentation of that
     // function, it <i>wants</i> to put the number of $x$-velocity shape
@@ -369,13 +369,13 @@ namespace Step20
     // the vector and matrix block sizes, as well as create output.
     //
     // @note If you find this concept difficult to understand, you may
-    // want to consider using the function DoFTools::count_dofs_per_block()
+    // want to consider using the function DoFTools::count_dofs_per_fe_block()
     // instead, as we do in the corresponding piece of code in step-22.
     // You might also want to read up on the difference between
     // @ref GlossBlock "blocks" and @ref GlossComponent "components"
     // in the glossary.
-    std::vector<types::global_dof_index> dofs_per_component(dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+    const std::vector<types::global_dof_index> dofs_per_component =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     const unsigned int n_u = dofs_per_component[0],
                        n_p = dofs_per_component[dim];
 
index 4104101f0ecb3fcd6fe805578630faf7bf291cd6..9a188bbeeb7eb19eb8034bd75987e6b506aa676c 100644 (file)
@@ -534,8 +534,8 @@ namespace Step21
     dof_handler.distribute_dofs(fe);
     DoFRenumbering::component_wise(dof_handler);
 
-    std::vector<types::global_dof_index> dofs_per_component(dim + 2);
-    DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+    const std::vector<types::global_dof_index> dofs_per_component =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     const unsigned int n_u = dofs_per_component[0],
                        n_p = dofs_per_component[dim],
                        n_s = dofs_per_component[dim + 1];
index e49db80492435aba36a4f6a93e857c888af67a66..93551f5812926b25011cd91419589909444a229c 100644 (file)
@@ -492,13 +492,11 @@ namespace Step22
     // In analogy to step-20, we count the dofs in the individual components.
     // We could do this in the same way as there, but we want to operate on
     // the block structure we used already for the renumbering: The function
-    // <code>DoFTools::count_dofs_per_block</code> does the same as
-    // <code>DoFTools::count_dofs_per_component</code>, but now grouped as
+    // <code>DoFTools::count_dofs_per_fe_block</code> does the same as
+    // <code>DoFTools::count_dofs_per_fe_component</code>, but now grouped as
     // velocity and pressure block via <code>block_component</code>.
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   block_component);
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
     const unsigned int n_u = dofs_per_block[0];
     const unsigned int n_p = dofs_per_block[1];
 
index a36fdd2709ecef658075907b68f256059ab18222..03226e91de3f673df2f5698d7c24ab09648e2c4b 100644 (file)
@@ -866,10 +866,8 @@ namespace Step31
       temperature_constraints.close();
     }
 
-    std::vector<types::global_dof_index> stokes_dofs_per_block(2);
-    DoFTools::count_dofs_per_block(stokes_dof_handler,
-                                   stokes_dofs_per_block,
-                                   stokes_sub_blocks);
+    const std::vector<types::global_dof_index> stokes_dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(stokes_dof_handler, stokes_sub_blocks);
 
     const unsigned int n_u = stokes_dofs_per_block[0],
                        n_p = stokes_dofs_per_block[1],
index 9aef5bbe70e2fdf982369bca7c55e3e53a93b5a0..fe04f1040f7f72ab4fb30ae58e37a5cf70ca6f31 100644 (file)
@@ -1860,10 +1860,8 @@ namespace Step32
 
     temperature_dof_handler.distribute_dofs(temperature_fe);
 
-    std::vector<types::global_dof_index> stokes_dofs_per_block(2);
-    DoFTools::count_dofs_per_block(stokes_dof_handler,
-                                   stokes_dofs_per_block,
-                                   stokes_sub_blocks);
+    const std::vector<types::global_dof_index> stokes_dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(stokes_dof_handler, stokes_sub_blocks);
 
     const unsigned int n_u = stokes_dofs_per_block[0],
                        n_p = stokes_dofs_per_block[1],
index f40725c55af9e2ac00afebb5ed46e4aa1516670f..88ad89c8dbdd70f3f923e47d1fb36158568058ee 100644 (file)
@@ -693,10 +693,9 @@ namespace Step43
     }
 
 
-    std::vector<types::global_dof_index> darcy_dofs_per_block(2);
-    DoFTools::count_dofs_per_block(darcy_dof_handler,
-                                   darcy_dofs_per_block,
-                                   darcy_block_component);
+    const std::vector<types::global_dof_index> darcy_dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(darcy_dof_handler,
+                                        darcy_block_component);
     const unsigned int n_u = darcy_dofs_per_block[0],
                        n_p = darcy_dofs_per_block[1],
                        n_s = saturation_dof_handler.n_dofs();
index 570365d58b6fef0d7188f7f6180e79b5206cb47c..31eeefcfdf0a1bccc146bd7bf89952ccffbfa3c8 100644 (file)
@@ -1509,9 +1509,9 @@ namespace Step44
     dof_handler.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler);
     DoFRenumbering::component_wise(dof_handler, block_component);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   block_component);
+
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
 
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
index 87bb4bc24e2ce9b11975b2be57eb5825816de542..2227da05d9e4504d8030b7dfc00cace25950cd21 100644 (file)
@@ -364,10 +364,8 @@ namespace Step45
     block_component[dim] = 1;
     DoFRenumbering::component_wise(dof_handler, block_component);
 
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   block_component);
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
     const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
 
     {
index b77ed76f19cf81336e9c4f2ef88c08f62becedc9..cd2b14e28fdf78d911ec52dd10e16f20a53c14af 100644 (file)
@@ -262,7 +262,7 @@ mapping the problem on to the hp framework makes sense:
   the same (here, <code>2*dim+1</code>). This makes all sorts of
   things possible since a uniform description allows for code
   re-use. For example, counting degrees of freedom per vector
-  component (DoFTools::count_dofs_per_component), sorting degrees of
+  component (DoFTools::count_dofs_per_fe_component), sorting degrees of
   freedom by component (DoFRenumbering::component_wise), subsequent
   partitioning of matrices and vectors into blocks and many other
   functions work as they always did without the need to add special
index c984e7839762af466e9ffab8e4c40d15b133b3fa..4d6362626d950ba121c396fd38aa9a6123061a7e 100644 (file)
@@ -362,12 +362,11 @@ namespace Step55
     stokes_sub_blocks[dim] = 1;
     DoFRenumbering::component_wise(dof_handler, stokes_sub_blocks);
 
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   stokes_sub_blocks);
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, stokes_sub_blocks);
 
-    const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
+    const unsigned int n_u = dofs_per_block[0];
+    const unsigned int n_p = dofs_per_block[1];
 
     pcout << "   Number of degrees of freedom: " << dof_handler.n_dofs() << " ("
           << n_u << '+' << n_p << ')' << std::endl;
index 3073d1419cebc67d58758594dee7a5e26e355cef..19a9b3ab997e6a627b4b7e5c038af1530fc52316 100644 (file)
@@ -553,11 +553,10 @@ namespace Step56
           }
       }
 
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   block_component);
-    const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
+    const unsigned int n_u = dofs_per_block[0];
+    const unsigned int n_p = dofs_per_block[1];
 
     {
       constraints.clear();
index d46b2e1a855593c6e4f1a76c32305e6ef917ae0a..a8b8911cb41393d6518be2f9b418b45643b8fee6 100644 (file)
@@ -290,10 +290,8 @@ namespace Step57
     block_component[dim] = 1;
     DoFRenumbering::component_wise(dof_handler, block_component);
 
-    dofs_per_block.resize(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
     unsigned int dof_u = dofs_per_block[0];
     unsigned int dof_p = dofs_per_block[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.