]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid use of deprecated DoFTools functions in tests/. 9435/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 27 Jan 2020 22:40:14 +0000 (15:40 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 5 Feb 2020 00:26:48 +0000 (17:26 -0700)
84 files changed:
tests/ad_common_tests/step-44-helper_res_lin_01.h
tests/ad_common_tests/step-44-helper_scalar_01.h
tests/ad_common_tests/step-44-helper_var_form_01.h
tests/ad_common_tests/step-44-helper_vector_01.h
tests/adolc/step-44.cc
tests/bits/anna_3.cc
tests/bits/anna_6.cc
tests/bits/count_dofs_per_block_01.cc
tests/bits/count_dofs_per_block_02.cc
tests/bits/count_dofs_per_component_hp_01.cc
tests/bits/count_dofs_per_component_hp_02.cc
tests/distributed_grids/count_dofs_per_block_01.cc
tests/distributed_grids/count_dofs_per_component_01.cc
tests/distributed_grids/hp_count_dofs_per_block_01.cc
tests/distributed_grids/hp_count_dofs_per_component_01.cc
tests/dofs/dof_tools_00a.cc
tests/dofs/dof_tools_01c.cc
tests/dofs/dof_tools_01d.cc
tests/dofs/dof_tools_02c.cc
tests/dofs/dof_tools_02d.cc
tests/dofs/dof_tools_04.cc
tests/dofs/dof_tools_04a.cc
tests/dofs/dof_tools_07.cc
tests/dofs/dof_tools_17c.cc
tests/dofs/dof_tools_17d.cc
tests/dofs/dof_tools_18c.cc
tests/dofs/dof_tools_18d.cc
tests/dofs/extract_dofs_by_component_05.cc
tests/dofs/extract_dofs_by_component_05_hp.cc
tests/dofs/extract_dofs_by_component_06.cc
tests/dofs/extract_dofs_by_component_06_hp.cc
tests/examples/step-56.cc
tests/fe/fe_q_dg0.cc
tests/fe/fe_values_view_21.cc
tests/fe/fe_values_view_21_nonsymmetric.cc
tests/fe/fe_values_view_22.cc
tests/fe/fe_values_view_tensor_01.cc
tests/gla/block_mat_02.cc
tests/gla/block_mat_03.cc
tests/hp/count_dofs_per_block_01.cc
tests/hp/count_dofs_per_block_02.cc
tests/hp/fe_nothing_18.cc
tests/hp/solution_transfer_15.cc
tests/lac/block_linear_operator_01.cc
tests/lac/block_linear_operator_02.cc
tests/lac/block_linear_operator_06.cc
tests/lac/constraints_block_01.cc
tests/lac/linear_operator_03.cc
tests/lac/linear_operator_13.cc
tests/lac/linear_operator_14.cc
tests/lac/schur_complement_03.cc
tests/matrix_free/copy_feevaluation.cc
tests/matrix_free/matrix_vector_stokes.cc
tests/matrix_free/matrix_vector_stokes_base.cc
tests/matrix_free/matrix_vector_stokes_flux.cc
tests/matrix_free/matrix_vector_stokes_noflux.cc
tests/matrix_free/matrix_vector_stokes_notempl.cc
tests/matrix_free/matrix_vector_stokes_qdg0.cc
tests/matrix_free/matrix_vector_stokes_qdg0b.cc
tests/mpi/count_dofs_per_block_01.cc
tests/mpi/count_dofs_per_block_02.cc
tests/mpi/count_dofs_per_component_01.cc
tests/mpi/muelu_periodicity.cc
tests/mpi/parallel_vector_back_interpolate_02.cc
tests/mpi/periodicity_02.cc
tests/mpi/periodicity_03.cc
tests/mpi/project_bv_div_conf.cc
tests/mpi/solution_transfer_03.cc
tests/multigrid/transfer_block.cc
tests/multigrid/transfer_block_select.cc
tests/multigrid/transfer_compare_01.cc
tests/multigrid/transfer_select.cc
tests/multigrid/transfer_system_05.cc
tests/multigrid/transfer_system_adaptive_09.cc
tests/numerics/point_value_history_02.cc
tests/optimization/step-44.h
tests/physics/step-44-standard_tensors-material_push_forward.cc
tests/physics/step-44-standard_tensors-spatial.cc
tests/physics/step-44.cc
tests/quick_tests/p4est.cc
tests/trilinos/assemble_matrix_parallel_04.cc
tests/trilinos/assemble_matrix_parallel_06.cc
tests/trilinos/trilinos_sparsity_pattern_02.cc
tests/umfpack/umfpack_04.cc

index 68b1842b94ddde357fb2e9083601fd45ddc63bfb..00160721412738e18ded50f459b144df8b398989 100644 (file)
@@ -866,9 +866,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index 51378aae8543985014b7f4aaa8b9176853d96aa0..7117e17973f19b9db218d2dd4860738c850b2706 100644 (file)
@@ -1269,9 +1269,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index b633cf479b3ed1d176cb2f8fb0623512e5215fcf..4921d1f4bed9ca4eac9a9772dbc414fa77fb62df 100644 (file)
@@ -832,9 +832,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index 20850557681962ab336efd8a122b457591e53294..d3f34e496d9b0edecebf74ad56b9048402107350 100644 (file)
@@ -867,9 +867,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index a89b71c0a8bfa39f08c8d664f8fad0b538022a28..0769b9eac908d2149bc4ab06883d137748ba82ad 100644 (file)
@@ -1104,9 +1104,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index 56fb5fa7da36ef5298f58f1c1e78a17e035bcf0c..909fc7a9e6486d7aec2020bdbe0e3ff83b632841 100644 (file)
@@ -16,7 +16,7 @@
 
 
 // check some things about Nedelec elements, here that
-// DoFTools::component_select and DoFTools::count_dofs_per_component
+// DoFTools::component_select and DoFTools::count_dofs_per_fe_component
 // works
 //
 // this program is a modified version of one by Anna Schneebeli,
@@ -91,17 +91,17 @@ SystemTest<dim>::check()
     {
       deallog << "Checking for component " << c << std::endl;
       std::vector<bool> x(fe.n_components(), false);
-      x[c]         = true;
-      IndexSet sel = DoFTools::extract_dofs(dof_handler, ComponentMask(x));
+      x[c] = true;
+      const IndexSet sel =
+        DoFTools::extract_dofs(dof_handler, ComponentMask(x));
 
       for (unsigned int i = 0; i < sel.size(); ++i)
         if (sel.is_element(i))
           deallog << "  DoF " << i << std::endl;
     };
 
-  std::vector<types::global_dof_index> dofs_per_component(
-    fe.n_components(), static_cast<types::global_dof_index>(0));
-  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);
   deallog << "DoFs per component: ";
   for (unsigned int i = 0; i < fe.n_components(); ++i)
     deallog << dofs_per_component[i] << ' ';
