Skip to content

Commit

Permalink
Merge pull request #12656 from bangerth/increment
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Aug 16, 2021
2 parents 80d3b4f + 168a1b5 commit 6dce9bf
Show file tree
Hide file tree
Showing 367 changed files with 1,166 additions and 1,166 deletions.
12 changes: 6 additions & 6 deletions examples/step-18/doc/results.dox
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ general approach to this would go like this:
local_history_values_at_qpoints (dim, std::vector< Vector<double> >(dim)),
local_history_fe_values (dim, std::vector< Vector<double> >(dim));

for (unsigned int i=0; i<dim; i++)
for (unsigned int j=0; j<dim; j++)
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
history_field[i][j].reinit(history_dof_handler.n_dofs());
local_history_values_at_qpoints[i][j].reinit(quadrature.size());
Expand Down Expand Up @@ -557,8 +557,8 @@ general approach to this would go like this:
Assert (local_quadrature_points_history < &quadrature_point_history.back(),
ExcInternalError());

for (unsigned int i=0; i<dim; i++)
for (unsigned int j=0; j<dim; j++)
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
for (unsigned int q=0; q<quadrature.size(); ++q)
local_history_values_at_qpoints[i][j](q)
Expand Down Expand Up @@ -602,8 +602,8 @@ general approach to this would go like this:
Assert (local_quadrature_points_history < &quadrature_point_history.back(),
ExcInternalError());

