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;
{
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.);
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];
}
{
// 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;
// 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
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
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];
}
// 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
}
// 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],
// 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];
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;
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
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)
// 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) *
// 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
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;
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;
// will end with a single same T object stored in each element of the
// vector:
const auto it = map.find(key);
- for (unsigned int q = 0; q < n_q_points; q++)
+ for (unsigned int q = 0; q < n_q_points; ++q)
it->second[q] = std::make_shared<T>();
}
}
const CellIteratorType &cell_end,
const unsigned int number)
{
- for (CellIteratorType it = cell_start; it != cell_end; it++)
+ for (CellIteratorType it = cell_start; it != cell_end; ++it)
if (it->is_locally_owned())
initialize<T>(it, number);
}
if (it == map.end())
return false;
Assert(&cell->get_triangulation() == tria, ExcTriangulationMismatch());
- for (unsigned int i = 0; i < it->second.size(); i++)
+ for (unsigned int i = 0; i < it->second.size(); ++i)
{
Assert(
it->second[i].unique(),
while (it != map.end())
{
// loop over all objects and see if no one is using them
- for (unsigned int i = 0; i < it->second.size(); i++)
+ for (unsigned int i = 0; i < it->second.size(); ++i)
{
Assert(
it->second[i].unique(),
// fully) specialized. Thus, stick with copying of shared pointers even when
// the T==DataType:
std::vector<std::shared_ptr<T>> res(it->second.size());
- for (unsigned int q = 0; q < res.size(); q++)
+ for (unsigned int q = 0; q < res.size(); ++q)
{
res[q] = std::dynamic_pointer_cast<T>(it->second[q]);
Assert(res[q], ExcCellDataTypeMismatch());
// T==DataType as we need to return shared_ptr<const T> to make sure the user
// does not modify the content of QP objects
std::vector<std::shared_ptr<const T>> res(it->second.size());
- for (unsigned int q = 0; q < res.size(); q++)
+ for (unsigned int q = 0; q < res.size(); ++q)
{
res[q] = std::dynamic_pointer_cast<const T>(it->second[q]);
Assert(res[q], ExcCellDataTypeMismatch());
// shared_ptr<const T> to make sure the user
// does not modify the content of QP objects
std::vector<std::shared_ptr<T>> result(it->second.size());
- for (unsigned int q = 0; q < result.size(); q++)
+ for (unsigned int q = 0; q < result.size(); ++q)
{
result[q] = std::dynamic_pointer_cast<T>(it->second[q]);
Assert(result[q], ExcCellDataTypeMismatch());
// shared_ptr<const T> to make sure the user
// does not modify the content of QP objects
std::vector<std::shared_ptr<const T>> result(it->second.size());
- for (unsigned int q = 0; q < result.size(); q++)
+ for (unsigned int q = 0; q < result.size(); ++q)
{
result[q] = std::dynamic_pointer_cast<const T>(it->second[q]);
Assert(result[q], ExcCellDataTypeMismatch());
// Make the first row and column to be of the
// desired form
h = 0.0;
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
h += A[0][i] * A[0][i];
g = 0.0;
e[0] = g;
std::array<Number, dim> u;
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
{
u[i] = A[0][i];
if (i == 1)
{
omega_inv = 1.0 / omega;
K = 0.0;
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
{
f = 0.0;
- for (int j = 1; j < dim; j++)
+ for (int j = 1; j < dim; ++j)
f += A[i][j] * u[j];
q[i] = omega_inv * f;
K += u[i] * f;
}
K *= 0.5 * omega_inv * omega_inv;
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
q[i] = q[i] - K * u[i];
d[0] = A[0][0];
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
d[i] = A[i][i] - 2.0 * q[i] * u[i];
// Store inverse Householder transformation
// in Q
- for (int j = 1; j < dim; j++)
+ for (int j = 1; j < dim; ++j)
{
f = omega_inv * u[j];
- for (int i = 1; i < dim; i++)
+ for (int i = 1; i < dim; ++i)
Q[i][j] = Q[i][j] - f * u[i];
}
// For dim = 3: Calculate updated A[1][2] and
// store it in e[1]
- for (int i = 1; i < dim - 1; i++)
+ for (int i = 1; i < dim - 1; ++i)
e[i] = A[i][i + 1] - q[i] * u[i + 1] - u[i] * q[i + 1];
}
else
{
- for (int i = 0; i < dim; i++)
+ for (int i = 0; i < dim; ++i)
d[i] = A[i][i];
// For dim = 3:
- for (int i = 1; i < dim - 1; i++)
+ for (int i = 1; i < dim - 1; ++i)
e[i] = A[i][i + 1];
}
}
Number g, r, p, f, b, s, c, t;
// Loop over all off-diagonal elements
- for (int l = 0; l < dim - 1; l++)
+ for (int l = 0; l < dim - 1; ++l)
{
for (unsigned int it = 0; it <= max_n_it; ++it)
{
// Check for convergence and exit iteration loop
// if the off-diagonal element e[l] is zero
int m = l;
- for (; m <= dim - 2; m++)
+ for (; m <= dim - 2; ++m)
{
g = std::abs(w[m]) + std::abs(w[m + 1]);
if (std::abs(e[m]) + g == g)
g = c * r - b;
// Form the eigenvectors
- for (int k = 0; k < dim; k++)
+ for (int k = 0; k < dim; ++k)
{
t = Q[k][i + 1];
Q[k][i + 1] = s * Q[k][i] + c * t;
// The diagonal elements of the tridiagonal matrix;
// this will ultimately store the eigenvalues
std::array<Number, dim> w;
- for (int i = 0; i < dim; i++)
+ for (int i = 0; i < dim; ++i)
w[i] = A[i][i];
// Calculate (tr(A))^{2}
// Number of iterations
const unsigned int max_n_it = 50;
- for (unsigned int it = 0; it <= max_n_it; it++)
+ for (unsigned int it = 0; it <= max_n_it; ++it)
{
// Test for convergence
so = 0.0;
- for (int p = 0; p < dim; p++)
- for (int q = p + 1; q < dim; q++)
+ for (int p = 0; p < dim; ++p)
+ for (int q = p + 1; q < dim; ++q)
so += std::abs(A[p][q]);
if (so == 0.0)
break;
thresh = 0.0;
// Perform sweep
- for (int p = 0; p < dim; p++)
- for (int q = p + 1; q < dim; q++)
+ for (int p = 0; p < dim; ++p)
+ for (int q = p + 1; q < dim; ++q)
{
g = 100.0 * std::abs(A[p][q]);
w[p] -= z;
w[q] += z;
// ... by executing the various rotations in sequence
- for (int r = 0; r < p; r++)
+ for (int r = 0; r < p; ++r)
{
t = A[r][p];
A[r][p] = c * t - s * A[r][q];
A[r][q] = s * t + c * A[r][q];
}
- for (int r = p + 1; r < q; r++)
+ for (int r = p + 1; r < q; ++r)
{
t = A[p][r];
A[p][r] = c * t - s * A[r][q];
A[r][q] = s * t + c * A[r][q];
}
- for (int r = q + 1; r < dim; r++)
+ for (int r = q + 1; r < dim; ++r)
{
t = A[p][r];
A[p][r] = c * t - s * A[q][r];
}
// Update the eigenvectors
- for (int r = 0; r < dim; r++)
+ for (int r = 0; r < dim; ++r)
{
t = Q[r][p];
Q[r][p] = c * t - s * Q[r][q];
else // This is the standard branch
{
norm = std::sqrt(1.0 / norm);
- for (unsigned j = 0; j < dim; j++)
+ for (unsigned j = 0; j < dim; ++j)
Q[j][0] = Q[j][0] * norm;
}
else
{
norm = std::sqrt(1.0 / norm);
- for (unsigned int j = 0; j < dim; j++)
+ for (unsigned int j = 0; j < dim; ++j)
Q[j][1] = Q[j][1] * norm;
}
const std::array<Number *, width> &ptrs,
const unsigned int offset)
{
- for (unsigned int v = 0; v < width; v++)
+ for (unsigned int v = 0; v < width; ++v)
out.data[v] = ptrs[v][offset];
}
std::pair<bool, unsigned int>(const TableIndices<1> &)> &predicate,
std::map<unsigned int, std::vector<CoefficientType>> & pred_to_values)
{
- for (unsigned int i = 0; i < coefficients.size(0); i++)
+ for (unsigned int i = 0; i < coefficients.size(0); ++i)
{
const TableIndices<1> ind(i);
fill_map_index(coefficients, ind, predicate, pred_to_values);
std::pair<bool, unsigned int>(const TableIndices<2> &)> &predicate,
std::map<unsigned int, std::vector<CoefficientType>> & pred_to_values)
{
- for (unsigned int i = 0; i < coefficients.size(0); i++)
- for (unsigned int j = 0; j < coefficients.size(1); j++)
+ for (unsigned int i = 0; i < coefficients.size(0); ++i)
+ for (unsigned int j = 0; j < coefficients.size(1); ++j)
{
const TableIndices<2> ind(i, j);
fill_map_index(coefficients, ind, predicate, pred_to_values);
std::pair<bool, unsigned int>(const TableIndices<3> &)> &predicate,
std::map<unsigned int, std::vector<CoefficientType>> & pred_to_values)
{
- for (unsigned int i = 0; i < coefficients.size(0); i++)
- for (unsigned int j = 0; j < coefficients.size(1); j++)
- for (unsigned int k = 0; k < coefficients.size(2); k++)
+ for (unsigned int i = 0; i < coefficients.size(0); ++i)
+ for (unsigned int j = 0; j < coefficients.size(1); ++j)
+ for (unsigned int k = 0; k < coefficients.size(2); ++k)
{
const TableIndices<3> ind(i, j, k);
fill_map_index(coefficients, ind, predicate, pred_to_values);
unsigned int n_components = 0;
// Get the number of components from the first given finite element.
- for (unsigned int i = 0; i < fes.size(); i++)
+ for (unsigned int i = 0; i < fes.size(); ++i)
if (multiplicities[i] > 0)
{
n_components = fes[i]->n_components();
break;
}
- for (unsigned int i = 0; i < fes.size(); i++)
+ for (unsigned int i = 0; i < fes.size(); ++i)
if (multiplicities[i] > 0)
{
// TODO: the implementation makes the assumption that all faces have
std::vector<std::pair<T, unsigned int>> neighbors(n_faces, {-1, -1});
// loop over all cells
- for (unsigned int i_0 = 0; i_0 < ptr_cf.size() - 1; i_0++)
+ for (unsigned int i_0 = 0; i_0 < ptr_cf.size() - 1; ++i_0)
{
// ... and all its faces
- for (std::size_t j_0 = ptr_cf[i_0]; j_0 < ptr_cf[i_0 + 1]; j_0++)
+ for (std::size_t j_0 = ptr_cf[i_0]; j_0 < ptr_cf[i_0 + 1]; ++j_0)
{
if (neighbors[col_cf[j_0]].first == static_cast<unsigned int>(-1))
{
static const unsigned int offset = 1;
// loop over all cells
- for (unsigned int c = 0, counter = 0; c < cell_types_index.size(); c++)
+ for (unsigned int c = 0, counter = 0; c < cell_types_index.size(); ++c)
{
const auto &cell_type =
cell_types[static_cast<types::geometric_entity_type>(
cell_vertices.data() + cell_ptr[c], cell_ptr[c + 1] - cell_ptr[c]);
// ... loop over all its entities
- for (unsigned int e = 0; e < cell_type->n_entities(d); e++)
+ for (unsigned int e = 0; e < cell_type->n_entities(d); ++e)
{
// ... determine global entity vertices
const auto &local_entity_vertices =
std::array<unsigned int, key_length> entity_vertices;
std::fill(entity_vertices.begin(), entity_vertices.end(), 0);
- for (unsigned int i = 0; i < local_entity_vertices.size(); i++)
+ for (unsigned int i = 0; i < local_entity_vertices.size(); ++i)
entity_vertices[i] =
cell_vertice[local_entity_vertices[i]] + offset;
{
const auto &cell_type =
cell_types[static_cast<types::geometric_entity_type>(c)];
- for (unsigned int e = 0; e < cell_type->n_entities(d); e++)
+ for (unsigned int e = 0; e < cell_type->n_entities(d); ++e)
key_length =
std::max(key_length, cell_type->vertices_of_entity(d, e).size());
}
step = length / 2;
while (step > 0)
{
- for (i = step; i < length; i++)
+ for (i = step; i < length; ++i)
{
istep = step;
j = i;
average_diagonal = static_cast<number>(1.);
}
- for (size_type i = 0; i < global_rows.n_constraints(); i++)
+ for (size_type i = 0; i < global_rows.n_constraints(); ++i)
{
const size_type local_row = global_rows.constraint_origin(i);
const size_type global_row = local_dof_indices[local_row];
// that have been left out above
if (global_rows.n_constraints() > 0)
{
- for (size_type i = 0; i < global_rows.n_constraints(); i++)
+ for (size_type i = 0; i < global_rows.n_constraints(); ++i)
{
const size_type local_row = global_rows.constraint_origin(i);
const size_type global_row = local_dof_indices[local_row];
// need to add the whole row and column structure in case we keep
// constrained entries. Unfortunately, we can't use the nice matrix
// structure we use elsewhere, so manually add those indices one by one.
- for (size_type i = 0; i < n_local_dofs; i++)
+ for (size_type i = 0; i < n_local_dofs; ++i)
if (is_constrained(local_dof_indices[i]))
{
if (keep_constrained_entries == true)
- for (size_type j = 0; j < n_local_dofs; j++)
+ for (size_type j = 0; j < n_local_dofs; ++j)
{
sparsity_pattern.add(local_dof_indices[i],
local_dof_indices[j]);
}
}
- for (size_type i = 0; i < n_local_dofs; i++)
+ for (size_type i = 0; i < n_local_dofs; ++i)
if (is_constrained(local_dof_indices[i]))
{
if (keep_constrained_entries == true)
- for (size_type j = 0; j < n_local_dofs; j++)
+ for (size_type j = 0; j < n_local_dofs; ++j)
{
sparsity_pattern.add(local_dof_indices[i],
local_dof_indices[j]);
// Main loop
int iter = 0;
- for (; conv == SolverControl::iterate; iter++)
+ for (; conv == SolverControl::iterate; ++iter)
{
y.add(additional_data.shift, x);
// Main loop
double res = std::numeric_limits<double>::lowest();
size_type iter = 0;
- for (; conv == SolverControl::iterate; iter++)
+ for (; conv == SolverControl::iterate; ++iter)
{
solver.solve(A_s, y, x, prec);
{
Assert(m == n, ExcDimensionMismatch(m, n));
- for (unsigned int i = 0; i < m; i++)
- for (unsigned int j = i; j < n; j++)
+ for (unsigned int i = 0; i < m; ++i)
+ for (unsigned int j = i; j < n; ++j)
matrix(i, j) = this->block(i).inner_product_local(V.block(j));
- for (unsigned int i = 0; i < m; i++)
- for (unsigned int j = i + 1; j < n; j++)
+ for (unsigned int i = 0; i < m; ++i)
+ for (unsigned int j = i + 1; j < n; ++j)
matrix(j, i) = matrix(i, j);
}
else
{
Assert(m == n, ExcDimensionMismatch(m, n));
- for (unsigned int i = 0; i < m; i++)
+ for (unsigned int i = 0; i < m; ++i)
{
res +=
matrix(i, i) * this->block(i).inner_product_local(V.block(i));
- for (unsigned int j = i + 1; j < n; j++)
+ for (unsigned int j = i + 1; j < n; ++j)
res += 2. * matrix(i, j) *
this->block(i).inner_product_local(V.block(j));
}
}
else
{
- for (unsigned int i = 0; i < m; i++)
- for (unsigned int j = 0; j < n; j++)
+ for (unsigned int i = 0; i < m; ++i)
+ for (unsigned int j = 0; j < n; ++j)
res +=
matrix(i, j) * this->block(i).inner_product_local(V.block(j));
}
Assert(matrix.m() == m, ExcDimensionMismatch(matrix.m(), m));
Assert(matrix.n() == n, ExcDimensionMismatch(matrix.n(), n));
- for (unsigned int i = 0; i < n; i++)
+ for (unsigned int i = 0; i < n; ++i)
{
// below we make this work gracefully for identity-like matrices in
// which case the two loops over j won't do any work as A(j,i)==0
const unsigned int k = std::min(i, m - 1);
V.block(i).sadd_local(s, matrix(k, i) * b, this->block(k));
- for (unsigned int j = 0; j < k; j++)
+ for (unsigned int j = 0; j < k; ++j)
V.block(i).add_local(matrix(j, i) * b, this->block(j));
- for (unsigned int j = k + 1; j < m; j++)
+ for (unsigned int j = k + 1; j < m; ++j)
V.block(i).add_local(matrix(j, i) * b, this->block(j));
}
if (V.block(0).vector_is_ghosted)
{
- for (unsigned int i = 0; i < n; i++)
+ for (unsigned int i = 0; i < n; ++i)
Assert(V.block(i).vector_is_ghosted,
ExcMessage(
"All blocks should be either in ghosted state or not."));
s, sizeof(Number), info, comm_shared, &data_this, &mpi_window);
AssertThrowMPI(ierr);
- for (unsigned int i = 0; i < size_sm; i++)
+ for (unsigned int i = 0; i < size_sm; ++i)
{
int disp_unit;
MPI_Aint ssize;
comm_shared);
AssertThrowMPI(ierr);
- for (unsigned int i = 0; i < size_sm; i++)
+ for (unsigned int i = 0; i < size_sm; ++i)
others[i] += n_align_sm[i];
std::vector<unsigned int> new_alloc_sizes(size_sm);
AssertThrowMPI(ierr);
data.values_sm.resize(size_sm);
- for (unsigned int i = 0; i < size_sm; i++)
+ for (unsigned int i = 0; i < size_sm; ++i)
data.values_sm[i] =
ArrayView<const Number>(others[i], new_alloc_sizes[i]);
// turn
#ifdef DEAL_II_WITH_MPI
if (partitioner->n_mpi_processes() > 1)
- for (unsigned int i = 0; i < partitioner->this_mpi_process(); i++)
+ for (unsigned int i = 0; i < partitioner->this_mpi_process(); ++i)
{
const int ierr = MPI_Barrier(partitioner->get_mpi_communicator());
AssertThrowMPI(ierr);
{
std::vector<Vec> vecs(this_initial_space.size());
- for (unsigned int i = 0; i < this_initial_space.size(); i++)
+ for (unsigned int i = 0; i < this_initial_space.size(); ++i)
{
Assert(this_initial_space[i].l2_norm() > 0.0,
ExcMessage("Initial vectors should be nonzero."));
Vector<double> &si,
int col) const
{
- for (int i = 0; i < col; i++)
+ for (int i = 0; i < col; ++i)
{
const double s = si(i);
const double c = ci(i);
int iter = 0;
// Main loop
- for (; conv == SolverControl::iterate; iter++)
+ for (; conv == SolverControl::iterate; ++iter)
{
// Compute residual
A.vmult(r, x);
else
inner_cells.emplace_back(cell);
}
- for (unsigned i = 0; i < inner_cells.size(); i++)
+ for (unsigned i = 0; i < inner_cells.size(); ++i)
if (i < inner_cells.size() / 2)
graph[0].emplace_back(inner_cells[i]);
else
switch (dim)
{
case 1:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (evaluation_flag & EvaluationFlags::values)
eval.template values<0, true, false>(values_dofs, values_quad);
break;
case 2:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
// grad x
if (evaluation_flag & EvaluationFlags::gradients)
break;
case 3:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (evaluation_flag & EvaluationFlags::gradients)
{
switch (dim)
{
case 1:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (integration_flag & EvaluationFlags::values)
{
break;
case 2:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if ((integration_flag & EvaluationFlags::values) &&
!(integration_flag & EvaluationFlags::gradients))
break;
case 3:
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if ((integration_flag & EvaluationFlags::values) &&
!(integration_flag & EvaluationFlags::gradients))
shape_info.data.front().shape_hessians_collocation_eo);
constexpr unsigned int n_q_points = Utilities::pow(fe_degree + 1, dim);
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (evaluation_flag & EvaluationFlags::values)
for (unsigned int i = 0; i < n_q_points; ++i)
constexpr unsigned int n_q_points = Utilities::pow(fe_degree + 1, dim);
constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (integration_flag & EvaluationFlags::values)
{
"operation."));
constexpr unsigned int n_q_points = Utilities::pow(n_q_points_1d, dim);
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
FEEvaluationImplBasisChange<
evaluate_evenodd,
constexpr unsigned int n_q_points = Utilities::pow(n_q_points_1d, dim);
constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
// apply derivatives in collocation space
if (integration_flag &
dofs_per_component_on_face :
dofs_per_component_on_cell;
- for (unsigned int c = 0; c < n_components; c++)
+ for (unsigned int c = 0; c < n_components; ++c)
{
if (do_hessians)
evalf.template apply_face<face_direction,
{
std::vector<IndexSet> locally_owned_set;
locally_owned_set.reserve(dofh.size());
- for (unsigned int j = 0; j < dofh.size(); j++)
+ for (unsigned int j = 0; j < dofh.size(); ++j)
if (level == numbers::invalid_unsigned_int)
locally_owned_set.push_back(dofh[j]->locally_owned_dofs());
else
n_components(const std::vector<VectorStruct> &vec)
{
unsigned int components = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
components += n_components_block(
vec[comp],
std::integral_constant<bool, IsBlockVector<VectorStruct>::value>());
n_components(const std::vector<VectorStruct *> &vec)
{
unsigned int components = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
components += n_components_block(
*vec[comp],
std::integral_constant<bool, IsBlockVector<VectorStruct>::value>());
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
update_ghost_values_start(vec[comp], exchanger, component_index);
component_index += n_components(vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
update_ghost_values_start(*vec[comp], exchanger, component_index);
component_index += n_components(*vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
update_ghost_values_finish(vec[comp], exchanger, component_index);
component_index += n_components(vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
update_ghost_values_finish(*vec[comp], exchanger, component_index);
component_index += n_components(*vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
compress_start(vec[comp], exchanger, component_index);
component_index += n_components(vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
compress_start(*vec[comp], exchanger, component_index);
component_index += n_components(*vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
compress_finish(vec[comp], exchanger, component_index);
component_index += n_components(vec[comp]);
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
unsigned int component_index = 0;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
{
compress_finish(*vec[comp], exchanger, component_index);
component_index += n_components(*vec[comp]);
if (exchanger.ghosts_were_set == true)
return;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
reset_ghost_values(vec[comp], exchanger);
}
if (exchanger.ghosts_were_set == true)
return;
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
reset_ghost_values(*vec[comp], exchanger);
}
std::vector<VectorStruct> & vec,
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
zero_vector_region(range_index, vec[comp], exchanger);
}
std::vector<VectorStruct *> & vec,
VectorDataExchange<dim, Number, VectorizedArrayType> &exchanger)
{
- for (unsigned int comp = 0; comp < vec.size(); comp++)
+ for (unsigned int comp = 0; comp < vec.size(); ++comp)
zero_vector_region(range_index, *vec[comp], exchanger);
}
n_quad_in_collection = std::max(n_quad_in_collection, quad[q].size());
shape_info.reinit(TableIndices<4>(
n_components, n_quad, n_fe_in_collection, n_quad_in_collection));
- for (unsigned int no = 0, c = 0; no < dof_handler.size(); no++)
+ for (unsigned int no = 0, c = 0; no < dof_handler.size(); ++no)
for (unsigned int b = 0; b < dof_handler[no]->get_fe(0).n_base_elements();
++b, ++c)
for (unsigned int fe_no = 0;
fe_no < dof_handler[no]->get_fe_collection().size();
++fe_no)
- for (unsigned int nq = 0; nq < n_quad; nq++)
+ for (unsigned int nq = 0; nq < n_quad; ++nq)
for (unsigned int q_no = 0; q_no < quad[nq].size(); ++q_no)
shape_info(c, nq, fe_no, q_no)
.reinit(quad[nq][q_no], dof_handler[no]->get_fe(fe_no), b);
.push_back(renumbering[counter]);
}
counter = 0;
- for (unsigned int j = 0; j < dof_info[0].max_fe_index; j++)
+ for (unsigned int j = 0; j < dof_info[0].max_fe_index; ++j)
{
for (const auto jj : renumbering_fe_index[j])
renumbering[counter++] = jj;
.push_back(renumbering[counter]);
}
counter = start_nonboundary * n_lanes;
- for (unsigned int j = 0; j < dof_info[0].max_fe_index; j++)
+ for (unsigned int j = 0; j < dof_info[0].max_fe_index; ++j)
{
for (const auto jj : renumbering_fe_index[j])
renumbering[counter++] = jj;
{
Quadrature<dim> quad(QGauss<dim>(1));
Quadrature<dim> quad_simplex(QGaussSimplex<dim>(1));
- for (unsigned int no = 0, c = 0; no < dof_handlers.size(); no++)
+ for (unsigned int no = 0, c = 0; no < dof_handlers.size(); ++no)
for (unsigned int b = 0;
b < dof_handlers[no]->get_fe(0).n_base_elements();
++b, ++c)
const auto to_category = [&](const auto &cell) {
unsigned int c_num = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; i++)
+ for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
{
auto &face = *cell->face(i);
if (face.at_boundary() && !cell->has_periodic_neighbor(i))
std::vector<unsigned int *> level_dof_indices_fine_(
fe_index_pairs.size());
- for (unsigned int i = 0; i < fe_index_pairs.size(); i++)
+ for (unsigned int i = 0; i < fe_index_pairs.size(); ++i)
{
level_dof_indices_coarse_[i] =
transfer.schemes[i].level_dof_indices_coarse.data();
fe_index_pairs.size());
std::vector<Number *> weights_(fe_index_pairs.size());
- for (unsigned int i = 0; i < fe_index_pairs.size(); i++)
+ for (unsigned int i = 0; i < fe_index_pairs.size(); ++i)
{
level_dof_indices_fine_[i] =
&transfer.schemes[i].level_dof_indices_fine[0];
fe_patch_values.n_quadrature_points;
std::vector<dealii::Vector<ScalarType>> tmp(n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
tmp[i].reinit(n_components);
fe_patch_values.get_function_values(vector, tmp);
AssertDimension(patch_values_system.size(), n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
{
AssertDimension(patch_values_system[i].size(), n_components);
fe_patch_values.get_function_values(vector, tmp);
- for (unsigned int i = 0; i < tmp.size(); i++)
+ for (unsigned int i = 0; i < tmp.size(); ++i)
patch_values[i] = get_component(tmp[i], extract_component);
}
}
std::vector<std::vector<Tensor<1, spacedim, ScalarType>>> tmp(
n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
tmp[i].resize(n_components);
fe_patch_values.get_function_gradients(vector, tmp);
AssertDimension(patch_gradients_system.size(), n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
{
AssertDimension(patch_gradients_system[i].size(), n_components);
- for (unsigned int j = 0; j < n_components; j++)
+ for (unsigned int j = 0; j < n_components; ++j)
patch_gradients_system[i][j] =
get_component(tmp[i][j], extract_component);
}
fe_patch_values.get_function_gradients(vector, tmp);
- for (unsigned int i = 0; i < tmp.size(); i++)
+ for (unsigned int i = 0; i < tmp.size(); ++i)
patch_gradients[i] = get_component(tmp[i], extract_component);
}
}
std::vector<std::vector<Tensor<2, spacedim, ScalarType>>> tmp(
n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
tmp[i].resize(n_components);
fe_patch_values.get_function_hessians(vector, tmp);
AssertDimension(patch_hessians_system.size(), n_eval_points);
- for (unsigned int i = 0; i < n_eval_points; i++)
+ for (unsigned int i = 0; i < n_eval_points; ++i)
{
AssertDimension(patch_hessians_system[i].size(), n_components);
- for (unsigned int j = 0; j < n_components; j++)
+ for (unsigned int j = 0; j < n_components; ++j)
patch_hessians_system[i][j] =
get_component(tmp[i][j], extract_component);
}
fe_patch_values.get_function_hessians(vector, tmp);
- for (unsigned int i = 0; i < tmp.size(); i++)
+ for (unsigned int i = 0; i < tmp.size(); ++i)
patch_hessians[i] = get_component(tmp[i], extract_component);
}
}
const unsigned int n_eval_points = fe_patch_values.n_quadrature_points;
AssertDimension(patch_values_system.size(), n_eval_points);
- for (unsigned int q = 0; q < n_eval_points; q++)
+ for (unsigned int q = 0; q < n_eval_points; ++q)
{
AssertDimension(patch_values_system[q].size(), n_components);
patch_values_system[q] = 0.0;
local_face_integrals[face] =
integrate_over_face(parallel_data, face, fe_face_values_cell);
- for (unsigned int i = 0; i < local_face_integrals[face].size(); i++)
+ for (unsigned int i = 0; i < local_face_integrals[face].size(); ++i)
local_face_integrals[face][i] *= factor;
}
{
const unsigned int s = vgrads[q].size();
values[maps[i][q]].resize(s);
- for (unsigned int l = 0; l < s; l++)
+ for (unsigned int l = 0; l < s; ++l)
values[maps[i][q]][l] = vgrads[q][l];
}
}
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
cell_point.first->get_dof_indices(local_dof_indices);
- for (unsigned int i = 0; i < dofs_per_cell; i++)
+ for (unsigned int i = 0; i < dofs_per_cell; ++i)
rhs_vector(local_dof_indices[i]) = fe_values.shape_value(i, 0);
}
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
cell_point.first->get_dof_indices(local_dof_indices);
- for (unsigned int i = 0; i < dofs_per_cell; i++)
+ for (unsigned int i = 0; i < dofs_per_cell; ++i)
rhs_vector(local_dof_indices[i]) = fe_values.shape_value(i, 0);
}
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
cell_point.first->get_dof_indices(local_dof_indices);
- for (unsigned int i = 0; i < dofs_per_cell; i++)
+ for (unsigned int i = 0; i < dofs_per_cell; ++i)
rhs_vector(local_dof_indices[i]) =
orientation * fe_values[vec].value(i, 0);
}
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
cell_point.first->get_dof_indices(local_dof_indices);
- for (unsigned int i = 0; i < dofs_per_cell; i++)
+ for (unsigned int i = 0; i < dofs_per_cell; ++i)
rhs_vector(local_dof_indices[i]) =
orientation * fe_values[vec].value(i, 0);
}
A[1][1] = temp;
}
- for (unsigned int k = 0; k < 1; k++)
+ for (unsigned int k = 0; k < 1; ++k)
{
- for (unsigned int i = k + 1; i < 2; i++)
+ for (unsigned int i = k + 1; i < 2; ++i)
{
x = A[i][k] / A[k][k];
- for (unsigned int j = k + 1; j < 2; j++)
+ for (unsigned int j = k + 1; j < 2; ++j)
A[i][j] = A[i][j] - A[k][j] * x;
b[i] = b[i] - b[k] * x;
{
sum = b[i];
- for (unsigned int j = i + 1; j < 2; j++)
+ for (unsigned int j = i + 1; j < 2; ++j)
sum = sum - A[i][j] * b[j];
b[i] = sum / A[i][i];
A[1][1] = temp;
}
- for (unsigned int k = 0; k < 1; k++)
+ for (unsigned int k = 0; k < 1; ++k)
{
- for (unsigned int i = k + 1; i < 2; i++)
+ for (unsigned int i = k + 1; i < 2; ++i)
{
x = A[i][k] / A[k][k];
- for (unsigned int j = k + 1; j < 2; j++)
+ for (unsigned int j = k + 1; j < 2; ++j)
A[i][j] = A[i][j] - A[k][j] * x;
b[i] = b[i] - b[k] * x;
{
sum = b[i];
- for (unsigned int j = i + 1; j < 2; j++)
+ for (unsigned int j = i + 1; j < 2; ++j)
sum = sum - A[i][j] * b[j];
b[i] = sum / A[i][i];
A[1][1] = temp;
}
- for (unsigned int k = 0; k < 1; k++)
+ for (unsigned int k = 0; k < 1; ++k)
{
- for (unsigned int i = k + 1; i < 2; i++)
+ for (unsigned int i = k + 1; i < 2; ++i)
{
x = A[i][k] / A[k][k];
- for (unsigned int j = k + 1; j < 2; j++)
+ for (unsigned int j = k + 1; j < 2; ++j)
A[i][j] = A[i][j] - A[k][j] * x;
b[i] = b[i] - b[k] * x;
{
sum = b[i];
- for (unsigned int j = i + 1; j < 2; j++)
+ for (unsigned int j = i + 1; j < 2; ++j)
sum = sum - A[i][j] * b[j];
b[i] = sum / A[i][i];
additional_width =
static_cast<unsigned int>(.5 + (height / 100.) * 2.5);
- for (unsigned int index = 0; index < 4; index++)
+ for (unsigned int index = 0; index < 4; ++index)
{
double start_h = .667 - ((index + 1) / 4.) * .667;
double stop_h = .667 - (index / 4.) * .667;
<< index << ")\"/>" << '\n';
}
- for (unsigned int index = 0; index < 5; index++)
+ for (unsigned int index = 0; index < 5; ++index)
{
out
<< " <text x=\""
interpolation_values.size()));
// check that input vector @p interpolation_points is provided in ascending order:
- for (unsigned int i = 0; i < interpolation_points.size() - 1; i++)
+ for (unsigned int i = 0; i < interpolation_points.size() - 1; ++i)
AssertThrow(interpolation_points[i] < interpolation_points[i + 1],
ExcCSplineOrder(i,
interpolation_points[i],
const Tensor<1, dim> & in2)
{
if (val != 0.)
- for (unsigned int i = 0; i < dim; i++)
- for (unsigned int j = i; j < dim; j++)
+ for (unsigned int i = 0; i < dim; ++i)
+ for (unsigned int j = i; j < dim; ++j)
out[i][j] += (in1[i] * in2[j] + in1[j] * in2[i]) * val;
}
const Tensor<1, dim> & in)
{
if (val != 0.)
- for (unsigned int i = 0; i < dim; i++)
- for (unsigned int j = i; j < dim; j++)
+ for (unsigned int i = 0; i < dim; ++i)
+ for (unsigned int j = i; j < dim; ++j)
out[i][j] += val * in[i] * in[j];
}
} // namespace
const MinMaxAvg *in_lhs = static_cast<const MinMaxAvg *>(in_lhs_);
MinMaxAvg * inout_rhs = static_cast<MinMaxAvg *>(inout_rhs_);
- for (int i = 0; i < *len; i++)
+ for (int i = 0; i < *len; ++i)
{
inout_rhs[i].sum += in_lhs[i].sum;
if (inout_rhs[i].min > in_lhs[i].min)
if (job_supports_mpi() == false ||
Utilities::MPI::n_mpi_processes(mpi_communicator) <= 1)
{
- for (unsigned int i = 0; i < my_values.size(); i++)
+ for (unsigned int i = 0; i < my_values.size(); ++i)
{
result[i].sum = my_values[i];
result[i].avg = my_values[i];
std::vector<MinMaxAvg> in(my_values.size());
- for (unsigned int i = 0; i < my_values.size(); i++)
+ for (unsigned int i = 0; i < my_values.size(); ++i)
{
in[i].sum = in[i].min = in[i].max = my_values[i];
in[i].min_index = in[i].max_index = my_id;
{
AssertDimension(my_values.size(), result.size());
- for (unsigned int i = 0; i < my_values.size(); i++)
+ for (unsigned int i = 0; i < my_values.size(); ++i)
{
result[i].sum = my_values[i];
result[i].avg = my_values[i];
std::vector<types::global_dof_index> temp_map_send(
index_set_has.n_elements());
- for (types::global_dof_index i = 0; i < indices_has.size(); i++)
+ for (types::global_dof_index i = 0; i < indices_has.size(); ++i)
if (indices_has[i] != numbers::invalid_dof_index)
temp_map_send[index_set_has.index_within_set(indices_has[i])] = i;
std::vector<types::global_dof_index> temp_map_recv(
index_set_want.n_elements());
- for (types::global_dof_index i = 0; i < indices_want.size(); i++)
+ for (types::global_dof_index i = 0; i < indices_want.size(); ++i)
if (indices_want[i] != numbers::invalid_dof_index)
temp_map_recv[index_set_want.index_within_set(indices_want[i])] = i;
for (unsigned int p = 0; p < ghost_targets_data.size(); ++p)
{
unsigned int last_index = numbers::invalid_unsigned_int - 1;
- for (unsigned int ii = 0; ii < ghost_targets_data[p].second; ii++)
+ for (unsigned int ii = 0; ii < ghost_targets_data[p].second; ++ii)
{
const unsigned int i = shift + ii;
if (expanded_numbering[i] == last_index + 1)
{
const unsigned int n_import_targets = import_targets_data.size();
import_indices_plain_dev.reserve(n_import_targets);
- for (unsigned int i = 0; i < n_import_targets; i++)
+ for (unsigned int i = 0; i < n_import_targets; ++i)
{
// Expand the indices on the host
std::vector<std::pair<unsigned int, unsigned int>>::const_iterator
if ((k % 2) == 0)
{
double b = 1.; // 8.;
- // for (unsigned int i=1; i<=k; i++)
+ // for (unsigned int i=1; i<=k; ++i)
// b /= 2.*i;
ck[1] += b * (*recursive_coefficients[2])[1];
const double auxiliary_zero =
find_support_point_x_star(jacobi_roots);
this->lagrange_support_points[0] = auxiliary_zero;
- for (unsigned int m = 0; m < degree - 3; m++)
+ for (unsigned int m = 0; m < degree - 3; ++m)
this->lagrange_support_points[m + 1] = jacobi_roots[m];
this->lagrange_support_points[degree - 2] = 1.;
this->lagrange_support_points[degree - 1] = 1.;
else if (index == 1)
{
this->lagrange_support_points[0] = 0.;
- for (unsigned int m = 0; m < degree - 3; m++)
+ for (unsigned int m = 0; m < degree - 3; ++m)
this->lagrange_support_points[m + 1] = jacobi_roots[m];
this->lagrange_support_points[degree - 2] = 1.;
this->lagrange_support_points[degree - 1] = 1.;
{
this->lagrange_support_points[0] = 0.;
this->lagrange_support_points[1] = 0.;
- for (unsigned int m = 0, c = 2; m < degree - 3; m++)
+ for (unsigned int m = 0, c = 2; m < degree - 3; ++m)
if (m + 2 != index)
this->lagrange_support_points[c++] = jacobi_roots[m];
this->lagrange_support_points[degree - 2] = 1.;
{
this->lagrange_support_points[0] = 0.;
this->lagrange_support_points[1] = 0.;
- for (unsigned int m = 0; m < degree - 3; m++)
+ for (unsigned int m = 0; m < degree - 3; ++m)
this->lagrange_support_points[m + 2] = jacobi_roots[m];
this->lagrange_support_points[degree - 1] = 1.;
find_support_point_x_star(jacobi_roots);
this->lagrange_support_points[0] = 0.;
this->lagrange_support_points[1] = 0.;
- for (unsigned int m = 0; m < degree - 3; m++)
+ for (unsigned int m = 0; m < degree - 3; ++m)
this->lagrange_support_points[m + 2] = jacobi_roots[m];
this->lagrange_support_points[degree - 1] = 1. - auxiliary_zero;
// To maintain stability, delay the division (multiplication by a) until the
// end.
- for (unsigned int i = 1; i <= k - 2; i++)
+ for (unsigned int i = 1; i <= k - 2; ++i)
{
coefficients[i] = b * coefficients_km1[i - 1] - c * coefficients_km2[i];
}
(void)fourth_derivatives;
if (values.size() == this->n())
- for (unsigned int i = 0; i < this->n(); i++)
+ for (unsigned int i = 0; i < this->n(); ++i)
values[i] = compute_value(i, unit_point);
if (grads.size() == this->n())
- for (unsigned int i = 0; i < this->n(); i++)
+ for (unsigned int i = 0; i < this->n(); ++i)
grads[i] = compute_grad(i, unit_point);
}
(void)fourth_derivatives;
if (values.size() == this->n())
- for (unsigned int i = 0; i < this->n(); i++)
+ for (unsigned int i = 0; i < this->n(); ++i)
values[i] = compute_value(i, unit_point);
if (grads.size() == this->n())
- for (unsigned int i = 0; i < this->n(); i++)
+ for (unsigned int i = 0; i < this->n(); ++i)
grads[i] = compute_grad(i, unit_point);
}
for (Integer q = M; q > 1; q >>= 1)
{
const Integer p = q - 1;
- for (unsigned int i = 0; i < dim; i++)
+ for (unsigned int i = 0; i < dim; ++i)
{
// invert
if (X[i] & q)
}
// Gray encode (inverse of decode)
- for (unsigned int i = 1; i < dim; i++)
+ for (unsigned int i = 1; i < dim; ++i)
X[i] ^= X[i - 1];
Integer t = 0;
for (Integer q = M; q > 1; q >>= 1)
if (X[dim - 1] & q)
t ^= q - 1;
- for (unsigned int i = 0; i < dim; i++)
+ for (unsigned int i = 0; i < dim; ++i)
X[i] ^= t;
// now we need to go from index stored in transpose format to
// ADOL-C builds only the lower-triangular part of the
// symmetric Hessian, so we should copy the relevant
// entries into the upper triangular part.
- for (unsigned int i = 0; i < n_independent_variables; i++)
- for (unsigned int j = 0; j < i; j++)
+ for (unsigned int i = 0; i < n_independent_variables; ++i)
+ for (unsigned int j = 0; j < i; ++j)
hessian[j][i] = hessian[i][j]; // Symmetry
}
internal::reverse_mode_dependent_variable_activation(
const_cast<ADNumberType &>(dependent_variables[0]));
const std::size_t n_independent_variables = independent_variables.size();
- for (unsigned int i = 0; i < n_independent_variables; i++)
+ for (unsigned int i = 0; i < n_independent_variables; ++i)
gradient[i] = internal::NumberType<ScalarType>::value(
ADNumberTraits<ADNumberType>::get_directional_derivative(
independent_variables[i], 0 /*This number doesn't really matter*/));
internal::reverse_mode_dependent_variable_activation(
const_cast<ADNumberType &>(dependent_variables[0]));
const std::size_t n_independent_variables = independent_variables.size();
- for (unsigned int i = 0; i < n_independent_variables; i++)
+ for (unsigned int i = 0; i < n_independent_variables; ++i)
{
using derivative_type =
typename ADNumberTraits<ADNumberType>::derivative_type;
ExcDimensionMismatch(values.size(), dependent_variables.size()));
const std::size_t n_dependent_variables = dependent_variables.size();
- for (unsigned int i = 0; i < n_dependent_variables; i++)
+ for (unsigned int i = 0; i < n_dependent_variables; ++i)
values[i] = ADNumberTraits<ADNumberType>::get_scalar_value(
dependent_variables[i]);
}
n_independent_variables,
dealii::internal::NumberType<accumulation_type>::value(0.0));
- for (unsigned int i = 0; i < n_dependent_variables; i++)
+ for (unsigned int i = 0; i < n_dependent_variables; ++i)
{
internal::reverse_mode_dependent_variable_activation(
const_cast<ADNumberType &>(dependent_variables[i]));
- for (unsigned int j = 0; j < n_independent_variables; j++)
+ for (unsigned int j = 0; j < n_independent_variables; ++j)
{
const accumulation_type df_i_dx_j =
ADNumberTraits<ADNumberType>::get_directional_derivative(
// In forward mode, the gradients are computed from the
// dependent variables
const std::size_t n_independent_variables = independent_variables.size();
- for (unsigned int i = 0; i < n_independent_variables; i++)
+ for (unsigned int i = 0; i < n_independent_variables; ++i)
gradient[i] = internal::NumberType<ScalarType>::value(
ADNumberTraits<ADNumberType>::get_directional_derivative(
dependent_variables[0], i));
// In forward mode, the gradients are computed from the
// dependent variables
const std::size_t n_independent_variables = independent_variables.size();
- for (unsigned int i = 0; i < n_independent_variables; i++)
+ for (unsigned int i = 0; i < n_independent_variables; ++i)
{
using derivative_type =
typename ADNumberTraits<ADNumberType>::derivative_type;
ExcDimensionMismatch(values.size(), dependent_variables.size()));
const std::size_t n_dependent_variables = dependent_variables.size();
- for (unsigned int i = 0; i < n_dependent_variables; i++)
+ for (unsigned int i = 0; i < n_dependent_variables; ++i)
values[i] = ADNumberTraits<ADNumberType>::get_scalar_value(
dependent_variables[i]);
}
// In forward mode, the gradients are computed from the
// dependent variables
- for (unsigned int i = 0; i < n_dependent_variables; i++)
- for (unsigned int j = 0; j < n_independent_variables; j++)
+ for (unsigned int i = 0; i < n_dependent_variables; ++i)
+ for (unsigned int j = 0; j < n_independent_variables; ++j)
jacobian[i][j] = internal::NumberType<ScalarType>::value(
ADNumberTraits<ADNumberType>::get_directional_derivative(
dependent_variables[i], j));
stream << "Registered independent variables: "
<< "\n";
- for (unsigned int i = 0; i < n_independent_variables(); i++)
+ for (unsigned int i = 0; i < n_independent_variables(); ++i)
stream << registered_independent_variable_values[i]
<< (i < (n_independent_variables() - 1) ? "," : "");
stream << std::endl;
stream << "Registered marked independent variables: "
<< "\n";
- for (unsigned int i = 0; i < n_independent_variables(); i++)
+ for (unsigned int i = 0; i < n_independent_variables(); ++i)
stream << registered_marked_independent_variables[i]
<< (i < (n_independent_variables() - 1) ? "," : "")
<< std::flush;
stream << "Dependent variable values: "
<< "\n";
- for (unsigned int i = 0; i < n_dependent_variables(); i++)
+ for (unsigned int i = 0; i < n_dependent_variables(); ++i)
stream << dependent_variables[i]
<< (i < (n_dependent_variables() - 1) ? "," : "");
stream << std::endl;
stream << "Registered dependent variables: "
<< "\n";
- for (unsigned int i = 0; i < n_dependent_variables(); i++)
+ for (unsigned int i = 0; i < n_dependent_variables(); ++i)
stream << registered_marked_dependent_variables[i]
<< (i < (n_dependent_variables() - 1) ? "," : "");
stream << std::endl;
HelperBase<ADNumberTypeCode, ScalarType>::print_values(
std::ostream &stream) const
{
- for (unsigned int i = 0; i < n_independent_variables(); i++)
+ for (unsigned int i = 0; i < n_independent_variables(); ++i)
stream << independent_variable_values[i]
<< (i < (n_independent_variables() - 1) ? "," : "")
<< std::flush;
}
// Account for symmetries of tensor components
- for (unsigned int i = 0; i < this->n_independent_variables(); i++)
+ for (unsigned int i = 0; i < this->n_independent_variables(); ++i)
{
if (this->is_symmetric_independent_variable(i) == true)
gradient[i] *= 0.5;
}
// Account for symmetries of tensor components
- for (unsigned int i = 0; i < this->n_independent_variables(); i++)
- for (unsigned int j = 0; j < i + 1; j++)
+ for (unsigned int i = 0; i < this->n_independent_variables(); ++i)
+ for (unsigned int j = 0; j < i + 1; ++j)
{
if (this->is_symmetric_independent_variable(i) == true &&
this->is_symmetric_independent_variable(j) == true)
jacobian);
}
- for (unsigned int j = 0; j < this->n_independent_variables(); j++)
+ for (unsigned int j = 0; j < this->n_independent_variables(); ++j)
{
// Because we perform just a single differentiation
// operation with respect to the "column" variables,
// we only need to consider them for symmetry conditions.
if (this->is_symmetric_independent_variable(j) == true)
- for (unsigned int i = 0; i < this->n_dependent_variables(); i++)
+ for (unsigned int i = 0; i < this->n_dependent_variables(); ++i)
jacobian[i][j] *= 0.5;
}
}
dealii::types::global_dof_index dealii_index =
triangulation->get_p4est_tree_to_coarse_cell_permutation()[treeidx];
- for (i = 0; i < l; i++)
+ for (i = 0; i < l; ++i)
{
typename dealii::Triangulation<dim, spacedim>::cell_iterator cell(
triangulation, i, dealii_index);
*vertices_with_ghost_neighbors = fg->vertices_with_ghost_neighbors;
subids->elem_count = 0;
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (sides[i].is_ghost)
{
subdomain_ids =
reinterpret_cast<dealii::types::subdomain_id *>(subids->array);
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (!sides[i].is_ghost)
{
Assert(!cell->is_ghost(),
ExcMessage("local quad found ghost cell"));
- for (j = 0; j < nsubs; j++)
+ for (j = 0; j < nsubs; ++j)
{
(*vertices_with_ghost_neighbors)[cell->vertex_index(
sides[i].corner)]
*vertices_with_ghost_neighbors = fg->vertices_with_ghost_neighbors;
subids->elem_count = 0;
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (sides[i].is_hanging)
{
- for (j = 0; j < 2; j++)
+ for (j = 0; j < 2; ++j)
{
if (sides[i].is.hanging.is_ghost[j])
{
subdomain_ids =
reinterpret_cast<dealii::types::subdomain_id *>(subids->array);
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (sides[i].is_hanging)
{
- for (j = 0; j < 2; j++)
+ for (j = 0; j < 2; ++j)
{
if (!sides[i].is.hanging.is_ghost[j])
{
sides[i].treeid,
*(sides[i].is.hanging.quad[j]));
- for (k = 0; k < nsubs; k++)
+ for (k = 0; k < nsubs; ++k)
{
(*vertices_with_ghost_neighbors)
[cell->vertex_index(
int limit = (dim == 2) ? 2 : 4;
subids->elem_count = 0;
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (sides[i].is_hanging)
{
- for (j = 0; j < limit; j++)
+ for (j = 0; j < limit; ++j)
{
if (sides[i].is.hanging.is_ghost[j])
{
subdomain_ids =
reinterpret_cast<dealii::types::subdomain_id *>(subids->array);
- for (i = 0; i < nsides; i++)
+ for (i = 0; i < nsides; ++i)
{
if (sides[i].is_hanging)
{
- for (j = 0; j < limit; j++)
+ for (j = 0; j < limit; ++j)
{
if (!sides[i].is.hanging.is_ghost[j])
{
sides[i].treeid,
*(sides[i].is.hanging.quad[j]));
- for (k = 0; k < nsubs; k++)
+ for (k = 0; k < nsubs; ++k)
{
if (dim == 2)
{
dof_handler.hp_object_fe_indices[d][offset] = fe;
dof_handler.object_dof_ptr[l][d][offset + 1] = n_dofs;
- for (unsigned int i = 0; i < n_dofs; i++)
+ for (unsigned int i = 0; i < n_dofs; ++i)
dof_handler.object_dof_indices[l][d].push_back(
numbers::invalid_dof_index);
}
n_dofs_2;
- for (unsigned int i = 0; i < n_dofs_1 + n_dofs_2; i++)
+ for (unsigned int i = 0; i < n_dofs_1 + n_dofs_2; ++i)
dof_handler.object_dof_indices[l][d].push_back(
numbers::invalid_dof_index);
}
const IndexSet & indices_we_care_about,
DoFHandler<dim, spacedim> & dof_handler)
{
- for (unsigned int d = 1; d < dim; d++)
+ for (unsigned int d = 1; d < dim; ++d)
for (auto &i : dof_handler.object_dof_indices[0][d])
if (i != numbers::invalid_dof_index)
i = ((indices_we_care_about.size() == 0) ?
if (dof_handler.hp_capability_enabled == false)
{
- for (unsigned int d = 1; d < dim; d++)
+ for (unsigned int d = 1; d < dim; ++d)
for (auto &i : dof_handler.object_dof_indices[0][d])
if (i != numbers::invalid_dof_index)
i = ((indices_we_care_about.size() == 0) ?
if (dof_handler.hp_capability_enabled == false)
{
- for (unsigned int d = 1; d < dim; d++)
+ for (unsigned int d = 1; d < dim; ++d)
for (auto &i : dof_handler.object_dof_indices[0][d])
if (i != numbers::invalid_dof_index)
i = ((indices_we_care_about.size() == 0) ?
// compute the displacements (relative to recvbuf)
// at which to place the incoming data from process i
std::vector<int> displacements(n_cpu);
- for (unsigned int i = 0; i < n_cpu; i++)
+ for (unsigned int i = 0; i < n_cpu; ++i)
{
displacements[i] = shift;
shift += rcounts[i];
Utilities::MPI::all_gather(
tr->get_communicator(),
this->dof_handler->locally_owned_dofs());
- for (unsigned int i = 0; i < n_cpu; i++)
+ for (unsigned int i = 0; i < n_cpu; ++i)
{
const IndexSet iset = locally_owned_dofs_per_processor[i];
for (types::global_dof_index ind = 0; ind < iset.n_elements();
subdomain_association.size());
}
- for (unsigned int i = 0; i < n_subdomains; i++)
+ for (unsigned int i = 0; i < n_subdomains; ++i)
index_sets[i].compress();
return index_sets;
// neighbor a face are artificial, we simply test to see if the face
// does not have a valid dof initialization.
- for (unsigned int i = 0; i < dofs_per_face; i++)
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
if (dofs_1[i] == numbers::invalid_dof_index ||
dofs_2[i] == numbers::invalid_dof_index)
{
child_cells =
GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
cell_row);
- for (unsigned int i = 0; i < child_cells.size(); i++)
+ for (unsigned int i = 0; i < child_cells.size(); ++i)
{
const typename DoFHandler<dim, spacedim>::cell_iterator
cell_row_child = child_cells[i];
child_cells =
GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
cell_col);
- for (unsigned int i = 0; i < child_cells.size(); i++)
+ for (unsigned int i = 0; i < child_cells.size(); ++i)
{
const typename DoFHandler<dim, spacedim>::active_cell_iterator
cell_col_child = child_cells[i];
Assert(polynomial_space != nullptr, ExcInternalError());
std::vector<unsigned int> lexicographic =
polynomial_space->get_numbering_inverse();
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
points[j] = this->unit_support_points[lexicographic[j]][0];
// Check whether the support points are equidistant.
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (std::abs(points[j] - static_cast<double>(j) / this->degree) > 1e-15)
{
equidistant = false;
// Check whether the support points come from QGaussLobatto.
const QGaussLobatto<1> points_gl(this->degree + 1);
bool gauss_lobatto = true;
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (points[j] != points_gl.point(j)(0))
{
gauss_lobatto = false;
// Check whether the support points come from QGauss.
const QGauss<1> points_g(this->degree + 1);
bool gauss = true;
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (points[j] != points_g.point(j)(0))
{
gauss = false;
// Check whether the support points come from QGauss.
const QGaussLog<1> points_glog(this->degree + 1);
bool gauss_log = true;
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (points[j] != points_glog.point(j)(0))
{
gauss_log = false;
{
std::vector<unsigned int> multiplicities;
multiplicities.push_back(1); // the first one is non-enriched FE
- for (unsigned int i = 0; i < functions.size(); i++)
+ for (unsigned int i = 0; i < functions.size(); ++i)
multiplicities.push_back(functions[i].size());
return multiplicities;
{
std::vector<const FiniteElement<dim, spacedim> *> fes;
fes.push_back(fe_base);
- for (unsigned int i = 0; i < fe_enriched.size(); i++)
+ for (unsigned int i = 0; i < fe_enriched.size(); ++i)
fes.push_back(fe_enriched[i]);
return fes;
const unsigned int n_comp_base = fes[0]->n_components();
// start from fe=1 as 0th is always non-enriched FE.
- for (unsigned int fe = 1; fe < fes.size(); fe++)
+ for (unsigned int fe = 1; fe < fes.size(); ++fe)
{
const FE_Nothing<dim> *fe_nothing =
dynamic_cast<const FE_Nothing<dim> *>(fes[fe]);
const std::vector<const FiniteElement<dim, spacedim> *> &fes)
{
// start from fe=1 as 0th is always non-enriched FE.
- for (unsigned int fe = 1; fe < fes.size(); fe++)
+ for (unsigned int fe = 1; fe < fes.size(); ++fe)
if (dynamic_cast<const FE_Nothing<dim> *>(fes[fe]) == nullptr)
// this is not FE_Nothing => there will be enrichment
return true;
// resize to be consistent with all FEs used to construct the FE_Enriched,
// even though we will never use the 0th element.
base_no_mult_local_enriched_dofs.resize(fes.size());
- for (unsigned int fe = 1; fe < fes.size(); fe++)
+ for (unsigned int fe = 1; fe < fes.size(); ++fe)
base_no_mult_local_enriched_dofs[fe].resize(multiplicities[fe]);
Assert(base_no_mult_local_enriched_dofs.size() == this->n_base_elements(),
std::vector<const FiniteElement<dim, spacedim> *> fes;
std::vector<unsigned int> multiplicities;
- for (unsigned int i = 0; i < this->n_base_elements(); i++)
+ for (unsigned int i = 0; i < this->n_base_elements(); ++i)
{
fes.push_back(&base_element(i));
multiplicities.push_back(this->element_multiplicity(i));
// block of code
this->base_to_block_indices.reinit(0, 0);
- for (unsigned int i = 0; i < fes.size(); i++)
+ for (unsigned int i = 0; i < fes.size(); ++i)
if (multiplicities[i] > 0)
this->base_to_block_indices.push_back(multiplicities[i]);
// TODO: do we need it only for dim_1 == dim (i.e. fill_fe_values)?
if (dim_1 == dim)
- for (unsigned int base_no = 1; base_no < this->n_base_elements(); base_no++)
+ for (unsigned int base_no = 1; base_no < this->n_base_elements(); ++base_no)
{
const FiniteElement<dim, spacedim> &base_fe = base_element(base_no);
typename FiniteElement<dim, spacedim>::InternalDataBase &base_fe_data =
ExcDimensionMismatch(base_no_mult_local_enriched_dofs.size(),
fe_data.enrichment.size()));
// calculate hessians, gradients and values for each function
- for (unsigned int base_no = 1; base_no < this->n_base_elements(); base_no++)
+ for (unsigned int base_no = 1; base_no < this->n_base_elements(); ++base_no)
{
Assert(
base_no_mult_local_enriched_dofs[base_no].size() ==
ExcDimensionMismatch(
fe_data.enrichment[base_no][m].hessians.size(),
n_q_points));
- for (unsigned int q = 0; q < n_q_points; q++)
+ for (unsigned int q = 0; q < n_q_points; ++q)
fe_data.enrichment[base_no][m].hessians[q] =
enrichments[base_no - 1][m](cell)->hessian(
mapping_data.quadrature_points[q]);
ExcDimensionMismatch(
fe_data.enrichment[base_no][m].gradients.size(),
n_q_points));
- for (unsigned int q = 0; q < n_q_points; q++)
+ for (unsigned int q = 0; q < n_q_points; ++q)
fe_data.enrichment[base_no][m].gradients[q] =
enrichments[base_no - 1][m](cell)->gradient(
mapping_data.quadrature_points[q]);
ExcDimensionMismatch(
fe_data.enrichment[base_no][m].values.size(),
n_q_points));
- for (unsigned int q = 0; q < n_q_points; q++)
+ for (unsigned int q = 0; q < n_q_points; ++q)
fe_data.enrichment[base_no][m].values[q] =
enrichments[base_no - 1][m](cell)->value(
mapping_data.quadrature_points[q]);
}
if (flags & update_gradients)
- for (unsigned int base_no = 1; base_no < this->n_base_elements(); base_no++)
+ for (unsigned int base_no = 1; base_no < this->n_base_elements(); ++base_no)
{
for (unsigned int m = 0;
m < base_no_mult_local_enriched_dofs[base_no].size();
}
if (flags & update_values)
- for (unsigned int base_no = 1; base_no < this->n_base_elements(); base_no++)
+ for (unsigned int base_no = 1; base_no < this->n_base_elements(); ++base_no)
{
for (unsigned int m = 0;
m < base_no_mult_local_enriched_dofs[base_no].size();
dynamic_cast<TensorProductPolynomials<dim> *>(this->poly_space.get());
std::vector<unsigned int> lexicographic =
poly_space_derived_ptr->get_numbering_inverse();
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
points[j] = this->unit_support_points[lexicographic[j]][0];
// Check whether the support points are equidistant.
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (std::fabs(points[j] - static_cast<double>(j) / this->degree) > 1e-15)
{
equidistant = false;
// Check whether the support points come from QGaussLobatto.
const QGaussLobatto<1> points_gl(this->degree + 1);
bool gauss_lobatto = true;
- for (unsigned int j = 0; j <= this->degree; j++)
+ for (unsigned int j = 0; j <= this->degree; ++j)
if (points[j] != points_gl.point(j)(0))
{
gauss_lobatto = false;
unsigned int index = 0;
// Decode the support points in one coordinate direction.
- for (unsigned int j = 0; j < dofs_per_cell; j++)
+ for (unsigned int j = 0; j < dofs_per_cell; ++j)
{
if ((dim > 1) ? (unit_support_points[j](1) == 0 &&
((dim > 2) ? unit_support_points[j](2) == 0 : true)) :
"Could not decode support points in one coordinate direction."));
// Check whether the support points are equidistant.
- for (unsigned int j = 0; j < n_points; j++)
+ for (unsigned int j = 0; j < n_points; ++j)
if (std::fabs(points[j] - static_cast<double>(j) / (this->degree - 1)) >
1e-15)
{
// Check whether the support points come from QGaussLobatto.
const QGaussLobatto<1> points_gl(n_points);
type = true;
- for (unsigned int j = 0; j < n_points; j++)
+ for (unsigned int j = 0; j < n_points; ++j)
if (points[j] != points_gl.point(j)(0))
{
type = false;
unsigned int index = 0;
// Decode the support points in one coordinate direction.
- for (unsigned int j = 0; j < dofs_per_cell; j++)
+ for (unsigned int j = 0; j < dofs_per_cell; ++j)
{
if ((dim > 1) ? (unit_support_points[j](1) == 0 &&
((dim > 2) ? unit_support_points[j](2) == 0 : true)) :
"Could not decode support points in one coordinate direction."));
// Check whether the support points are equidistant.
- for (unsigned int j = 0; j < n_points; j++)
+ for (unsigned int j = 0; j < n_points; ++j)
if (std::fabs(points[j] - static_cast<double>(j) / this->degree) > 1e-15)
{
type = false;
// Check whether the support points come from QGaussLobatto.
const QGaussLobatto<1> points_gl(n_points);
type = true;
- for (unsigned int j = 0; j < n_points; j++)
+ for (unsigned int j = 0; j < n_points; ++j)
if (points[j] != points_gl.point(j)(0))
{
type = false;
{
const std::vector<unsigned int> dof_map =
this->get_embedding_dofs(source_fe->degree);
- for (unsigned int j = 0; j < dof_map.size(); j++)
+ for (unsigned int j = 0; j < dof_map.size(); ++j)
matrix[dof_map[j]][j] = 1.;
}
// and when just truncate higher modes.
{
const std::vector<unsigned int> dof_map =
source_fe->get_embedding_dofs(this->degree);
- for (unsigned int j = 0; j < dof_map.size(); j++)
+ for (unsigned int j = 0; j < dof_map.size(); ++j)
matrix[j][dof_map[j]] = 1.;
}
}
// increasingly. Thus we return a vector of pairs for the first N-1, where
// N is minimum number of dofs_per_line for each FE_Q_Hierarchical.
std::vector<std::pair<unsigned int, unsigned int>> res;
- for (unsigned int i = 0; i < std::min(this_dpl, other_dpl); i++)
+ for (unsigned int i = 0; i < std::min(this_dpl, other_dpl); ++i)
res.emplace_back(i, i);
return res;
// increasingly. Thus we return a vector of pairs for the first N-1, where
// N is minimum number of dofs_per_line for each FE_Q_Hierarchical.
std::vector<std::pair<unsigned int, unsigned int>> res;
- for (unsigned int i = 0; i < std::min(this_dpq, other_dpq); i++)
+ for (unsigned int i = 0; i < std::min(this_dpq, other_dpq); ++i)
res.emplace_back(i, i);
return res;
case 3:
{
- for (unsigned int i = 0; i < dofs_1d * dofs_1d; i++)
+ for (unsigned int i = 0; i < dofs_1d * dofs_1d; ++i)
{
// center vertex node
this->interface_constraints(0, face_renumber[i]) =
dofs_subcell[1](1, (i - (i % dofs_1d)) / dofs_1d);
// interior edges
- for (unsigned int j = 0; j < (this->degree - 1); j++)
+ for (unsigned int j = 0; j < (this->degree - 1); ++j)
{
this->interface_constraints(5 + j, face_renumber[i]) =
dofs_subcell[0](1, i % dofs_1d) *
}
// boundary edges
- for (unsigned int j = 0; j < (this->degree - 1); j++)
+ for (unsigned int j = 0; j < (this->degree - 1); ++j)
{
// left edge
this->interface_constraints(5 + 4 * (this->degree - 1) + j,
}
// interior faces
- for (unsigned int j = 0; j < (this->degree - 1); j++)
- for (unsigned int k = 0; k < (this->degree - 1); k++)
+ for (unsigned int j = 0; j < (this->degree - 1); ++j)
+ for (unsigned int k = 0; k < (this->degree - 1); ++k)
{
// subcell 0
this->interface_constraints(5 + 12 * (this->degree - 1) +
double sum_1 = 0.0, sum_x = 0.0, sum_x2 = 0.0, sum_y = 0.0, sum_xy = 0.0;
- for (unsigned int i = 0; i < x.size(); i++)
+ for (unsigned int i = 0; i < x.size(); ++i)
{
sum_1 += 1.0;
sum_x += x[i];
Assert(local_dof_values.size() == matrix.n(),
ExcDimensionMismatch(local_dof_values.size(), matrix.n()));
- for (unsigned int i = 0; i < unrolled_coefficients.size(); i++)
- for (unsigned int j = 0; j < local_dof_values.size(); j++)
+ for (unsigned int i = 0; i < unrolled_coefficients.size(); ++i)
+ for (unsigned int j = 0; j < local_dof_values.size(); ++j)
unrolled_coefficients[i] += matrix[i][j] * local_dof_values[j];
fourier_coefficients.fill(unrolled_coefficients.begin());
Lh(const Point<dim> &x_q, const TableIndices<dim> &indices)
{
double res = 1.0;
- for (unsigned int d = 0; d < dim; d++)
+ for (unsigned int d = 0; d < dim; ++d)
{
const double x = 2.0 * (x_q[d] - 0.5);
Assert((x_q[d] <= 1.0) && (x_q[d] >= 0.), ExcLegendre(d, x_q[d]));
multiplier(const TableIndices<dim> &indices)
{
double res = 1.0;
- for (unsigned int d = 0; d < dim; d++)
+ for (unsigned int d = 0; d < dim; ++d)
res *= (0.5 + indices[d]);
return res;
Assert(local_dof_values.size() == matrix.n(),
ExcDimensionMismatch(local_dof_values.size(), matrix.n()));
- for (unsigned int i = 0; i < unrolled_coefficients.size(); i++)
- for (unsigned int j = 0; j < local_dof_values.size(); j++)
+ for (unsigned int i = 0; i < unrolled_coefficients.size(); ++i)
+ for (unsigned int j = 0; j < local_dof_values.size(); ++j)
unrolled_coefficients[i] += matrix[i][j] * local_dof_values[j];
legendre_coefficients.fill(unrolled_coefficients.begin());
std::vector<const FiniteElement<dim, spacedim> *> fes;
std::vector<unsigned int> multiplicities;
- for (unsigned int i = 0; i < this->n_base_elements(); i++)
+ for (unsigned int i = 0; i < this->n_base_elements(); ++i)
{
fes.push_back(&base_element(i));
multiplicities.push_back(this->element_multiplicity(i));
this->base_to_block_indices.reinit(0, 0);
- for (unsigned int i = 0; i < fes.size(); i++)
+ for (unsigned int i = 0; i < fes.size(); ++i)
if (multiplicities[i] > 0)
this->base_to_block_indices.push_back(multiplicities[i]);
Threads::TaskGroup<> clone_base_elements;
unsigned int ind = 0;
- for (unsigned int i = 0; i < fes.size(); i++)
+ for (unsigned int i = 0; i < fes.size(); ++i)
if (multiplicities[i] > 0)
{
clone_base_elements += Threads::new_task([&, i, ind]() {
// find index in vector to nose point (min) and tail point (max)
- for (unsigned int i = 0; i < jouk_points.size(); i++)
+ for (unsigned int i = 0; i < jouk_points.size(); ++i)
{
if (jouk_points[i](0) < nose_x_coordinate)
{
}
// copy point on upper side of airfoil
- for (unsigned int i = tail_index; i < jouk_points.size(); i++)
+ for (unsigned int i = tail_index; i < jouk_points.size(); ++i)
upper_points.emplace_back(jouk_points[i]);
- for (unsigned int i = 0; i <= nose_index; i++)
+ for (unsigned int i = 0; i <= nose_index; ++i)
upper_points.emplace_back(jouk_points[i]);
std::reverse(upper_points.begin(), upper_points.end());
// (number_points) equidistant points.
const double theta = 2 * numbers::PI / number_points;
// first point is leading edge then counterclockwise
- for (unsigned int i = 0; i < number_points; i++)
+ for (unsigned int i = 0; i < number_points; ++i)
circle_points.emplace_back(center[0] - radius * cos(i * theta),
center[1] - radius * sin(i * theta));
std::vector<Point<2>> joukowski_points(circle_points.size());
// transform each point
- for (unsigned int i = 0; i < circle_points.size(); i++)
+ for (unsigned int i = 0; i < circle_points.size(); ++i)
{
const double chi = circle_points[i](0);
const double eta = circle_points[i](1);
std::vector<Point<2>> naca_points;
if (digit_0 == 0 && digit_1 == 0) // is symmetric
- for (unsigned int i = 0; i < number_points; i++)
+ for (unsigned int i = 0; i < number_points; ++i)
{
const double x = i * 1 / (1.0 * number_points - 1);
const double y_t =
naca_points.emplace_back(x, -y_t);
}
else // is asymmetric
- for (unsigned int i = 0; i < number_points; i++)
+ for (unsigned int i = 0; i < number_points; ++i)
{
const double m = 1.0 * digit_0 / 100; // max. chamber
const double p = 1.0 * digit_1 / 10; // location of max. chamber
// calculate arclength
std::vector<double> arclength_L(non_equidistant_points.size(), 0);
- for (unsigned int i = 0; i < non_equidistant_points.size() - 1; i++)
+ for (unsigned int i = 0; i < non_equidistant_points.size() - 1; ++i)
arclength_L[i + 1] =
arclength_L[i] +
non_equidistant_points[i + 1].distance(non_equidistant_points[i]);
// loop over all subsections
- for (unsigned int j = 0, i = 1; j < n_points - 1; j++)
+ for (unsigned int j = 0, i = 1; j < n_points - 1; ++j)
{
// get reference left and right end of this section
const auto Lj = arclength_L[j];
}
double x = 0;
- for (unsigned int j = 0; j < step_sizes.at(i).size(); j++)
+ for (unsigned int j = 0; j < step_sizes.at(i).size(); ++j)
x += step_sizes[i][j];
Assert(std::fabs(x - (p2(i) - p1(i))) <= 1e-12 * std::fabs(x),
ExcMessage(
Assert(spacing[0].size() == n_cells, ExcInvalidRepetitionsDimension(1));
double delta = std::numeric_limits<double>::max();
- for (unsigned int i = 0; i < n_cells; i++)
+ for (unsigned int i = 0; i < n_cells; ++i)
{
Assert(spacing[0][i] >= 0, ExcInvalidRepetitions(-1));
delta = std::min(delta, spacing[0][i]);
}
// create the cells
unsigned int n_val_cells = 0;
- for (unsigned int i = 0; i < n_cells; i++)
+ for (unsigned int i = 0; i < n_cells; ++i)
if (material_id[i] != numbers::invalid_material_id)
n_val_cells++;
std::vector<unsigned int> repetitions(2);
double delta = std::numeric_limits<double>::max();
- for (unsigned int i = 0; i < 2; i++)
+ for (unsigned int i = 0; i < 2; ++i)
{
repetitions[i] = spacing[i].size();
- for (unsigned int j = 0; j < repetitions[i]; j++)
+ for (unsigned int j = 0; j < repetitions[i]; ++j)
{
Assert(spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
delta = std::min(delta, spacing[i][j]);
// create the cells
unsigned int n_val_cells = 0;
- for (unsigned int i = 0; i < material_id.size(0); i++)
- for (unsigned int j = 0; j < material_id.size(1); j++)
+ for (unsigned int i = 0; i < material_id.size(0); ++i)
+ for (unsigned int j = 0; j < material_id.size(1); ++j)
if (material_id[i][j] != numbers::invalid_material_id)
n_val_cells++;
std::vector<unsigned int> repetitions(dim);
double delta = std::numeric_limits<double>::max();
- for (unsigned int i = 0; i < dim; i++)
+ for (unsigned int i = 0; i < dim; ++i)
{
repetitions[i] = spacing[i].size();
- for (unsigned int j = 0; j < repetitions[i]; j++)
+ for (unsigned int j = 0; j < repetitions[i]; ++j)
{
Assert(spacing[i][j] >= 0, ExcInvalidRepetitions(-1));
delta = std::min(delta, spacing[i][j]);
// create the cells
unsigned int n_val_cells = 0;
- for (unsigned int i = 0; i < material_id.size(0); i++)
- for (unsigned int j = 0; j < material_id.size(1); j++)
- for (unsigned int k = 0; k < material_id.size(2); k++)
+ for (unsigned int i = 0; i < material_id.size(0); ++i)
+ for (unsigned int j = 0; j < material_id.size(1); ++j)
+ for (unsigned int k = 0; k < material_id.size(2); ++k)
if (material_id[i][j][k] != numbers::invalid_material_id)
n_val_cells++;
Table<2, unsigned int> swap_matrix(
GeometryInfo<spacedim>::faces_per_cell,
GeometryInfo<dim - 1>::vertices_per_cell);
- for (unsigned int i1 = 0; i1 < GeometryInfo<spacedim>::faces_per_cell; i1++)
+ for (unsigned int i1 = 0; i1 < GeometryInfo<spacedim>::faces_per_cell; ++i1)
{
for (unsigned int i2 = 0; i2 < GeometryInfo<dim - 1>::vertices_per_cell;
i2++)
if (dim == 2)
{
for (const auto &cell : surface_mesh.active_cell_iterators())
- for (unsigned int vertex = 0; vertex < 2; vertex++)
+ for (unsigned int vertex = 0; vertex < 2; ++vertex)
if (cell->face(vertex)->at_boundary())
cell->face(vertex)->set_boundary_id(0);
}
std::map<typename MeshType<dim - 1, spacedim>::cell_iterator,
typename MeshType<dim, spacedim>::face_iterator>
surface_to_volume_mapping;
- for (unsigned int i = 0; i < temporary_map_boundary_cell_face.size(); i++)
+ for (unsigned int i = 0; i < temporary_map_boundary_cell_face.size(); ++i)
surface_to_volume_mapping[temporary_map_boundary_cell_face[i].first] =
temporary_map_boundary_cell_face[i].second.first;
if (dim == 3)
{
- for (unsigned int count = 0; count < n_geometric_objects; count++)
+ for (unsigned int count = 0; count < n_geometric_objects; ++count)
{
unsigned int n_vertices;
in >> n_vertices;
}
else if (dim == 2)
{
- for (unsigned int count = 0; count < n_geometric_objects; count++)
+ for (unsigned int count = 0; count < n_geometric_objects; ++count)
{
unsigned int n_vertices;
in >> n_vertices;
}
else if (dim == 1)
{
- for (unsigned int count = 0; count < n_geometric_objects; count++)
+ for (unsigned int count = 0; count < n_geometric_objects; ++count)
{
unsigned int type;
in >> type;
"While reading VTK file, unknown cell type encountered"));
cells.emplace_back(type);
- for (unsigned int j = 0; j < type; j++) // loop to feed data
+ for (unsigned int j = 0; j < type; ++j) // loop to feed data
in >> cells.back().vertices[j];
cells.back().material_id = 0;
// assumption that cells come before all faces and
// lines has been verified above via an assertion, so
// the order used in the following blocks makes sense
- for (unsigned int i = 0; i < cells.size(); i++)
+ for (unsigned int i = 0; i < cells.size(); ++i)
{
int id;
in >> id;
vertices.emplace_back();
- for (unsigned int d = 0; d < spacedim; d++)
+ for (unsigned int d = 0; d < spacedim; ++d)
vertices.back()(d) = x[d];
vertex_indices[no] = no_vertex;
const unsigned int n_lines =
(n_entities % 2 == 0) ? (n_entities / 2) : ((n_entities + 1) / 2);
- for (unsigned int line = 0; line < n_lines; line++)
+ for (unsigned int line = 0; line < n_lines; ++line)
{
unsigned int n_fragments;
// XDA happens to use ExodusII's numbering because XDA/XDR is libMesh's
// native format, and libMesh's node numberings come from ExodusII:
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; i++)
+ for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
in >> cell.vertices[reference_cell.exodusii_vertex_to_deal_vertex(i)];
}
auto subdomains_it = subdomains.begin();
auto level_subdomains_it = level_subdomains.begin();
- for (unsigned int index = 0; index < n; index++)
+ for (unsigned int index = 0; index < n; ++index)
{
double h;
auto subdomains_it = subdomains.begin();
auto level_subdomains_it = level_subdomains.begin();
- for (unsigned int index = 0; index < n; index++)
+ for (unsigned int index = 0; index < n; ++index)
{
switch (svg_flags.coloring)
{
else
{
LAPACKFullMatrix<double> J = LAPACKFullMatrix<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)
J(i, j) = jacobian[i][j];
J.compute_svd();
// For all remaining vertices, test
// whether they are any closer
- for (unsigned int j = best_vertex + 1; j < vertices.size(); j++)
+ for (unsigned int j = best_vertex + 1; j < vertices.size(); ++j)
if (vertices_to_use[j])
{
const double dist = (p - vertices[j]).norm_square();
std::array<Point<dim>, n_lines> vertex_list_reduced;
std::array<unsigned int, n_lines> local_remap;
std::fill(local_remap.begin(), local_remap.end(), X);
- for (int i = 0; new_line_table[configuration][i] != X; i++)
+ for (int i = 0; new_line_table[configuration][i] != X; ++i)
if (local_remap[new_line_table[configuration][i]] == X)
{
vertex_list_reduced[local_vertex_count] =
// write back vertices
const unsigned int n_vertices_old = vertices.size();
- for (unsigned int i = 0; i < local_vertex_count; i++)
+ for (unsigned int i = 0; i < local_vertex_count; ++i)
vertices.push_back(vertex_list_reduced[i]);
// write back cells
// For all remaining vertices, test
// whether they are any closer
- for (unsigned int j = best_vertex + 1; j < vertices.size(); j++)
+ for (unsigned int j = best_vertex + 1; j < vertices.size(); ++j)
if (used[j])
{
double dist = (p - vertices[j]).norm_square();
// Perform a simple average ...
double total_weights = 0.;
- for (unsigned int i = 0; i < directions.size(); i++)
+ for (unsigned int i = 0; i < directions.size(); ++i)
{
// if one weight is one, return its direction
if (std::abs(1 - weights[i]) < tolerance)
bool
Triangulation<dim, spacedim>::has_hanging_nodes() const
{
- for (unsigned int lvl = 0; lvl < n_global_levels() - 1; lvl++)
+ for (unsigned int lvl = 0; lvl < n_global_levels() - 1; ++lvl)
if (n_active_cells(lvl) != 0)
return true;
// rule out points outside the
// bounding box of this cell
- for (unsigned int d = 0; d < dim; d++)
+ for (unsigned int d = 0; d < dim; ++d)
if ((p[d] < minp[d]) || (p[d] > maxp[d]))
return false;
AssertThrow(ierr == 0, ExcSLEPcError(ierr));
// get the maximum of residual norm among converged eigenvectors.
- for (unsigned int i = 0; i < *n_converged; i++)
+ for (unsigned int i = 0; i < *n_converged; ++i)
{
double residual_norm_i = 0.0;
// EPSComputeError (or, in older versions of SLEPc,
AssertIndexRange(j, cols);
Assert(compressed == false, ExcMatrixIsCompressed());
- for (std::size_t k = rowstart[i]; k < rowstart[i + 1]; k++)
+ for (std::size_t k = rowstart[i]; k < rowstart[i + 1]; ++k)
{
// entry already exists
if (colnums[k] == j)
bool has_larger_entries = false;
// skip diagonal
std::size_t k = rowstart[row] + store_diagonal_first_in_row;
- for (; k < rowstart[row + 1]; k++)
+ for (; k < rowstart[row + 1]; ++k)
if (colnums[k] == invalid_entry)
break;
else if (colnums[k] >= *it)
// set global degrees of freedom
auto n_dofs = graph->n_rows();
- for (unsigned int i = 0; i < n_dofs; i++)
+ for (unsigned int i = 0; i < n_dofs; ++i)
{
globalID[i] = i;
localID[i] = i; // Same as global ids.
// copy from export_to_part to partition_indices, whose part_ids != 0.
Assert(export_to_part != nullptr, ExcInternalError());
- for (int i = 0; i < num_export; i++)
+ for (int i = 0; i < num_export; ++i)
partition_indices[export_local_ids[i]] = export_to_part[i];
#endif
}
std::vector<int> color_exp(num_objects);
// Set ids for which coloring needs to be done
- for (int i = 0; i < num_objects; i++)
+ for (int i = 0; i < num_objects; ++i)
global_ids[i] = i;
// Call ZOLTAN coloring algorithm
types::global_dof_index last_contiguous_start = ghost_origin[0].first;
ghost_numbering[ghost_origin[0].second] = 0;
- for (std::size_t i = 1; i < n_ghosts; i++)
+ for (std::size_t i = 1; i < n_ghosts; ++i)
{
if (ghost_origin[i].first > ghost_origin[i - 1].first + 1)
{
std::vector<CellWork *> blocked_worker(n_blocked_workers);
root->set_ref_count(evens + 1);
- for (unsigned int j = 0; j < evens; j++)
+ for (unsigned int j = 0; j < evens; ++j)
{
worker[j] = new (root->allocate_child())
CellWork(function,
MPICommunication *worker_compr =
new (root->allocate_child()) MPICommunication(funct, true);
worker_compr->set_ref_count(1);
- for (unsigned int j = 0; j < evens; j++)
+ for (unsigned int j = 0; j < evens; ++j)
{
if (j > 0)
{
unsigned int mcell_start = 0;
block_start[0] = 0;
- for (unsigned int block = 0; block < n_blocks; block++)
+ for (unsigned int block = 0; block < n_blocks; ++block)
{
block_start[block + 1] = block_start[block];
for (unsigned int mcell = mcell_start;
block_size_last = block_size;
unsigned int tick = 0;
- for (unsigned int block = 0; block < n_blocks; block++)
+ for (unsigned int block = 0; block < n_blocks; ++block)
{
unsigned int present_block = partition_color_list[block];
for (unsigned int cell = block_start[present_block];
if (cell_partition_data[tick] == block)
cell_partition_data[tick++] = counter_macro;
- for (unsigned int j = 0; j < this_block_size; j++)
+ for (unsigned int j = 0; j < this_block_size; ++j)
irregular[counter_macro++] =
irregular_cells[present_block * block_size + j];
}
// This is the simple case. The renumbering is just a combination of
// the renumbering that we were given as an input and the
// renumbering of partition/coloring given in partition_2layers_list
- for (unsigned int j = 0; j < renumbering.size(); j++)
+ for (unsigned int j = 0; j < renumbering.size(); ++j)
renumbering[j] = renumbering_in[partition_2layers_list[j]];
// Account for the ghost cells, finally.
for (unsigned int i = 0; i < n_ghost_cells; ++i)
unsigned int counter = 0;
unsigned int mcell_start = 0;
block_start[0] = 0;
- for (unsigned int block = 0; block < n_blocks; block++)
+ for (unsigned int block = 0; block < n_blocks; ++block)
{
block_start[block + 1] = block_start[block];
for (unsigned int mcell = mcell_start;
block_size_last = block_size;
unsigned int tick = 0;
- for (unsigned int block = 0; block < n_blocks; block++)
+ for (unsigned int block = 0; block < n_blocks; ++block)
{
unsigned int present_block = partition_2layers_list[block];
for (unsigned int cell = block_start[present_block];
if (cell_partition_data[tick] == block)
cell_partition_data[tick++] = counter_macro;
- for (unsigned int j = 0; j < this_block_size; j++)
+ for (unsigned int j = 0; j < this_block_size; ++j)
irregular[counter_macro++] =
irregular_cells[present_block * block_size + j];
}
partition_list.swap(renumbering);
- for (unsigned int j = 0; j < renumbering.size(); j++)
+ for (unsigned int j = 0; j < renumbering.size(); ++j)
renumbering[j] = partition_list[partition_partition_list[j]];
for (unsigned int i = 0; i < n_ghost_cells; ++i)
.push_back(partition_partition_list[cell]);
}
// check how many more cells are needed in the lists
- for (unsigned int j = 0; j < max_fe_index + 1; j++)
+ for (unsigned int j = 0; j < max_fe_index + 1; ++j)
{
remaining_per_cell_batch[j] =
renumbering_fe_index[j].size() %
// index within one partition-partition which was
// implicitly assumed above
cell = counter - partition_counter;
- for (unsigned int j = 0; j < max_fe_index + 1; j++)
+ for (unsigned int j = 0; j < max_fe_index + 1; ++j)
{
for (const unsigned int jj :
renumbering_fe_index[j])
partition_row_index.resize(partition + 1);
cell_partition_data.clear();
unsigned int color_counter = 0, index_counter = 0;
- for (unsigned int part = 0; part < partition; part++)
+ for (unsigned int part = 0; part < partition; ++part)
{
partition_row_index[part] = index_counter;
unsigned int max_color = 0;
// Reorder within partition: First, all blocks that belong the 0 and
// then so on until those with color max (Note that the smaller the
// number the larger the partition)
- for (unsigned int color = 0; color <= max_color; color++)
+ for (unsigned int color = 0; color <= max_color; ++color)
{
cell_partition_data.push_back(color_counter);
index_counter++;
partition_odds.resize(partition);
partition_n_blocked_workers.resize(partition);
partition_n_workers.resize(partition);
- for (unsigned int part = 0; part < partition; part++)
+ for (unsigned int part = 0; part < partition; ++part)
{
partition_evens[part] =
(partition_row_index[part + 1] - partition_row_index[part] + 1) / 2;
std::vector<unsigned int> recv_indices;
std::vector<unsigned int> recv_len;
- for (unsigned int i = 0; i + 1 < sm_export_ptr.size(); i++)
+ for (unsigned int i = 0; i + 1 < sm_export_ptr.size(); ++i)
{
if (sm_export_ptr[i] != sm_export_ptr[i + 1])
{
std::map<unsigned int, std::vector<types::global_dof_index>>
rank_to_local_indices;
- for (unsigned int i = 0; i < owning_ranks_of_ghosts.size(); i++)
+ for (unsigned int i = 0; i < owning_ranks_of_ghosts.size(); ++i)
rank_to_local_indices[owning_ranks_of_ghosts[i]].push_back(i);
unsigned int compressed_offset = 0;
std::vector<MPI_Request> requests(sm_ghost_ranks.size() +
sm_import_ranks.size());
- for (unsigned int i = 0; i < sm_ghost_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_ghost_ranks.size(); ++i)
{
const int ierr = MPI_Isend(sm_export_data_this_indices.data() +
sm_export_data_this_ptr[i],
AssertThrowMPI(ierr);
}
- for (unsigned int i = 0; i < sm_import_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_import_ranks.size(); ++i)
{
const int ierr =
MPI_Irecv(sm_import_data_indices.data() + sm_import_data_ptr[i],
std::vector<MPI_Request> requests(sm_import_ranks.size() +
sm_ghost_ranks.size());
- for (unsigned int i = 0; i < sm_import_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_import_ranks.size(); ++i)
{
const int ierr = MPI_Isend(sm_import_data_this_indices.data() +
sm_import_data_this_ptr[i],
AssertThrowMPI(ierr);
}
- for (unsigned int i = 0; i < sm_ghost_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_ghost_ranks.size(); ++i)
{
const int ierr =
MPI_Irecv(sm_export_data_indices.data() + sm_export_data_ptr[i],
int dummy;
// receive a signal that relevant sm neighbors are ready
- for (unsigned int i = 0; i < sm_ghost_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_ghost_ranks.size(); ++i)
{
const int ierr =
MPI_Irecv(&dummy,
}
// signal to all relevant sm neighbors that this process is ready
- for (unsigned int i = 0; i < sm_import_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_import_ranks.size(); ++i)
{
const int ierr = MPI_Isend(&dummy,
0,
}
// receive data from remote processes
- for (unsigned int i = 0; i < ghost_targets_data.size(); i++)
+ for (unsigned int i = 0; i < ghost_targets_data.size(); ++i)
{
const unsigned int offset =
n_ghost_indices_in_larger_set_by_remote_rank[i] -
}
// send data to remote processes
- for (unsigned int i = 0, k = 0; i < import_targets_data.size(); i++)
+ for (unsigned int i = 0, k = 0; i < import_targets_data.size(); ++i)
{
for (unsigned int j = import_indices_data.first[i];
j < import_indices_data.first[i + 1];
ghost_targets_data.size() + import_targets_data.size());
int dummy;
- for (unsigned int i = 0; i < sm_ghost_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_ghost_ranks.size(); ++i)
{
const int ierr = MPI_Isend(&dummy,
0,
AssertThrowMPI(ierr);
}
- for (unsigned int i = 0; i < sm_import_ranks.size(); i++)
+ for (unsigned int i = 0; i < sm_import_ranks.size(); ++i)
{
const int ierr =
MPI_Irecv(&dummy,
AssertThrowMPI(ierr);
}
- for (unsigned int i = 0; i < ghost_targets_data.size(); i++)
+ for (unsigned int i = 0; i < ghost_targets_data.size(); ++i)
{
for (unsigned int c = 0,
ko = ghost_indices_subset_data.first[i],
AssertThrowMPI(ierr);
}
- for (unsigned int i = 0; i < import_targets_data.size(); i++)
+ for (unsigned int i = 0; i < import_targets_data.size(); ++i)
{
const int ierr = MPI_Irecv(
temporary_storage.data() + import_targets_data[i][1],
AssertThrow(level_dof_indices.size() == index_owner.size(),
ExcMessage("Size does not match!"));
- for (unsigned int i = 0; i < index_owner.size(); i++)
+ for (unsigned int i = 0; i < index_owner.size(); ++i)
send_data[index_owner[i]].emplace_back(level,
global_dof_indices[i],
level_dof_indices[i]);
// duplicate and put into vectorized array
prolongation_matrix_1d.resize(elem_info.prolongation_matrix_1d.size());
- for (unsigned int i = 0; i < elem_info.prolongation_matrix_1d.size(); i++)
+ for (unsigned int i = 0; i < elem_info.prolongation_matrix_1d.size(); ++i)
prolongation_matrix_1d[i] = elem_info.prolongation_matrix_1d[i];
// reshuffle into aligned vector of vectorized arrays
const BoundingBox<dim> & box,
ExtendableQuadrature<dim> &quadrature)
{
- for (unsigned int i = 0; i < unit_quadrature.size(); i++)
+ for (unsigned int i = 0; i < unit_quadrature.size(); ++i)
{
const Point<dim> point = box.unit_to_real(unit_quadrature.point(i));
const double weight = unit_quadrature.weight(i) * box.volume();
, low_dim_algorithm(q_collection1D, additional_data)
, up_through_dimension_creator(q_collection1D, additional_data)
{
- for (unsigned int i = 0; i < q_collection1D.size(); i++)
+ for (unsigned int i = 0; i < q_collection1D.size(); ++i)
tensor_products.push_back(Quadrature<dim>(q_collection1D[i]));
}
{
// Get the side lengths for each direction and sort them.
std::array<std::pair<double, unsigned int>, dim> side_lengths;
- for (int i = 0; i < dim; i++)
+ for (int i = 0; i < dim; ++i)
{
side_lengths[i].first = box.side_length(i);
side_lengths[i].second = i;
std::vector<Tensor<1, dim>> normals;
normals.reserve(surface_quadrature_wrong_normal.size());
- for (unsigned int i = 0; i < surface_quadrature_wrong_normal.size(); i++)
+ for (unsigned int i = 0; i < surface_quadrature_wrong_normal.size(); ++i)
{
const Point<dim> point = dealii::internal::create_higher_dim_point(
surface_quadrature_wrong_normal.point(i),
// efficient than find_active_cell_around_point
// because it operates on a set of points.
- for (; cell != endc; cell++)
+ for (; cell != endc; ++cell)
{
fe_values.reinit(cell);
// may be slightly more
// efficient than find_active_cell_around_point
// because it operates on a set of points.
- for (; cell != endc; cell++)
+ for (; cell != endc; ++cell)
{
fe_values.reinit(cell);
for (unsigned int support_point = 0; support_point < n_support_points;
const Point<dim> &test_point =
fe_values.quadrature_point(support_point);
- for (unsigned int point = 0; point < locations.size(); point++)
+ for (unsigned int point = 0; point < locations.size(); ++point)
{
if (locations[point].distance(test_point) <
locations[point].distance(current_points[point][component]))
std::vector<types::global_dof_index> local_dof_indices(
dof_handler->get_fe().n_dofs_per_cell());
- for (unsigned int point = 0; point < locations.size(); point++)
+ for (unsigned int point = 0; point < locations.size(); ++point)
{
current_cell[point]->get_dof_indices(local_dof_indices);
std::vector<types::global_dof_index> new_solution_indices;
fe_values.get_quadrature_points();
double distance = cell->diameter();
unsigned int selected_point = 0;
- for (unsigned int q_point = 0; q_point < n_quadrature_points; q_point++)
+ for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
{
if (requested_location.distance(quadrature_points[q_point]) <
distance)
static_cast<int>(independent_values[0].size())) < 2,
ExcDataLostSync());
- for (unsigned int component = 0; component < n_indep; component++)
+ for (unsigned int component = 0; component < n_indep; ++component)
independent_values[component].push_back(indep_values[component]);
}
}
else
{
- for (unsigned int component = 0; component < n_indep; component++)
+ for (unsigned int component = 0; component < n_indep; ++component)
{
to_gnuplot << "<Indep_" << component << "> ";
}
to_gnuplot << "\n";
}
// write general data stored
- for (unsigned int key = 0; key < dataset_key.size(); key++)
+ for (unsigned int key = 0; key < dataset_key.size(); ++key)
{
to_gnuplot << dataset_key[key];
- for (unsigned int component = 0; component < n_indep; component++)
+ for (unsigned int component = 0; component < n_indep; ++component)
{
to_gnuplot << " " << independent_values[component][key];
}
}
else
{
- for (unsigned int component = 0; component < n_indep; component++)
+ for (unsigned int component = 0; component < n_indep; ++component)
{
to_gnuplot << "<Indep_" << component << "> ";
}
to_gnuplot << "\n";
// write data stored for the point
- for (unsigned int key = 0; key < dataset_key.size(); key++)
+ for (unsigned int key = 0; key < dataset_key.size(); ++key)
{
to_gnuplot << dataset_key[key];
- for (unsigned int component = 0; component < n_indep; component++)
+ for (unsigned int component = 0; component < n_indep; ++component)
{
to_gnuplot << " " << independent_values[component][key];
}
double distance = cell->diameter();
unsigned int selected_point = 0;
- for (unsigned int q_point = 0; q_point < n_quadrature_points; q_point++)
+ for (unsigned int q_point = 0; q_point < n_quadrature_points; ++q_point)
{
if (requested_location.distance(evaluation_points[q_point]) <
distance)
resize(Table<dim, CoefficientType> &coeff, const unsigned int N)
{
TableIndices<dim> size;
- for (unsigned int d = 0; d < dim; d++)
+ for (unsigned int d = 0; d < dim; ++d)
size[d] = N;
coeff.reinit(size);
}