index b0850182d0bd29ae31958cde9af7ded0f611003b..80391b5e1546f9d6875d3073c77f6cb9866414e8 100644 (file)
@@ -154,8 +154,8 @@ void
 ImposeBC<dim>::get_ready()
 {
   dof_handler.distribute_dofs(fe);
-  std::vector<types::global_dof_index> dofs_per_comp(fe.n_components());
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_comp);
+  const std::vector<types::global_dof_index> dofs_per_comp =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   // For an FESystem with Nedelec-elements as
   // first component and bilinear elements as
index a56a1c1d608cb0a6c24a7370ab5373b67c82f96d..1181ca3fda9c44ceb803338efce64b40adb66081 100644 (file)
@@ -75,14 +75,14 @@ check()
 
   // no grouping
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     print(dpc);
   }
 
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler);
     print(dpc);
   }
 
@@ -92,8 +92,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -101,8 +101,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -112,8 +112,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
@@ -121,8 +121,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
index 19e17106e4d795ca87a53653bcc3b2afbcf0c38a..f4a556ce01509be797ca11ffdd5e993279011f16 100644 (file)
@@ -73,14 +73,14 @@ check()
 
   // no grouping
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     print(dpc);
   }
 
   {
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_block(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler);
     print(dpc);
   }
 
