cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit(cell);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int j = 0; j < dofs_per_cell; ++j)
+ for (const unsigned int i : fe_values.dof_indices())
+ for (const unsigned int j : fe_values.dof_indices())
for (const unsigned int q_point :
fe_values.quadrature_point_indices())
{
reinterpret_cast<PointHistory<dim> *>(cell->user_pointer());
body_force.vector_value_list(fe_values.get_quadrature_points(),
body_force_values);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : fe_values.dof_indices())
{
const unsigned int component_i =
fe.system_to_component_index(i).first;
cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit(cell);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int j = 0; j < dofs_per_cell; ++j)
+ for (const unsigned int i : fe_values.dof_indices())
+ for (const unsigned int j : fe_values.dof_indices())
for (const unsigned int q_point :
fe_values.quadrature_point_indices())
{
reinterpret_cast<PointHistory<dim> *>(cell->user_pointer());
body_force.vector_value_list(fe_values.get_quadrature_points(),
body_force_values);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : fe_values.dof_indices())
{
const unsigned int component_i =
fe.system_to_component_index(i).first;
scratch.symm_grad_Nx[q_point];
const std::vector<Tensor<2, dim>> &grad_Nx = scratch.grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int component_i =
fe.system_to_component_index(i).first;
const unsigned int i_group = fe.system_to_base_index(i).first.first;
- for (unsigned int j = 0; j <= i; ++j)
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_ending_at(i))
{
const unsigned int component_j =
fe.system_to_component_index(j).first;
}
}
}
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int j = i + 1; j < dofs_per_cell; ++j)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_starting_at(i + 1))
data.cell_matrix(i, j) = data.cell_matrix(j, i);
}
template <int dim>
const std::vector<SymmetricTensor<2, dim>> &symm_grad_Nx =
scratch.symm_grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group = fe.system_to_base_index(i).first.first;
if (i_group == u_dof)
const double time_ramp = (time.current() / time.end());
const double pressure = p0 * parameters.p_p0 * time_ramp;
const Tensor<1, dim> traction = pressure * N;
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group =
fe.system_to_base_index(i).first.first;
scratch.symm_grad_Nx[q_point];
const std::vector<Tensor<2, dim>> &grad_Nx = scratch.grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int component_i =
fe.system_to_component_index(i).first;
const unsigned int i_group = fe.system_to_base_index(i).first.first;
- for (unsigned int j = 0; j <= i; ++j)
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_ending_at(i))
{
const unsigned int component_j =
fe.system_to_component_index(j).first;
}
}
}
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int j = i + 1; j < dofs_per_cell; ++j)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_starting_at(i + 1))
data.cell_matrix(i, j) = data.cell_matrix(j, i);
}
template <int dim>
const std::vector<SymmetricTensor<2, dim>> &symm_grad_Nx =
scratch.symm_grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group = fe.system_to_base_index(i).first.first;
if (i_group == u_dof)
const double time_ramp = (time.current() / time.end());
const double pressure = p0 * parameters.p_p0 * time_ramp;
const Tensor<1, dim> traction = pressure * N;
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group =
fe.system_to_base_index(i).first.first;
scratch.symm_grad_Nx[q_point];
const std::vector<Tensor<2, dim>> &grad_Nx = scratch.grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int component_i =
fe.system_to_component_index(i).first;
const unsigned int i_group = fe.system_to_base_index(i).first.first;
- for (unsigned int j = 0; j <= i; ++j)
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_ending_at(i))
{
const unsigned int component_j =
fe.system_to_component_index(j).first;
}
}
}
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int j = i + 1; j < dofs_per_cell; ++j)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
+ for (const unsigned int j :
+ scratch.fe_values_ref.dof_indices_starting_at(i + 1))
data.cell_matrix(i, j) = data.cell_matrix(j, i);
}
template <int dim>
const std::vector<SymmetricTensor<2, dim>> &symm_grad_Nx =
scratch.symm_grad_Nx[q_point];
const double JxW = scratch.fe_values_ref.JxW(q_point);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group = fe.system_to_base_index(i).first.first;
if (i_group == u_dof)
const double time_ramp = (time.current() / time.end());
const double pressure = p0 * parameters.p_p0 * time_ramp;
const Tensor<1, dim> traction = pressure * N;
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
+ for (const unsigned int i : scratch.fe_values_ref.dof_indices())
{
const unsigned int i_group =
fe.system_to_base_index(i).first.first;