for (unsigned int i=0; i<dim; i++)
for (unsigned int j=0; j<dim; j++)
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
{
dg_cell->get_dof_values (history_field[i][j],
local_history_fe_values[i][j]);
Expand Down
2 changes: 1 addition & 1 deletion examples/step-29/step-29.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ namespace Step29
// should return the <i>square</i> of the absolute value --
// thereby not satisfying the properties mathematicians require of
// something called a "norm".)
for (unsigned int i = 0; i < computed_quantities.size(); i++)
for (unsigned int i = 0; i < computed_quantities.size(); ++i)
{
Assert(computed_quantities[i].size() == 1,
ExcDimensionMismatch(computed_quantities[i].size(), 1));
Expand Down
18 changes: 9 additions & 9 deletions examples/step-33/step-33.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ namespace Step33
const Vector<double> &boundary_values,
const DataVector & Wminus)
{
for (unsigned int c = 0; c < n_components; c++)
for (unsigned int c = 0; c < n_components; ++c)
switch (boundary_kind[c])
{
case inflow_boundary:
Expand Down Expand Up @@ -409,7 +409,7 @@ namespace Step33
// orthogonal to the surface normal. This creates sensitivities
// of across the velocity components.
typename DataVector::value_type vdotn = 0;
for (unsigned int d = 0; d < dim; d++)
for (unsigned int d = 0; d < dim; ++d)
{
vdotn += Wplus[d] * normal_vector[d];
}
Expand Down Expand Up @@ -1257,7 +1257,7 @@ namespace Step33
{
std::vector<std::string> expressions(EulerEquations<dim>::n_components,
"0.0");
for (unsigned int di = 0; di < EulerEquations<dim>::n_components; di++)
for (unsigned int di = 0; di < EulerEquations<dim>::n_components; ++di)
expressions[di] =
prm.get("w_" + Utilities::int_to_string(di) + " value");
initial_conditions.initialize(
Expand Down Expand Up @@ -1756,7 +1756,7 @@ namespace Step33
W_old[q][c] +=
old_solution(dof_indices[i]) * fe_v.shape_value_component(i, q, c);

for (unsigned int d = 0; d < dim; d++)
for (unsigned int d = 0; d < dim; ++d)
{
grad_W[q][c][d] += independent_local_dof_values[i] *
fe_v.shape_grad_component(i, q, c)[d];
Expand Down Expand Up @@ -1855,14 +1855,14 @@ namespace Step33
fe_v.shape_value_component(i, point, component_i) *
fe_v.JxW(point);

for (unsigned int d = 0; d < dim; d++)
for (unsigned int d = 0; d < dim; ++d)
R_i -=
(parameters.theta * flux[point][component_i][d] +
(1.0 - parameters.theta) * flux_old[point][component_i][d]) *
fe_v.shape_grad_component(i, point, component_i)[d] *
fe_v.JxW(point);

for (unsigned int d = 0; d < dim; d++)
for (unsigned int d = 0; d < dim; ++d)
R_i +=
1.0 *
std::pow(fe_v.get_cell()->diameter(),
Expand Down Expand Up @@ -1923,14 +1923,14 @@ namespace Step33
const unsigned int n_independent_variables =
(external_face == false ? 2 * dofs_per_cell : dofs_per_cell);

for (unsigned int i = 0; i < dofs_per_cell; i++)
for (unsigned int i = 0; i < dofs_per_cell; ++i)
{
independent_local_dof_values[i] = current_solution(dof_indices[i]);
independent_local_dof_values[i].diff(i, n_independent_variables);
}

if (external_face == false)
for (unsigned int i = 0; i < dofs_per_cell; i++)
for (unsigned int i = 0; i < dofs_per_cell; ++i)
{
independent_neighbor_dof_values[i] =
current_solution(dof_indices_neighbor[i]);
Expand Down Expand Up @@ -2012,7 +2012,7 @@ namespace Step33
parameters.boundary_conditions[boundary_id].values.vector_value_list(
fe_v.get_quadrature_points(), boundary_values);

for (unsigned int q = 0; q < n_q_points; q++)
for (unsigned int q = 0; q < n_q_points; ++q)
{
EulerEquations<dim>::compute_Wminus(
parameters.boundary_conditions[boundary_id].kind,
Expand Down
2 changes: 1 addition & 1 deletion examples/step-41/step-41.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ namespace Step41
mass_matrix.reinit(dsp);
assemble_mass_matrix_diagonal(mass_matrix);
diagonal_of_mass_matrix.reinit(solution_index_set);
for (unsigned int j = 0; j < solution.size(); j++)
for (unsigned int j = 0; j < solution.size(); ++j)
diagonal_of_mass_matrix(j) = mass_matrix.diag_element(j);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/step-57/step-57.cc
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ namespace Step57
VectorTools::point_value(dof_handler, present_solution, p, tmp_vector);
f << p(dim - 1);

for (int j = 0; j < dim; j++)
for (int j = 0; j < dim; ++j)
f << " " << tmp_vector(j);
f << std::endl;
}
Expand Down
8 changes: 4 additions & 4 deletions examples/step-62/step-62.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ namespace step62
// height="200" />
// where the brown color represents material_a and the green color
// represents material_b.
for (unsigned int idx = 0; idx < nb_mirror_pairs; idx++)
for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
{
const double layer_transition_center =
material_a_wavelength / 2 +
Expand All @@ -586,7 +586,7 @@ namespace step62
// [subpixel
// smoothing](https://meep.readthedocs.io/en/latest/Subpixel_Smoothing/)
// which improves the precision of the simulation.
for (unsigned int idx = 0; idx < nb_mirror_pairs; idx++)
for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
{
const double layer_transition_center =
material_a_wavelength / 2 +
Expand All @@ -612,7 +612,7 @@ namespace step62
}

// the material_a layers
for (unsigned int idx = 0; idx < nb_mirror_pairs; idx++)
for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
{
const double layer_center =
material_a_wavelength / 2 +
Expand All @@ -627,7 +627,7 @@ namespace step62
}

// the material_b layers
for (unsigned int idx = 0; idx < nb_mirror_pairs; idx++)
for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
{
const double layer_center =
material_a_wavelength / 2 +
Expand Down
2 changes: 1 addition & 1 deletion examples/step-75/step-75.cc
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ namespace Step75
MGLevelObject<typename SmootherType::AdditionalData> smoother_data(
min_level, max_level);

for (unsigned int level = min_level; level <= max_level; level++)
for (unsigned int level = min_level; level <= max_level; ++level)
{
smoother_data[level].preconditioner =
std::make_shared<SmootherPreconditionerType>();
Expand Down
2 changes: 1 addition & 1 deletion examples/step-78/step-78.cc
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ namespace BlackScholesSolver
Vector<double> vmult_result;
Vector<double> forcing_terms;

for (unsigned int cycle = 0; cycle < n_cycles; cycle++)
for (unsigned int cycle = 0; cycle < n_cycles; ++cycle)
{
if (cycle != 0)
{
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/base/geometry_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -4716,7 +4716,7 @@ inline Point<dim, Number>
GeometryInfo<dim>::project_to_unit_cell(const Point<dim, Number> &q)
{
Point<dim, Number> p;
for (unsigned int i = 0; i < dim; i++)
for (unsigned int i = 0; i < dim; ++i)
p[i] = std::min(std::max(q[i], Number(0.)), Number(1.));

return p;
Expand All @@ -4730,7 +4730,7 @@ GeometryInfo<dim>::distance_to_unit_cell(const Point<dim> &p)
{
double result = 0.0;

for (unsigned int i = 0; i < dim; i++)
for (unsigned int i = 0; i < dim; ++i)
{
result = std::max(result, -p[i]);
result = std::max(result, p[i] - 1.);
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/mpi_compute_index_owner_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ namespace Utilities
Assert(recv_indices[other_rank].size() == recv_buffer.size(),
ExcMessage("Sizes do not match!"));

for (unsigned int j = 0; j < recv_indices[other_rank].size(); j++)
for (unsigned int j = 0; j < recv_indices[other_rank].size(); ++j)
owning_ranks[recv_indices[other_rank][j]] = recv_buffer[j];
}

Expand Down
10 changes: 5 additions & 5 deletions include/deal.II/base/mpi_consensus_algorithms.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ namespace Utilities

{
// 4) send and receive
for (unsigned int i = 0; i < n_targets; i++)
for (unsigned int i = 0; i < n_targets; ++i)
{
const unsigned int rank = targets[i];
const unsigned int index = i;
Expand Down Expand Up @@ -365,7 +365,7 @@ namespace Utilities

// unpack data
{
for (unsigned int i = 0; i < targets.size(); i++)
for (unsigned int i = 0; i < targets.size(); ++i)
this->process.read_answer(targets[i], recv_buffers[i]);
}
#endif
Expand All @@ -392,7 +392,7 @@ namespace Utilities
const unsigned int n_requests = start_communication();

// 2) answer requests
for (unsigned int request = 0; request < n_requests; request++)
for (unsigned int request = 0; request < n_requests; ++request)
answer_requests(request);

// 3) process answers
Expand Down Expand Up @@ -494,7 +494,7 @@ namespace Utilities
requests_buffers.resize(n_sources);

// 4) send and receive
for (unsigned int i = 0; i < n_targets; i++)
for (unsigned int i = 0; i < n_targets; ++i)
{
const unsigned int rank = targets[i];

Expand Down Expand Up @@ -556,7 +556,7 @@ namespace Utilities
}

// unpack received data
for (unsigned int i = 0; i < targets.size(); i++)
for (unsigned int i = 0; i < targets.size(); ++i)
this->process.read_answer(targets[i], recv_buffers[i]);
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace Utilities

// post recv
AssertIndexRange(recv_ranks.size(), recv_ptr.size());
for (types::global_dof_index i = 0; i < recv_ranks.size(); i++)
for (types::global_dof_index i = 0; i < recv_ranks.size(); ++i)
{
const int ierr =
MPI_Irecv(buffers.data() + recv_ptr[i],
Expand All @@ -119,7 +119,7 @@ namespace Utilities

// post send
AssertIndexRange(send_ranks.size(), send_ptr.size());
for (types::global_dof_index i = 0, k = 0; i < send_ranks.size(); i++)
for (types::global_dof_index i = 0, k = 0; i < send_ranks.size(); ++i)
{
// collect data to be send
for (types::global_dof_index j = send_ptr[i]; j < send_ptr[i + 1];
Expand Down Expand Up @@ -164,7 +164,7 @@ namespace Utilities
Assert(false, ExcNeedsMPI());
#else
// receive all data packages and copy data from buffers
for (types::global_dof_index proc = 0; proc < recv_ranks.size(); proc++)
for (types::global_dof_index proc = 0; proc < recv_ranks.size(); ++proc)
{
int i;
MPI_Status status;
Expand Down
8 changes: 4 additions & 4 deletions include/deal.II/base/partitioner.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace Utilities
n_ghost_indices() :
ghost_array.data();

for (unsigned int i = 0; i < n_ghost_targets; i++)
for (unsigned int i = 0; i < n_ghost_targets; ++i)
{
// allow writing into ghost indices even though we are in a
// const function
Expand Down Expand Up @@ -117,7 +117,7 @@ namespace Utilities
initialize_import_indices_plain_dev();
# endif

for (unsigned int i = 0; i < n_import_targets; i++)
for (unsigned int i = 0; i < n_import_targets; ++i)
{
# if defined(DEAL_II_COMPILER_CUDA_AWARE) && \
defined(DEAL_II_MPI_WITH_CUDA_SUPPORT)
Expand Down Expand Up @@ -315,7 +315,7 @@ namespace Utilities

// initiate the receive operations
Number *temp_array_ptr = temporary_storage.data();
for (unsigned int i = 0; i < n_import_targets; i++)
for (unsigned int i = 0; i < n_import_targets; ++i)
{
AssertThrow(
static_cast<std::size_t>(import_targets_data[i].second) *
Expand All @@ -342,7 +342,7 @@ namespace Utilities
// move the data to send to the front of the array
AssertIndexRange(n_ghost_indices(), n_ghost_indices_in_larger_set + 1);
Number *ghost_array_ptr = ghost_array.data();
for (unsigned int i = 0; i < n_ghost_targets; i++)
for (unsigned int i = 0; i < n_ghost_targets; ++i)
{
// in case we only sent a subset of indices, we now need to move the
// data to the correct positions and delete the old content
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/polynomials_pyramid.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ScalarLagrangePolynomialPyramid<dim>::compute_derivative(
Assert(order == 1, ExcNotImplemented());
const auto grad = compute_grad(i, p);

for (unsigned int i = 0; i < dim; i++)
for (unsigned int i = 0; i < dim; ++i)
der[i] = grad[i];

return der;
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/polynomials_wedge.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ScalarLagrangePolynomialWedge<dim>::compute_derivative(
AssertDimension(order, 1);
const auto grad = compute_grad(i, p);

for (unsigned int i = 0; i < dim; i++)
for (unsigned int i = 0; i < dim; ++i)
der[i] = grad[i];

return der;
Expand Down

0 comments on commit 6dce9bf

Please sign in to comment.