@@ -90,8 +90,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -99,8 +99,8 @@ check()
   {
     std::vector<unsigned int> group(2, 0);
     group[1] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -110,8 +110,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
@@ -119,8 +119,8 @@ check()
   {
     std::vector<unsigned int> group(2, 2 * dim);
     group[1] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
index 97095f1c84a037e01b61b895aa551e26fcaa0560..ab34c4addda2dfa25d7a8ce763671b68cacc9be9 100644 (file)
@@ -61,10 +61,10 @@ test()
   dof_handler.distribute_dofs(fe_system);
 
   // count dofs per component and show them on the screen
-  std::vector<types::global_dof_index> dofs_per_component(3, 0);
-  std::vector<types::global_dof_index> dofs_per_component_hp(3, 0);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
-  DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
+  const std::vector<types::global_dof_index> dofs_per_component_hp =
+    DoFTools::count_dofs_per_fe_component(hp_dof_handler);
 
   for (unsigned int i = 0; i < 3; i++)
     {
index 267b8482ddf046b4dfafe5189b0d87ce8a2ba1dc..ceb9a267b9675ab3479b817caf19597688c8a068 100644 (file)
@@ -68,8 +68,8 @@ test()
   hp_dof_handler.distribute_dofs(fe_collection);
 
   // count dofs per component and show them on the screen
-  std::vector<types::global_dof_index> dofs_per_component_hp(3, 0);
-  DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp);
+  const std::vector<types::global_dof_index> dofs_per_component_hp =
+    DoFTools::count_dofs_per_fe_component(hp_dof_handler);
 
   for (unsigned int i = 0; i < 3; i++)
     {
index b191ee1c0be7f260c4020c68cc35af9f781f2683..3c40cd8c01f42fde58c3d2187ecee9b59115c223 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_block
+// Test DoFTools::count_dofs_per_fe_block
 
 
 #include <deal.II/base/tensor.h>
@@ -90,8 +90,8 @@ test()
       triangulation.execute_coarsening_and_refinement();
       dof_handler.distribute_dofs(fe);
 
-      std::vector<types::global_dof_index> dofs_per_block(fe.n_components());
-      DoFTools::count_dofs_per_block(dof_handler, dofs_per_block);
+      const std::vector<types::global_dof_index> dofs_per_block =
+        DoFTools::count_dofs_per_fe_block(dof_handler);
 
       AssertThrow(std::accumulate(dofs_per_block.begin(),
                                   dofs_per_block.end(),
index db55074fbf08a884599903e2c769c72a0d4994d8..b35a66f07424ef7c2e260399e4ce3376e067658a 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_component
+// Test DoFTools::count_dofs_per_fe_component
 
 
 #include <deal.II/base/tensor.h>
@@ -55,8 +55,8 @@ test()
   triangulation.refine_global(2);
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(fe.n_components());
-  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);
 
   Assert(std::accumulate(dofs_per_component.begin(),
                          dofs_per_component.end(),
index 5e1bee7fa0d1113a03c26a67d26ca6c0595ebf29..4fc125149b42826214028187ab8fe1eb84a792af 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_block
+// Test DoFTools::count_dofs_per_fe_block
 //
 // like the test without the hp_ prefix, but for hp::DoFHandler
 
@@ -98,8 +98,8 @@ test()
       triangulation.execute_coarsening_and_refinement();
       dof_handler.distribute_dofs(fe);
 
-      std::vector<types::global_dof_index> dofs_per_block(fe.n_components());
-      DoFTools::count_dofs_per_block(dof_handler, dofs_per_block);
+      const std::vector<types::global_dof_index> dofs_per_block =
+        DoFTools::count_dofs_per_fe_block(dof_handler);
 
       AssertThrow(std::accumulate(dofs_per_block.begin(),
                                   dofs_per_block.end(),
index c7cb8c4065725221c3fa2e6ed6e3acb4a9248f67..280ccd8a68da47c4fee0e687248f7a21e3b64189 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_component
+// Test DoFTools::count_dofs_per_fe_component
 //
 // like the test without the hp_ prefix, but for hp::DoFHandler
 
@@ -63,8 +63,8 @@ test()
   triangulation.refine_global(2);
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(fe.n_components());
-  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);
 
   Assert(std::accumulate(dofs_per_component.begin(),
                          dofs_per_component.end(),
index 0033f5ddb8172b26762199ec8088021fa0029c7b..d3787af7fff33fb9ae818a55f5fba4e0fa039d6a 100644 (file)
@@ -32,14 +32,14 @@ check_this(const DoFHandlerType &dof_handler)
 
   deallog << "n_dofs:" << dof_handler.n_dofs() << std::endl;
 
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   for (unsigned int i = 0; i < n_components; ++i)
     deallog << ' ' << dofs_per_component[i];
   deallog << std::endl;
 
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component, true);
+  dofs_per_component = DoFTools::count_dofs_per_fe_component(dof_handler, true);
 
   for (unsigned int i = 0; i < n_components; ++i)
     deallog << ' ' << dofs_per_component[i];
@@ -48,21 +48,20 @@ check_this(const DoFHandlerType &dof_handler)
   if (n_components > 1)
     {
       std::vector<unsigned int> target_component(n_components, 0U);
-      dofs_per_component.resize(1);
-      DoFTools::count_dofs_per_component(dof_handler,
-                                         dofs_per_component,
-                                         false,
-                                         target_component);
+      dofs_per_component =
+        DoFTools::count_dofs_per_fe_component(dof_handler,
+                                              false,
+                                              target_component);
       for (unsigned int i = 0;
            i < std::min(n_components, (unsigned int)dofs_per_component.size());
            ++i)
         deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
 
-      DoFTools::count_dofs_per_component(dof_handler,
-                                         dofs_per_component,
-                                         true,
-                                         target_component);
+      dofs_per_component =
+        DoFTools::count_dofs_per_fe_component(dof_handler,
+                                              true,
+                                              target_component);
       for (unsigned int i = 0;
            i < std::min(n_components, (unsigned int)dofs_per_component.size());
            ++i)
@@ -73,19 +72,19 @@ check_this(const DoFHandlerType &dof_handler)
         target_component[i] = 1;
       dofs_per_component.resize(2);
 
-      DoFTools::count_dofs_per_component(dof_handler,
-                                         dofs_per_component,
-                                         false,
-                                         target_component);
+      dofs_per_component =
+        DoFTools::count_dofs_per_fe_component(dof_handler,
+                                              false,
+                                              target_component);
       for (unsigned int i = 0;
            i < std::min(n_components, (unsigned int)dofs_per_component.size());
            ++i)
         deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
-      DoFTools::count_dofs_per_component(dof_handler,
-                                         dofs_per_component,
-                                         true,
-                                         target_component);
+      dofs_per_component =
+        DoFTools::count_dofs_per_fe_component(dof_handler,
+                                              true,
+                                              target_component);
       for (unsigned int i = 0;
            i < std::min(n_components, (unsigned int)dofs_per_component.size());
            ++i)
index 7eac4108946c3cf7e92d123737123005228899c6..778cc21c3c9e6d063b3198e60c64f28408296f37 100644 (file)
@@ -43,8 +43,8 @@ check_this(const DoFHandlerType &dof_handler)
   // create sparsity pattern
   const unsigned int   n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  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);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i],
index 94d067ed6808a4ba6ddae05a6bcb9f738f4c1b0f..2f21c1ed0040fabb6f5a160650b5d04020ee56c0 100644 (file)
@@ -42,9 +42,9 @@ check_this(const DoFHandlerType &dof_handler)
 
   // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  BlockDynamicSparsityPattern          sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  BlockDynamicSparsityPattern                sp(n_components, n_components);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]);
index 40268cac5a0016cbb3eaa8ea7aaf7e1f136c1985..0d0b3349bf0acb67857918f1326c7fd5a5fb6fa4 100644 (file)
@@ -51,9 +51,9 @@ check_this(const DoFHandlerType &dof_handler)
     return;
 
   // create sparsity pattern
-  BlockSparsityPattern                 sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  BlockSparsityPattern                       sp(n_components, n_components);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i],
index 954316825b6f2c1b70015a2d3331f94242135234..2dbc131fe0a84aed8578d2c629e0603948e608dd 100644 (file)
@@ -51,9 +51,9 @@ check_this(const DoFHandlerType &dof_handler)
     return;
 
   // create sparsity pattern
-  BlockDynamicSparsityPattern          sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  BlockDynamicSparsityPattern                sp(n_components, n_components);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]);
index 85ce2da32ac291379125e1d68e32e731b806ae73..70a84a45aff1c7dbae2d5a597d808ad128bab97b 100644 (file)
@@ -29,20 +29,18 @@ check_this(const DoFHandlerType &dof_handler)
 {
   const types::global_dof_index n_dofs = dof_handler.n_dofs();
 
-  std::vector<bool> hanging_node_dofs(n_dofs);
-  DoFTools::extract_hanging_node_dofs(dof_handler, hanging_node_dofs);
+  const IndexSet hanging_node_dofs =
+    DoFTools::extract_hanging_node_dofs(dof_handler);
 
   AffineConstraints<double> constraints;
   DoFTools::make_hanging_node_constraints(dof_handler, constraints);
   constraints.close();
 
   for (types::global_dof_index dof = 0; dof < n_dofs; ++dof)
-    if (hanging_node_dofs[dof])
+    if (hanging_node_dofs.is_element(dof))
       AssertThrow(constraints.is_constrained(dof), ExcInternalError());
 
-  AssertThrow((unsigned int)std::count(hanging_node_dofs.begin(),
-                                       hanging_node_dofs.end(),
-                                       true) == constraints.n_constraints(),
+  AssertThrow(hanging_node_dofs.n_elements() == constraints.n_constraints(),
               ExcInternalError());
   output_bool_vector(hanging_node_dofs);
 }
index b3e347a404e85d926ae38d2daf1eb5062c84fff1..e93b7e211bda07190a00c3be4d0cc4853ff52b90 100644 (file)
@@ -53,20 +53,19 @@ check_this(const DoFHandler<dim> &dof_handler)
   IndexSet locally_relevant_dofs;
   DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
 
-  std::vector<bool> is_hanging_node_constrained(n_dofs);
-  DoFTools::extract_hanging_node_dofs(dof_handler, is_hanging_node_constrained);
+  const IndexSet is_hanging_node_constrained =
+    DoFTools::extract_hanging_node_dofs(dof_handler);
 
   AffineConstraints<double> constraints(locally_relevant_dofs);
   DoFTools::make_hanging_node_constraints(dof_handler, constraints);
   constraints.close();
 
   for (const auto &dof : locally_relevant_dofs)
-    if (is_hanging_node_constrained[dof])
+    if (is_hanging_node_constrained.is_element(dof))
       AssertThrow(constraints.is_constrained(dof), ExcInternalError());
 
-  AssertThrow((unsigned int)(std::count(is_hanging_node_constrained.begin(),
-                                        is_hanging_node_constrained.end(),
-                                        true)) == constraints.n_constraints(),
+  AssertThrow(is_hanging_node_constrained.n_elements() ==
+                constraints.n_constraints(),
               ExcInternalError());
 
   deallog << "OK" << std::endl;
index 0128961d87e658f1658f0034950566222efda8d2..e5c618281673e4197387eea6e25803f423b65fb1 100644 (file)
@@ -19,7 +19,7 @@
 #include "dof_tools_common_fake_hp.h"
 
 // check
-//   DoFTools::count_dofs_per_component
+//   DoFTools::count_dofs_per_fe_component
 
 
 
@@ -27,9 +27,8 @@ template <typename DoFHandlerType>
 void
 check_this(const DoFHandlerType &dof_handler)
 {
-  std::vector<types::global_dof_index> n_dofs(
-    dof_handler.get_fe().n_components());
-  DoFTools::count_dofs_per_component(dof_handler, n_dofs);
+  const std::vector<types::global_dof_index> n_dofs =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_dofs.size(); ++i)
     deallog << n_dofs[i] << " ";
   deallog << std::endl;
index 4b53b9aa51701f1689599ace5386df4c247908ce..460273bcefd7b7081bf8dd07df079c527f65f605 100644 (file)
@@ -43,8 +43,8 @@ check_this(const DoFHandlerType &dof_handler)
   // create sparsity pattern
   const unsigned int   n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  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);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i],
index 682017f94446cffc1fde5c48d277d19a1558c68c..2742f8c41d9cad5a519fa0dc0cc7b6dfbbd0fb44 100644 (file)
@@ -42,9 +42,9 @@ check_this(const DoFHandlerType &dof_handler)
 
   // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  BlockDynamicSparsityPattern          sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  BlockDynamicSparsityPattern                sp(n_components, n_components);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]);
index 19f4ce600ca7a4397faeecdbf57eb2747aa06738..43c242aeb7f779f16f06fe9f107869c54d9670c6 100644 (file)
@@ -64,8 +64,8 @@ check_this(const DoFHandlerType &dof_handler)
   // create sparsity pattern
   const unsigned int   n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  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);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i],
index 98680f0bbaffd9ab8a82bb7513e31e7122d18155..83fb811a19fce62c12b355743c8ad7aefa4509ea 100644 (file)
@@ -63,9 +63,9 @@ check_this(const DoFHandlerType &dof_handler)
 
   // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
-  BlockDynamicSparsityPattern          sp(n_components, n_components);
-  std::vector<types::global_dof_index> dofs_per_component(n_components);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_component);
+  BlockDynamicSparsityPattern                sp(n_components, n_components);
+  const std::vector<types::global_dof_index> dofs_per_component =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
   for (unsigned int i = 0; i < n_components; ++i)
     for (unsigned int j = 0; j < n_components; ++j)
       sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]);
