]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-9: Label terms in the weak form.
authorDavid Wells <drwells@email.unc.edu>
Thu, 12 Jul 2018 13:19:08 +0000 (09:19 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 3 Aug 2018 02:39:05 +0000 (22:39 -0400)
examples/step-9/step-9.cc

index aae5134f95062c15c8d561d87d81fee0b819f3f2..b5c648a41691a10b959f7392a0b00b10039664b1 100644 (file)
@@ -643,21 +643,24 @@ namespace Step9
     for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
       for (unsigned int i = 0; i < dofs_per_cell; ++i)
         {
+          // Alias the AssemblyScratchData object to keep the lines from
+          // getting too long:
+          const auto &sd = scratch_data;
           for (unsigned int j = 0; j < dofs_per_cell; ++j)
             copy_data.cell_matrix(i, j) +=
-              ((scratch_data.advection_directions[q_point] *
-                scratch_data.fe_values.shape_grad(j, q_point) *
-                (scratch_data.fe_values.shape_value(i, q_point) +
-                 delta * (scratch_data.advection_directions[q_point] *
-                          scratch_data.fe_values.shape_grad(i, q_point)))) *
-               scratch_data.fe_values.JxW(q_point));
+              ((sd.fe_values.shape_value(i, q_point) +           // (phi_i +
+                delta * (sd.advection_directions[q_point] *      // delta beta
+                         sd.fe_values.shape_grad(i, q_point))) * // grad phi_i)
+               sd.advection_directions[q_point] *                // beta
+               sd.fe_values.shape_grad(j, q_point)) *            // grad phi_j
+              sd.fe_values.JxW(q_point);                         // dx
 
           copy_data.cell_rhs(i) +=
-            ((scratch_data.fe_values.shape_value(i, q_point) +
-              delta * (scratch_data.advection_directions[q_point] *
-                       scratch_data.fe_values.shape_grad(i, q_point))) *
-             scratch_data.rhs_values[q_point] *
-             scratch_data.fe_values.JxW(q_point));
+            (sd.fe_values.shape_value(i, q_point) +           // (phi_i +
+             delta * (sd.advection_directions[q_point] *      // delta beta
+                      sd.fe_values.shape_grad(i, q_point))) * // grad phi_i)
+            sd.rhs_values[q_point] *                          // f
+            sd.fe_values.JxW(q_point);                        // dx
         }
 
     // Besides the cell terms which we have built up now, the bilinear

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.