]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-55: Give better names to local matrices. 17079/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 25 May 2024 03:43:25 +0000 (21:43 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 25 May 2024 03:43:25 +0000 (21:43 -0600)
examples/step-55/step-55.cc

index 745faeeeca4f15421bda6bffef3ca0b43ca811a4..592c80c9f2eb0515f571852db81b10eef7fa37a2 100644 (file)
@@ -507,8 +507,8 @@ namespace Step55
     const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
     const unsigned int n_q_points    = quadrature_formula.size();
 
-    FullMatrix<double> cell_matrix(dofs_per_cell, dofs_per_cell);
-    FullMatrix<double> cell_matrix2(dofs_per_cell, dofs_per_cell);
+    FullMatrix<double> system_cell_matrix(dofs_per_cell, dofs_per_cell);
+    FullMatrix<double> preconditioner_cell_matrix(dofs_per_cell, dofs_per_cell);
     Vector<double>     cell_rhs(dofs_per_cell);
 
     const RightHandSide<dim>    right_hand_side;
@@ -525,9 +525,9 @@ namespace Step55
     for (const auto &cell : dof_handler.active_cell_iterators())
       if (cell->is_locally_owned())
         {
-          cell_matrix  = 0;
-          cell_matrix2 = 0;
-          cell_rhs     = 0;
+          system_cell_matrix         = 0;
+          preconditioner_cell_matrix = 0;
+          cell_rhs                   = 0;
 
           fe_values.reinit(cell);
           right_hand_side.vector_value_list(fe_values.get_quadrature_points(),
@@ -545,14 +545,15 @@ namespace Step55
                 {
                   for (unsigned int j = 0; j < dofs_per_cell; ++j)
                     {
-                      cell_matrix(i, j) +=
+                      system_cell_matrix(i, j) +=
                         (viscosity *
                            scalar_product(grad_phi_u[i], grad_phi_u[j]) -
                          div_phi_u[i] * phi_p[j] - phi_p[i] * div_phi_u[j]) *
                         fe_values.JxW(q);
 
-                      cell_matrix2(i, j) += 1.0 / viscosity * phi_p[i] *
-                                            phi_p[j] * fe_values.JxW(q);
+                      preconditioner_cell_matrix(i, j) += 1.0 / viscosity *
+                                                          phi_p[i] * phi_p[j] *
+                                                          fe_values.JxW(q);
                     }
 
                   const unsigned int component_i =
@@ -564,13 +565,13 @@ namespace Step55
 
 
           cell->get_dof_indices(local_dof_indices);
-          constraints.distribute_local_to_global(cell_matrix,
+          constraints.distribute_local_to_global(system_cell_matrix,
                                                  cell_rhs,
                                                  local_dof_indices,
                                                  system_matrix,
                                                  system_rhs);
 
-          constraints.distribute_local_to_global(cell_matrix2,
+          constraints.distribute_local_to_global(preconditioner_cell_matrix,
                                                  local_dof_indices,
                                                  preconditioner_matrix);
         }

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.