From: Daniel Arndt Date: Sat, 16 Jun 2018 09:07:36 +0000 (+0200) Subject: Indent step-45 X-Git-Tag: v9.1.0-rc1~995^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01a6b18198d4a59057f68e2dc77b767bedf230dd;p=dealii.git Indent step-45 --- diff --git a/examples/step-45/doc/intro.dox b/examples/step-45/doc/intro.dox index ada974649c..8ac06e13fd 100644 --- a/examples/step-45/doc/intro.dox +++ b/examples/step-45/doc/intro.dox @@ -111,7 +111,7 @@ Here, again, the assignment of boundary indicators 0 and 1 stems from what GridGenerator::parallelogram() documents. The resulting @p matched_pairs can be used in -DoFTools::make_periodicity_constraints for populating a ConstraintMatrix +DoFTools::make_periodicity_constraints for populating a AffineConstraints with periodicity constraints: @code DoFTools::make_periodicity_constraints(matched_pairs, constraints); diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index b46802807a..364c353c8f 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -27,12 +27,10 @@ // In order to implement periodic boundary conditions only two functions // have to be modified: -// - StokesProblem::setup_dofs(): To populate a -// ConstraintMatrix -// object with periodicity constraints -// - StokesProblem::run(): To supply a distributed -// triangulation with -// periodicity information. +// - StokesProblem::setup_dofs(): +// To populate a AffineConstraints object with periodicity constraints +// - StokesProblem::run(): +// To supply a distributed triangulation with periodicity information. // // The rest of the program is identical to step-22, so let us skip this part // and only show these two functions in the following. (The full program can be @@ -45,7 +43,7 @@ #include #include -#include +#include #include #include @@ -328,7 +326,7 @@ namespace Step45 // \quad // b=\begin{pmatrix}0&0\end{pmatrix}. // @f} - // The data structure we are saving the reuslitng information into is here + // The data structure we are saving the resulting information into is here // based on the Triangulation. std::vector::cell_iterator>> @@ -435,9 +433,8 @@ namespace Step45 // DoFHandler@::cell_iterator@> . The periodic boundaries // have the boundary indicators 2 (x=0) and 3 (y=0). All the other // parameters we have set up before. In this case the direction does not - // matter. Due to - // $\text{vertices}_2=R\cdot \text{vertices}_1+b$ this is exactly what we - // want. + // matter. Due to $\text{vertices}_2=R\cdot \text{vertices}_1+b$ this is + // exactly what we want. std::vector< GridTools::PeriodicFacePair::cell_iterator>> periodicity_vector; @@ -452,10 +449,10 @@ namespace Step45 offset, rotation_matrix); - // Next we need to provide information on which vector valued components + // Next, we need to provide information on which vector valued components // of the solution should be rotated. Since we choose here to just // constraint the velocity and this starts at the first component of the - // solution vector we simply insert a 0: + // solution vector, we simply insert a 0: std::vector first_vector_components; first_vector_components.push_back(0); @@ -546,10 +543,7 @@ namespace Step45 std::vector div_phi_u(dofs_per_cell); std::vector phi_p(dofs_per_cell); - 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()) if (cell->is_locally_owned()) { fe_values.reinit(cell); @@ -574,16 +568,18 @@ namespace Step45 for (unsigned int j = 0; j <= i; ++j) { local_matrix(i, j) += - (symgrad_phi_u[i] * symgrad_phi_u[j] - - div_phi_u[i] * phi_p[j] - phi_p[i] * div_phi_u[j] + - phi_p[i] * phi_p[j]) * - fe_values.JxW(q); + (symgrad_phi_u[i] * symgrad_phi_u[j] // diffusion + - div_phi_u[i] * phi_p[j] // pressure force + - phi_p[i] * div_phi_u[j] // divergence + + phi_p[i] * phi_p[j]) // pressure mass + * fe_values.JxW(q); } const unsigned int component_i = fe.system_to_component_index(i).first; - local_rhs(i) += fe_values.shape_value(i, q) * - rhs_values[q](component_i) * fe_values.JxW(q); + local_rhs(i) += fe_values.shape_value(i, q) // + * rhs_values[q](component_i) // + * fe_values.JxW(q); } }