From: Matthias Maier Date: Fri, 15 Jun 2018 23:01:27 +0000 (-0500) Subject: step-3: make bilinear forms more readable X-Git-Tag: v9.1.0-rc1~981^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ea3e030a30fb54365352365bc31333cd9731579;p=dealii.git step-3: make bilinear forms more readable --- diff --git a/examples/step-3/step-3.cc b/examples/step-3/step-3.cc index f3e64b939b..99b3850451 100644 --- a/examples/step-3/step-3.cc +++ b/examples/step-3/step-3.cc @@ -167,7 +167,8 @@ 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; } @@ -196,7 +197,8 @@ 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. @@ -435,9 +437,9 @@ 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) * // + fe_values.shape_grad(j, q_index) * // + fe_values.JxW(q_index)); // We then do the same thing for the right hand side. Here, // the integral is over the shape function i times the right @@ -445,8 +447,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) * // + 1 * // + fe_values.JxW(q_index)); } // 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