]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve readability of assembly routine
authorMatthias Maier <tamiko@43-1.org>
Sat, 11 May 2019 21:08:41 +0000 (16:08 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 12 May 2019 15:27:21 +0000 (10:27 -0500)
examples/step-6/step-6.cc

index 583a8de938a84d48d617a4c451473bcca16e73b1..7f7f9ee82c98e78e671e3cf3fbbab9051fa9382b 100644 (file)
@@ -299,11 +299,14 @@ void Step6<dim>::assemble_system()
             {
               for (unsigned int j = 0; j < dofs_per_cell; ++j)
                 cell_matrix(i, j) +=
-                  (current_coefficient * fe_values.shape_grad(i, q_index) *
-                   fe_values.shape_grad(j, q_index) * fe_values.JxW(q_index));
-
-              cell_rhs(i) += (fe_values.shape_value(i, q_index) * 1.0 *
-                              fe_values.JxW(q_index));
+                  (current_coefficient *              // a(x_q)
+                   fe_values.shape_grad(i, q_index) * // grad phi_j(x_q)
+                   fe_values.shape_grad(j, q_index) * // grad phi_i(x_q)
+                   fe_values.JxW(q_index));           // dx
+
+              cell_rhs(i) += (1.0 *                               //
+                              fe_values.shape_value(i, q_index) * // phi_i(x_q)
+                              fe_values.JxW(q_index));            // dx
             }
         }
 

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.