index 0eeb2bff9583948e86fa7983049c78459e909c1d..e5a1938b169bbaa3abc079f25fe5cf8a0d8cedfa 100644 (file)
@@ -20,7 +20,7 @@
 //
 // this particular test checks the call path to
 // internal::extract_dofs_by_component from
-// DoFTools::count_dofs_per_component with argument only_once=false
+// DoFTools::count_dofs_per_fe_component with argument only_once=false
 
 
 #include <deal.II/dofs/dof_handler.h>
@@ -59,8 +59,8 @@ check()
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-  std::vector<types::global_dof_index> count(element.n_components());
-  DoFTools::count_dofs_per_component(dof, count, false);
+  const std::vector<types::global_dof_index> count =
+    DoFTools::count_dofs_per_fe_component(dof, false);
 
   for (unsigned int d = 0; d < count.size(); ++d)
     deallog << count[d] << std::endl;
index 667d68b543efa83a57f54dcd2af2aae9fe022ce7..6f672b7243611043feee2d7ab2d37d898bb0d8a6 100644 (file)
@@ -20,7 +20,7 @@
 //
 // this particular test checks the call path to
 // internal::extract_dofs_by_component from
-// DoFTools::count_dofs_per_component with argument only_once=false
+// DoFTools::count_dofs_per_fe_component with argument only_once=false
 
 
 #include <deal.II/dofs/dof_tools.h>
@@ -60,8 +60,8 @@ check()
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
 
-  std::vector<types::global_dof_index> count(element.n_components());
-  DoFTools::count_dofs_per_component(dof, count, false);
+  const std::vector<types::global_dof_index> count =
+    DoFTools::count_dofs_per_fe_component(dof, false);
 
   for (unsigned int d = 0; d < count.size(); ++d)
     deallog << count[d] << std::endl;
index 9f3d7c9bc41d94260b340745ab2d8a20e8709cf2..ef51d06012718d93dd7229c918e337998f1752c1 100644 (file)
@@ -20,7 +20,7 @@
 //
 // this particular test checks the call path to
 // internal::extract_dofs_by_component from
-// DoFTools::count_dofs_per_component with argument only_once=true
+// DoFTools::count_dofs_per_fe_component with argument only_once=true
 
 
 #include <deal.II/dofs/dof_handler.h>
@@ -59,8 +59,8 @@ check()
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-  std::vector<types::global_dof_index> count(element.n_components());
-  DoFTools::count_dofs_per_component(dof, count, true);
+  const std::vector<types::global_dof_index> count =
+    DoFTools::count_dofs_per_fe_component(dof, true);
 
   for (unsigned int d = 0; d < count.size(); ++d)
     deallog << count[d] << std::endl;
index 66812cdd94d2d4ade35c7e89fe32ac7502234f7e..58ae82eb71e74940737e22b4c67be9c1b1c03586 100644 (file)
@@ -20,7 +20,7 @@
 //
 // this particular test checks the call path to
 // internal::extract_dofs_by_component from
-// DoFTools::count_dofs_per_component with argument only_once=true
+// DoFTools::count_dofs_per_fe_component with argument only_once=true
 
 
 #include <deal.II/dofs/dof_tools.h>
@@ -60,8 +60,8 @@ check()
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
 
-  std::vector<types::global_dof_index> count(element.n_components());
-  DoFTools::count_dofs_per_component(dof, count, true);
+  const std::vector<types::global_dof_index> count =
+    DoFTools::count_dofs_per_fe_component(dof, true);
 
   for (unsigned int d = 0; d < count.size(); ++d)
     deallog << count[d] << std::endl;
index 1af69b445c0a145773017e4b3ab7a2c5fdd22bbb..9aae51087d0383742536920a5933b3ee5fd73b86 100644 (file)
@@ -564,10 +564,8 @@ 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 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 4b3375f4d76a6898a5d7bfe8cadfdc2143513fe5..34e67283fd787d1f313dfb51d46b6763960a422f 100644 (file)
@@ -469,10 +469,8 @@ namespace Step22
 
     constraints.close();
 
-    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];
 
     deallog << "   Number of active cells: " << triangulation.n_active_cells()
index 4769ec92c6c154ef879760f0029695ed02dcbef1..83f3c5c151676da7ecbd47d66eb6240c9b5ff08a 100644 (file)
@@ -116,8 +116,8 @@ MixedElastoPlasticity<dim>::make_grid_and_dofs()
   DoFRenumbering::component_wise(dof_handler);
 
   // total number of dof per 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_stress_dof = dofs_per_block[0];
   const unsigned int n_gamma_dof  = dofs_per_block[1];
