]> https://gitweb.dealii.org/ - dealii.git/commitdiff
update 6778/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 25 Jun 2018 22:39:33 +0000 (17:39 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 25 Jun 2018 22:43:15 +0000 (17:43 -0500)
examples/step-3/step-3.cc

index 99b38504515ee65d73484ca6b84f0ffc36212b57..1e50eef4db8dfef605654429d6f27bf9b5840808 100644 (file)
@@ -167,8 +167,7 @@ void Step3::make_grid()
   GridGenerator::hyper_cube(triangulation, -1, 1);
   triangulation.refine_global(5);
 
-  std::cout << "Number of active cells: "     //
-            << triangulation.n_active_cells() //
+  std::cout << "Number of active cells: " << triangulation.n_active_cells()
             << std::endl;
 }
 
@@ -197,8 +196,7 @@ void Step3::make_grid()
 void Step3::setup_system()
 {
   dof_handler.distribute_dofs(fe);
-  std::cout << "Number of degrees of freedom: " //
-            << dof_handler.n_dofs()             //
+  std::cout << "Number of degrees of freedom: " << dof_handler.n_dofs()
             << std::endl;
   // There should be one DoF for each vertex. Since we have a 32 times 32
   // grid, the number of DoFs should be 33 times 33, or 1089.
@@ -437,9 +435,10 @@ void Step3::assemble_system()
           // this is repeated for all shape functions $i$ and $j$:
           for (unsigned int i = 0; i < dofs_per_cell; ++i)
             for (unsigned int j = 0; j < dofs_per_cell; ++j)
-              cell_matrix(i, j) += (fe_values.shape_grad(i, q_index) * //
-                                    fe_values.shape_grad(j, q_index) * //
-                                    fe_values.JxW(q_index));
+              cell_matrix(i, j) +=
+                (fe_values.shape_grad(i, q_index) * // grad phi_i(x_q)
+                 fe_values.shape_grad(j, q_index) * // grad phi_j(x_q)
+                 fe_values.JxW(q_index));           // dx
 
           // We then do the same thing for the right hand side. Here,
           // the integral is over the shape function i times the right
@@ -447,9 +446,9 @@ void Step3::assemble_system()
           // with constant value one (more interesting examples will
           // be considered in the following programs).
           for (unsigned int i = 0; i < dofs_per_cell; ++i)
-            cell_rhs(i) += (fe_values.shape_value(i, q_index) * //
-                            1 *                                 //
-                            fe_values.JxW(q_index));
+            cell_rhs(i) += (fe_values.shape_value(i, q_index) * // phi_i(x_q)
+                            1 *                                 // f(x_q)
+                            fe_values.JxW(q_index));            // dx
         }
       // Now that we have the contribution of this cell, we have to transfer
       // it to the global matrix and right hand side. To this end, we first

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.