From: Denis Davydov Date: Fri, 22 Jun 2018 20:30:50 +0000 (+0200) Subject: improve indentation of step-36 and minor cleanup X-Git-Tag: v9.1.0-rc1~997^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6804%2Fhead;p=dealii.git improve indentation of step-36 and minor cleanup --- diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index c1df16bc49..5951d7fd28 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -106,7 +106,7 @@ namespace Step36 // had adaptively refined meshes (which we don't have in the current // program). Here, we will store the constraints for boundary nodes // $U_i=0$. - ConstraintMatrix constraints; + AffineConstraints constraints; }; // @sect3{Implementation of the EigenvalueProblem class} @@ -258,12 +258,7 @@ namespace Step36 typename FunctionParser::ConstMap()); std::vector potential_values(n_q_points); - - - typename DoFHandler::active_cell_iterator cell = - dof_handler.begin_active(), - endc = dof_handler.end(); - for (; cell != endc; ++cell) + for (const auto cell : dof_handler.active_cell_iterators()) { fe_values.reinit(cell); cell_stiffness_matrix = 0; @@ -276,17 +271,21 @@ namespace Step36 for (unsigned int i = 0; i < dofs_per_cell; ++i) for (unsigned int j = 0; j < dofs_per_cell; ++j) { - cell_stiffness_matrix(i, j) += - (fe_values.shape_grad(i, q_point) * - fe_values.shape_grad(j, q_point) + - potential_values[q_point] * - fe_values.shape_value(i, q_point) * - fe_values.shape_value(j, q_point)) * - fe_values.JxW(q_point); - - cell_mass_matrix(i, j) += (fe_values.shape_value(i, q_point) * - fe_values.shape_value(j, q_point)) * - fe_values.JxW(q_point); + cell_stiffness_matrix(i, j) += // + (fe_values.shape_grad(i, q_point) * // + fe_values.shape_grad(j, q_point) // + + // + potential_values[q_point] * // + fe_values.shape_value(i, q_point) * // + fe_values.shape_value(j, q_point) // + ) * // + fe_values.JxW(q_point); // + + cell_mass_matrix(i, j) += // + (fe_values.shape_value(i, q_point) * // + fe_values.shape_value(j, q_point) // + ) * // + fe_values.JxW(q_point); // } // Now that we have the local matrix contributions, we transfer them