index 66021e8a179146d7e64663383c64e61e966483bb..3ff4ed027d0b2d5644d6599fec8a591290b3eb94 100644 (file)
@@ -117,8 +117,8 @@ MixedElastoPlasticity<dim>::make_grid_and_dofs()
   DoFRenumbering::component_wise(dof_handler);
 
   // total number of dof per 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_stress_dof = dofs_per_block[0];
   const unsigned int n_gamma_dof  = dofs_per_block[1];
index 9461c81244fdd2705124c5f83629a70065930c7b..f6e8f1d481f7985877f12326361a3377d2f7445a 100644 (file)
@@ -110,8 +110,8 @@ MixedElastoPlasticity<dim>::make_grid_and_dofs()
 
   DoFRenumbering::component_wise(dof_handler);
 
-  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_stress_dof = dofs_per_block[0];
   const unsigned int n_gamma_dof  = dofs_per_block[1];
index eb9e7b4ee751b380f9ace97f1dce517097f0900b..81f2fa8b5da5d4eabf1d3aa19eca7e385acc78bd 100644 (file)
@@ -114,8 +114,8 @@ MixedElastoPlasticity<dim>::make_grid_and_dofs()
   DoFRenumbering::component_wise(dof_handler);
 
   // total number of dof per 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_stress_dof = dofs_per_block[0];
   const unsigned int n_gamma_dof  = dofs_per_block[1];
index db286a5c790a828bb9725da64d3b9f30fcc0f2c1..a4d3bc01ca41a2fb76674a73afce92bedf0ba7c9 100644 (file)
@@ -77,10 +77,8 @@ test()
   stokes_dof_handler.distribute_dofs(stokes_fe);
   DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks);
 
-  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];
@@ -174,10 +172,8 @@ test_LA_Trilinos()
   stokes_dof_handler.distribute_dofs(stokes_fe);
   DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks);
 
-  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 e516a5118f47216dc35c4c8decb137657ddd0672..9682fb128dc07dcad040eff3582ceba7c93937d0 100644 (file)
@@ -70,10 +70,10 @@ test()
   dof_handler.distribute_dofs(fe);
   DoFRenumbering::block_wise(dof_handler);
 
-  std::vector<types::global_dof_index> dofs_per_block(fe.n_blocks());
-  std::vector<unsigned int>            sub_blocks(fe.n_blocks(), 0);
+  std::vector<unsigned int> sub_blocks(fe.n_blocks(), 0);
   sub_blocks[1] = 1;
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, sub_blocks);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, sub_blocks);
 
   deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1]
           << std::endl;
@@ -176,10 +176,10 @@ test_alt()
   dof_handler.distribute_dofs(fe);
   DoFRenumbering::block_wise(dof_handler);
 
-  std::vector<types::global_dof_index> dofs_per_block(fe.n_blocks());
-  std::vector<unsigned int>            sub_blocks(fe.n_blocks(), 0);
+  std::vector<unsigned int> sub_blocks(fe.n_blocks(), 0);
   sub_blocks[1] = 1;
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, sub_blocks);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, sub_blocks);
 
   deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1]
           << std::endl;
index a7894688ec52c8769f6c1e69783e471155ec3aec..4fd03a448545020ab590b9cdbea4e6708dc2081e 100644 (file)
@@ -85,14 +85,14 @@ check()
 
   // no grouping
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     print(dpc);
   }
 
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler);
     print(dpc);
   }
 
@@ -102,8 +102,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -111,8 +111,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -122,8 +122,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
@@ -131,8 +131,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
index b0ff720885c4528d64dc1ed9a8b13f3bb7460347..ac48215af038ed5c560dc0db31f9af863754659b 100644 (file)
@@ -85,14 +85,14 @@ check()
 
   // no grouping
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler);
     print(dpc);
   }
 
   {
-    std::vector<types::global_dof_index> dpc(dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler);
     print(dpc);
   }
 
@@ -102,8 +102,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -111,8 +111,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 0);
     group[dim] = 1;
-    std::vector<types::global_dof_index> dpc(2);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2, ExcInternalError());
     print(dpc);
   }
@@ -122,8 +122,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_component(dof_handler, dpc, false, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_component(dof_handler, false, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
@@ -131,8 +131,8 @@ check()
   {
     std::vector<unsigned int> group(dim + 1, 2 * dim);
     group[dim] = 0;
-    std::vector<types::global_dof_index> dpc(2 * dim + 1);
-    DoFTools::count_dofs_per_block(dof_handler, dpc, group);
+    const std::vector<types::global_dof_index> dpc =
+      DoFTools::count_dofs_per_fe_block(dof_handler, group);
     Assert(dpc.size() == 2 * dim + 1, ExcInternalError());
     print(dpc);
   }
index e58e6d5ba4ff22c298aad36978a8e67492d1aef1..68b0519698488ce85ec61fa25f7bc6d80b14f1c8 100644 (file)
@@ -354,7 +354,8 @@ ElasticProblem<dim>::setup_system()
     dof_handler); // do renumberring; must be done
                   // right after distributing DoF !!!
   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);
 
   deallog << "dofs per block:  U=" << dofs_per_block[u_block]
           << " L=" << dofs_per_block[lambda_block] << std::endl;
