]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compilation with 64-bit integers 13146/head
authorMartin Kronbichler <martin.kronbichler@it.uu.se>
Tue, 28 Dec 2021 20:52:24 +0000 (21:52 +0100)
committerMartin Kronbichler <martin.kronbichler@it.uu.se>
Tue, 28 Dec 2021 20:52:24 +0000 (21:52 +0100)
examples/step-22/step-22.cc
examples/step-31/step-31.cc
examples/step-32/step-32.cc
examples/step-43/step-43.cc

index c24fa9e0968125da42aec6191a82dd3aa2b6e7d2..cde92544a9032ee02d7a10622d7c82fcc6f7aa21 100644 (file)
@@ -502,8 +502,8 @@ namespace Step22
     // velocity and pressure block via <code>block_component</code>.
     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];
+    const types::global_dof_index n_u = dofs_per_block[0];
+    const types::global_dof_index n_p = dofs_per_block[1];
 
     std::cout << "   Number of active cells: " << triangulation.n_active_cells()
               << std::endl
index 380e9185191c28c24cf12dca6306d7abc699c482..27474bfa4ec439c02f32bd70693d912a9f03336c 100644 (file)
@@ -867,10 +867,9 @@ namespace Step31
     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],
-                       n_T = temperature_dof_handler.n_dofs();
-    const std::vector<unsigned int> stokes_block_sizes = {n_u, n_p};
+    const types::global_dof_index n_u = stokes_dofs_per_block[0],
+                                  n_p = stokes_dofs_per_block[1],
+                                  n_T = temperature_dof_handler.n_dofs();
 
     std::cout << "Number of active cells: " << triangulation.n_active_cells()
               << " (on " << triangulation.n_levels() << " levels)" << std::endl
@@ -920,7 +919,8 @@ namespace Step31
     {
       stokes_matrix.clear();
 
-      BlockDynamicSparsityPattern dsp(stokes_block_sizes, stokes_block_sizes);
+      BlockDynamicSparsityPattern dsp(stokes_dofs_per_block,
+                                      stokes_dofs_per_block);
 
       Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
 
@@ -942,7 +942,8 @@ namespace Step31
       Mp_preconditioner.reset();
       stokes_preconditioner_matrix.clear();
 
-      BlockDynamicSparsityPattern dsp(stokes_block_sizes, stokes_block_sizes);
+      BlockDynamicSparsityPattern dsp(stokes_dofs_per_block,
+                                      stokes_dofs_per_block);
 
       Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
       for (unsigned int c = 0; c < dim + 1; ++c)
index 9fd86ff02d9977aa2d9bbe6a09e3f49ee6a86d46..496ffe4ffd19ec72e6f4246b6843e2c3f3f7d2c4 100644 (file)
@@ -1836,9 +1836,9 @@ namespace Step32
     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],
-                       n_T = temperature_dof_handler.n_dofs();
+    const types::global_dof_index n_u = stokes_dofs_per_block[0],
+                                  n_p = stokes_dofs_per_block[1],
+                                  n_T = temperature_dof_handler.n_dofs();
 
     std::locale s = pcout.get_stream().getloc();
     pcout.get_stream().imbue(std::locale(""));
index e29f03443c3ffb9300c1a3614f5a9199fc308d49..32115156ee324407b0f208afd5175fe18758cb1b 100644 (file)
@@ -692,10 +692,9 @@ namespace Step43
     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();
-    const std::vector<unsigned int> darcy_block_sizes = {n_u, n_p};
+    const types::global_dof_index n_u = darcy_dofs_per_block[0],
+                                  n_p = darcy_dofs_per_block[1],
+                                  n_s = saturation_dof_handler.n_dofs();
 
     std::cout << "Number of active cells: " << triangulation.n_active_cells()
               << " (on " << triangulation.n_levels() << " levels)" << std::endl
@@ -706,7 +705,8 @@ namespace Step43
     {
       darcy_matrix.clear();
 
-      BlockDynamicSparsityPattern dsp(darcy_block_sizes, darcy_block_sizes);
+      BlockDynamicSparsityPattern dsp(darcy_dofs_per_block,
+                                      darcy_dofs_per_block);
 
       Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
       for (unsigned int c = 0; c < dim + 1; ++c)
@@ -728,7 +728,8 @@ namespace Step43
       Mp_preconditioner.reset();
       darcy_preconditioner_matrix.clear();
 
-      BlockDynamicSparsityPattern dsp(darcy_block_sizes, darcy_block_sizes);
+      BlockDynamicSparsityPattern dsp(darcy_dofs_per_block,
+                                      darcy_dofs_per_block);
 
       Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
       for (unsigned int c = 0; c < dim + 1; ++c)

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.