]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-7: make bilinear forms more readable
authorMatthias Maier <tamiko@43-1.org>
Fri, 15 Jun 2018 23:55:17 +0000 (18:55 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 19 Sep 2018 19:02:56 +0000 (14:02 -0500)
examples/step-7/step-7.cc

index 49202e94a59a2a04189382f435f51bf25b0a4afe..d6c30eab7bb7d5e62853eca92865c1d20ef9ebc7 100644 (file)
@@ -655,14 +655,16 @@ namespace Step7
                 // The first thing that has changed is the bilinear form. It
                 // now contains the additional term from the Helmholtz
                 // equation:
-                cell_matrix(i, j) += ((fe_values.shape_grad(i, q_point) *
-                                         fe_values.shape_grad(j, q_point) +
-                                       fe_values.shape_value(i, q_point) *
-                                         fe_values.shape_value(j, q_point)) *
+                cell_matrix(i, j) += ((fe_values.shape_grad(i, q_point) *     //
+                                         fe_values.shape_grad(j, q_point)     //
+                                       +                                      //
+                                       fe_values.shape_value(i, q_point) *    //
+                                         fe_values.shape_value(j, q_point)) * //
                                       fe_values.JxW(q_point));
 
-              cell_rhs(i) += (fe_values.shape_value(i, q_point) *
-                              rhs_values[q_point] * fe_values.JxW(q_point));
+              cell_rhs(i) += (fe_values.shape_value(i, q_point) * //
+                              rhs_values[q_point] *               //
+                              fe_values.JxW(q_point));
             }
 
         // Then there is that second term on the right hand side, the contour
@@ -707,9 +709,9 @@ namespace Step7
                      fe_face_values.normal_vector(q_point));
 
                   for (unsigned int i = 0; i < dofs_per_cell; ++i)
-                    cell_rhs(i) +=
-                      (neumann_value * fe_face_values.shape_value(i, q_point) *
-                       fe_face_values.JxW(q_point));
+                    cell_rhs(i) += (neumann_value *                          //
+                                    fe_face_values.shape_value(i, q_point) * //
+                                    fe_face_values.JxW(q_point));
                 }
             }
 

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.