index 20eb8b35480818d3b61302febbc204a782c63ed7..c3ea1fd389a6364204b39bb21409b3475419e257 100644 (file)
@@ -61,9 +61,9 @@ initialize_indexsets(IndexSet &             locally_owned_dofs,
   locally_relevant_dofs = DoFTools::locally_relevant_dofs_per_subdomain(
     dof_handler)[this_mpi_process];
 
-  const unsigned int                   n_blocks = block_component.size();
-  std::vector<types::global_dof_index> dofs_per_block(n_blocks);
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
+  const unsigned int                         n_blocks = block_component.size();
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
 
   locally_owned_partitioning.clear();
   locally_relevant_partitioning.clear();
index 1034778ef9410ed2bee6ecb01c801d389bda3fd6..9546191702651ae9ebca790310b05c74245388ad 100644 (file)
@@ -58,8 +58,8 @@ main()
 
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(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[1];
 
   BlockDynamicSparsityPattern dsp(2, 2);
index c3752eaf77f433bebf072183b3ff6e3fdcda1aa4..050fb41f0f019daf07c5b56c747ccb5846b6cd56 100644 (file)
@@ -58,8 +58,8 @@ main()
 
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dpc(3);
-  DoFTools::count_dofs_per_component(dof_handler, dpc);
+  const std::vector<types::global_dof_index> dpc =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   BlockDynamicSparsityPattern dsp(3, 3);
   for (unsigned int i = 0; i < 3; ++i)
index b7d329e8ee3a5456e042ef9e03f97cfdcb628c41..e404aa3d4e810ee150c427ea38f6ace9d084d67e 100644 (file)
@@ -58,8 +58,8 @@ main()
 
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(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[1];
 
   BlockDynamicSparsityPattern dsp(2, 2);
index 12118c218ecd6c44936a51ca4b7cef767f956a66..36bf111ac8c7a736a2bac0d2afbcae14b0314cfd 100644 (file)
@@ -147,12 +147,8 @@ main()
         block_component[comp] = 2;
     } // comp
 
-  std::vector<types::global_dof_index> dofs_per_block(
-    3, 0); // 3 blocks, count dofs:
-  DoFTools::count_dofs_per_component(dh,
-                                     dofs_per_block,
-                                     false,
-                                     block_component);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_component(dh, false, block_component);
 
   DoFRenumbering::component_wise(dh, block_component);
 
index 4f4ea0d37bdb3ae2579cb9112055b3a831abeb83..d791e26f401fc77a9f276393ff13e55ae6b27b76 100644 (file)
@@ -68,8 +68,8 @@ main()
 
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(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[1];
 
   BlockDynamicSparsityPattern dsp(2, 2);
index dc73444199d36269613994bb0937d11019c74842..b4b9eb117288938e802d88b8e1cbea2779f65c37 100644 (file)
@@ -79,7 +79,8 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix,
   // Setup system
   dof_handler.distribute_dofs(fe);
   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::vector<IndexSet> partitioning(2);
   partitioning[0] = complete_index_set(dofs_per_block[0]);
   partitioning[1] = complete_index_set(dofs_per_block[1]);
index 8050551f604ca657e1a4072c205a568a2746f0e4..dcc248963c8b80548f0e0562500bcaca633ec045 100644 (file)
@@ -97,7 +97,8 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix,
   // Setup system
   dof_handler.distribute_dofs(fe);
   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);
 
   locally_owned_dofs = dof_handler.locally_owned_dofs();
   locally_owned_partitioning.push_back(
index 7056e4dc7b53f2df424da57a1a843ef8d415eb22..668bedf618dfcffd1f3b8d1c96070b7cd738f88d 100644 (file)
@@ -181,10 +181,8 @@ namespace Step22
                                                fe.component_mask(velocities));
     }
     constraints.close();
-    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];
     deallog << "   Number of active cells: " << triangulation.n_active_cells()
             << std::endl
index 3ba33e1fdf6daf86f494146912ce26cd62b54433..c4b526815aa255549e7f927a916719cf4a624cef 100644 (file)
@@ -187,10 +187,8 @@ test()
   DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
   constraints_p.close();
 
-  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);
 
   // std::cout << "Number of active cells: "
   //          << triangulation.n_active_cells()
index 1f20c774a466e673f44069bf08730852cdb22fb6..a450fae2d4225b93f2f50f6b84eafce49c15e18f 100644 (file)
@@ -161,8 +161,8 @@ test()
 
   constraints.close();
 
-  std::vector<types::global_dof_index> dofs_per_block(dim + 1);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_block);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   // std::cout << "   Number of active cells: "
   //          << triangulation.n_active_cells()
index 2bfdbab30be7358f154cfc4e149dc1f4f44d434e..7cdcf65218bafdec467288fd3948dfc0f37b49ae 100644 (file)
@@ -149,8 +149,8 @@ test()
   DoFTools::make_hanging_node_constraints(dof_p, constraints_p);
   constraints_p.close();
 
-  std::vector<types::global_dof_index> dofs_per_block(2);
-  DoFTools::count_dofs_per_block(dof, dofs_per_block, stokes_sub_blocks);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof, stokes_sub_blocks);
   {
     BlockDynamicSparsityPattern csp(2, 2);
 
index 6dde5249e835b3602805b06fd0a50cea4cd925c6..2c7cfe2ec638dc9f011575e6df36247d1df0385c 100644 (file)
@@ -170,10 +170,8 @@ test()
                                                constraints);
   constraints.close();
 
-  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);
   {
     BlockDynamicSparsityPattern csp(2, 2);
 
index bd6650b1cafebeb04cecd1e4d5c7a0d6cbf9b84a..42fb68d9f32a918af0661537e4b5c9273a861220 100644 (file)
@@ -182,10 +182,8 @@ test()
   DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
   constraints_p.close();
 
-  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);
 
   // std::cout << "Number of active cells: "
   //          << triangulation.n_active_cells()
index 008795ed057bf4952f51ea60eb95d21fe5af2dc9..6b1280a69909fe3ff1d850b37f9baefbbcea999d 100644 (file)
@@ -178,10 +178,8 @@ test(const unsigned int fe_degree)
   DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p);
   constraints_p.close();
 
-  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);
 
   // std::cout << "Number of active cells: "
   //          << triangulation.n_active_cells()
index a5bf54c39470f51f32373c02f2d94926d19c1f71..125491ab6d2a1f9e5d543523954d16d125842588 100644 (file)
@@ -163,8 +163,8 @@ test()
 
   constraints.close();
 
-  std::vector<types::global_dof_index> dofs_per_block(dim + 1);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_block);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   // std::cout << "   Number of active cells: "
   //          << triangulation.n_active_cells()
index 7b47c103f597a5ed80a6566b2f0969d178f506bf..1da5e8026c4cdbfc202c39b4b1cb5a7bc5aad68e 100644 (file)
@@ -160,8 +160,8 @@ test(const unsigned int fe_degree)
 
   constraints.close();
 
-  std::vector<types::global_dof_index> dofs_per_block(dim + 1);
-  DoFTools::count_dofs_per_component(dof_handler, dofs_per_block);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   // std::cout << "   Number of active cells: "
   //          << triangulation.n_active_cells()
index c7cfdbece8e9b0fd076c1ebe57b08e25c59b3b22..008bcd76195bf3e6e3a97df02bf037227a346f51 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// test DoFTools::count_dofs_per_block in parallel
+// test DoFTools::count_dofs_per_fe_block in parallel
 
 
 #include <deal.II/base/tensor.h>
@@ -55,8 +55,8 @@ test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_block(fe.n_blocks());
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler);
 
   if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
     for (unsigned int i = 0; i < fe.n_blocks(); ++i)
index b191ee1c0be7f260c4020c68cc35af9f781f2683..3c40cd8c01f42fde58c3d2187ecee9b59115c223 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_block
+// Test DoFTools::count_dofs_per_fe_block
 
 
 #include <deal.II/base/tensor.h>
@@ -90,8 +90,8 @@ test()
       triangulation.execute_coarsening_and_refinement();
       dof_handler.distribute_dofs(fe);
 
-      std::vector<types::global_dof_index> dofs_per_block(fe.n_components());
-      DoFTools::count_dofs_per_block(dof_handler, dofs_per_block);
+      const std::vector<types::global_dof_index> dofs_per_block =
+        DoFTools::count_dofs_per_fe_block(dof_handler);
 
       AssertThrow(std::accumulate(dofs_per_block.begin(),
                                   dofs_per_block.end(),
index c7a5094baeb17a9cdd42d9d1ee5e05d34b109ab2..a6b505db63506d04b9d0ce93ccde9d3c755eaee3 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_component
+// Test DoFTools::count_dofs_per_fe_component
 
 
 #include <deal.II/base/tensor.h>
@@ -55,8 +55,8 @@ test()
   triangulation.refine_global(2);
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(fe.n_components());
-  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);
 
   AssertThrow(std::accumulate(dofs_per_component.begin(),
                               dofs_per_component.end(),
index 9e49099e4a8ee407e4a6f5df958875400530b590..b70717adf0275b8848be79843d276c678a0d1acc 100644 (file)
@@ -324,9 +324,9 @@ namespace Step22
     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);
+    DoFTools::count_dofs_per_fe_block(dof_handler,
+                                      dofs_per_block,
+                                      block_component);
     const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
 
     {
index 185c0ebba2a22360f31f2e1582dbdb08467c36d3..50d795b08e1de39df5196f2da9c983f1f6c4ba79 100644 (file)
@@ -71,8 +71,8 @@ test()
   std::vector<IndexSet> owned_partitioning1;
   std::vector<IndexSet> relevant_partitioning1;
   {
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof1, dofs_per_block);
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof1);
     const unsigned int n1 = dofs_per_block[0], n2 = dofs_per_block[1];
 
     owned_partitioning1.push_back(locally_owned_dofs1.get_view(0, n1));
index a817b1e9357902b35a9768879c69dfb6e258e6d7..d87d7d6a42770fc749f004d82ba1ec6ff0958937 100644 (file)
@@ -325,10 +325,8 @@ namespace Step22
     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 508f817c4eee3e587afd1f79b45cad4fb45c50b5..0fa2e88982d28c981e76f6cf345d34e151aba68a 100644 (file)
@@ -253,10 +253,8 @@ namespace Step22
     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 c27328143b825e5a5307d0e15a2106ddde25a46a..1d7873f575827b2394bb4498055e936f3b06038a 100644 (file)
@@ -168,10 +168,8 @@ namespace ResFlow
     // Renumber to yield block structure
     DoFRenumbering::block_wise(dof_handler);
 
-    std::vector<types::global_dof_index> dofs_per_block(2);
-    DoFTools::count_dofs_per_block(dof_handler,
-                                   dofs_per_block,
-                                   resflow_sub_blocks);
+    const std::vector<types::global_dof_index> dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler, resflow_sub_blocks);
 
     const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
     pcout << "   Number of degrees of freedom: " << dof_handler.n_dofs() << " ("
index 738bbe74eb6429a4d2ec978c77425116bc9a274e..f93e50564d68fb9815bb224ded594521eec34ad0 100644 (file)
@@ -59,9 +59,9 @@ initialize_indexsets(IndexSet &             locally_owned_dofs,
   locally_relevant_dofs = DoFTools::locally_relevant_dofs_per_subdomain(
     dof_handler)[this_mpi_process];
 
-  const unsigned int                   n_blocks = block_component.size();
-  std::vector<types::global_dof_index> dofs_per_block(n_blocks);
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
+  const unsigned int                         n_blocks = block_component.size();
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, block_component);
 
   locally_owned_partitioning.clear();
   locally_relevant_partitioning.clear();
index 8fdaa259bb45510b0f6e480801eaef7f56fea7fc..a9b249040953f0dd33f3f28a1ecf4bf7e653244f 100644 (file)
@@ -100,8 +100,9 @@ check_block(const FiniteElement<dim> &fe,
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof);
-  vector<types::global_dof_index> ndofs(fe.n_blocks());
-  DoFTools::count_dofs_per_block(mgdof, ndofs);
+  const vector<types::global_dof_index> ndofs =
+    DoFTools::count_dofs_per_fe_block(mgdof);
+  Assert(ndofs.size() == fe.n_blocks(), ExcInternalError());
 
   for (unsigned int l = 0; l < tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l);
index 55ad85dc32c71bfb5793e9cc8217d53fa79dccae..a6abdd36a8c0544647f8f68489040b7c8212e260 100644 (file)
@@ -86,8 +86,8 @@ check_select(const FiniteElement<dim> &fe, unsigned int selected)
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof);
-  vector<types::global_dof_index> ndofs(fe.n_blocks());
-  DoFTools::count_dofs_per_block(mgdof, ndofs);
+  const vector<types::global_dof_index> ndofs =
+    DoFTools::count_dofs_per_fe_block(mgdof);
 
   for (unsigned int l = 0; l < tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l);
index a1f1003a753ebfc4c00a18d1b129509c4adee75b..4494cdbc0a660e9cd1bf91014f0ceca0abb0750a 100644 (file)
@@ -144,8 +144,8 @@ check_block(const FiniteElement<dim> &fe)
     }
 
   // Store sizes
-  vector<types::global_dof_index> ndofs(fe.n_blocks());
-  DoFTools::count_dofs_per_block(mgdof, ndofs);
+  const vector<types::global_dof_index> ndofs =
+    DoFTools::count_dofs_per_fe_block(mgdof);
   std::vector<std::vector<types::global_dof_index>> mg_ndofs(
     mgdof.get_triangulation().n_levels(),
     std::vector<types::global_dof_index>(fe.n_blocks()));
index 426c8167109d0e2cf470caa4ef349a4c0a7ce027..b02e010c637ebff43167dbc713dfb3b78f417b9c 100644 (file)
@@ -59,9 +59,12 @@ check_select(const FiniteElement<dim> &fe,
   mgdof.distribute_dofs(fe);
   mgdof.distribute_mg_dofs();
   DoFRenumbering::component_wise(mgdof, target_component);
-  vector<types::global_dof_index> ndofs(
-    *std::max_element(target_component.begin(), target_component.end()) + 1);
-  DoFTools::count_dofs_per_component(mgdof, ndofs, true, target_component);
+  const vector<types::global_dof_index> ndofs =
+    DoFTools::count_dofs_per_fe_component(mgdof, true, target_component);
+  Assert(ndofs.size() ==
+           *std::max_element(target_component.begin(), target_component.end()) +
+             1,
+         ExcInternalError());
 
   for (unsigned int l = 0; l < tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l, mg_target_component);
index fd5c45e38bdde5f8530c415dcc13f2a67d0f733c..432b3256caa1761d069aedc94f6663e513d3d77c 100644 (file)
@@ -73,10 +73,8 @@ check(const FiniteElement<dim> &fe, const unsigned int selected_block)
                  block_component,
                  block_component);
 
-  std::vector<types::global_dof_index> dofs_per_block(3);
-  DoFTools::count_dofs_per_block(mg_dof_handler,
-                                 dofs_per_block,
-                                 block_component);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(mg_dof_handler, block_component);
   std::vector<std::vector<types::global_dof_index>> mg_dofs_per_block(
     tr.n_levels(), std::vector<types::global_dof_index>(3));
   MGTools::count_dofs_per_block(mg_dof_handler,
index b8b338406a82aee454863376dc9c27f8b5180f93..ff6c650153664a4fb3fe56c2fbce015a1b9d6a39 100644 (file)
@@ -119,10 +119,8 @@ check(const FiniteElement<dim> &fe, const unsigned int selected_block)
                  block_component,
                  block_component);
 
-  std::vector<types::global_dof_index> dofs_per_block(3);
-  DoFTools::count_dofs_per_block(mg_dof_handler,
-                                 dofs_per_block,
-                                 block_component);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(mg_dof_handler, block_component);
   std::vector<std::vector<types::global_dof_index>> mg_dofs_per_block(
     tr.n_levels(), std::vector<types::global_dof_index>(3));
   MGTools::count_dofs_per_block(mg_dof_handler,
index 8ea3dbba767b813416ec64627176166adee2eca5..dd887e88d240ea116c75dc67b7df3501fac70165 100644 (file)
@@ -184,7 +184,7 @@ TestPointValueHistory<dim>::run()
 
   //            // BlockVector
   //        std::vector<unsigned int> dofs_per_block(2);
-  //        DoFTools::count_dofs_per_block(dof_handler, dofs_per_block,
+  //        DoFTools::count_dofs_per_fe_block(dof_handler, dofs_per_block,
   //        block_component); const unsigned int n_u = dofs_per_block[0],
   //                n_p = dofs_per_block[1];
   //        BlockVector<double> solution;
index e3a37d4764a944c439c41fdcc87599e027047f58..24c8aad494d3875e56e2a84dbad0ee8e66e63dc7 100644 (file)
@@ -1135,9 +1135,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     std::cout << "Triangulation:"
               << "\n\t Number of active cells: "
               << triangulation.n_active_cells()
index dbe238c94a7f05b4d4595fa6ee48766431387a03..68ad00d3a5b79f59b7caba4a38a0739d2d327eeb 100644 (file)
@@ -1300,9 +1300,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     pcout << "Triangulation:"
           << "\n\t Number of active cells: " << triangulation.n_active_cells()
           << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs()
index 2414e99529dc9c955d7a6e3d2596f4c35390316e..0cb3691baee15d9f2d6ca5fe2ffccbf9ea9cde8c 100644 (file)
@@ -1100,9 +1100,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     pcout << "Triangulation:"
           << "\n\t Number of active cells: " << triangulation.n_active_cells()
           << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs()
index 250f6556a37b7cf1961b9d05c6f935646c128d24..b142dcaa0ce88faf1dd23c00b1272796974ca561 100644 (file)
@@ -1113,9 +1113,8 @@ namespace Step44
     dof_handler_ref.distribute_dofs(fe);
     DoFRenumbering::Cuthill_McKee(dof_handler_ref);
     DoFRenumbering::component_wise(dof_handler_ref, block_component);
-    DoFTools::count_dofs_per_block(dof_handler_ref,
-                                   dofs_per_block,
-                                   block_component);
+    dofs_per_block =
+      DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component);
     pcout << "Triangulation:"
           << "\n\t Number of active cells: " << triangulation.n_active_cells()
           << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs()
index 2005908812e37180625c41940463a25344cc2ccb..9b1a7ec6c946ce5e0151c26b60d2a820314897b7 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test DoFTools::count_dofs_per_component
+// Test DoFTools::count_dofs_per_fe_component
 
 
 #include <deal.II/base/tensor.h>
@@ -54,15 +54,15 @@ test()
   triangulation.refine_global(2);
   dof_handler.distribute_dofs(fe);
 
-  std::vector<types::global_dof_index> dofs_per_component(fe.n_components());
-  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);
 
   Assert(std::accumulate(dofs_per_component.begin(),
                          dofs_per_component.end(),
                          0U) == dof_handler.n_dofs(),
          ExcInternalError());
 
-  unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
+  const unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
   if (myid == 0)
     {
       deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
index c76bb7707ce02d7c2ed87c979d339275997d43d5..822ccee602380abeb243038a7ca93b136f04b627 100644 (file)
@@ -289,8 +289,8 @@ LaplaceProblem<dim>::setup_system()
            relevant_total;
   DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total);
 
-  std::vector<types::global_dof_index> dofs_per_block(2);
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, blocks);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, blocks);
   locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]);
   locally_owned[1] =
     locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs());
index 735c81d1efb0c98385b56b01ac4290c184f81701..3619e87af8ca1bd461fddbd1fc5076ab80a6b86b 100644 (file)
@@ -291,8 +291,8 @@ LaplaceProblem<dim>::setup_system()
            relevant_total;
   DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total);
 
-  std::vector<types::global_dof_index> dofs_per_block(2);
-  DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, blocks);
+  const std::vector<types::global_dof_index> dofs_per_block =
+    DoFTools::count_dofs_per_fe_block(dof_handler, blocks);
   locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]);
   locally_owned[1] =
     locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs());
index 58e0df4ef0a159c0b966cec86a039ba1eb3db740..e9fe99f52177521602d66db23cb8b2ef4057b825 100644 (file)
@@ -90,10 +90,8 @@ namespace Step22
     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 ccc1e7ab82e22fe467815eedf0119afdb51364c7..28895ed494e6f805768aab900d9c949fa4caac07 100644 (file)
@@ -129,8 +129,8 @@ test()
 
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
 
-  std::vector<types::global_dof_index> size(dim);
-  DoFTools::count_dofs_per_component(dof_handler, size);
+  const std::vector<types::global_dof_index> size =
+    DoFTools::count_dofs_per_fe_component(dof_handler);
 
   BlockSparsityPattern b_sparsity_pattern;
   SparsityPattern      sparsity_pattern;

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.