// go with the pragmatic, even if not pretty, solution shown here:
template <typename DataVector>
static void
- compute_Wminus(const BoundaryKind (&boundary_kind)[n_components],
- const Tensor<1, dim> &normal_vector,
- const DataVector & Wplus,
+ compute_Wminus(const std::array<BoundaryKind, n_components> &boundary_kind,
+ const Tensor<1, dim> & normal_vector,
+ const DataVector & Wplus,
const Vector<double> &boundary_values,
const DataVector & Wminus)
{
std::vector<std::vector<Tensor<1, dim>>> dU(
1, std::vector<Tensor<1, dim>>(n_components));
- typename DoFHandler<dim>::active_cell_iterator cell = dof_handler
- .begin_active(),
- endc = dof_handler.end();
- for (unsigned int cell_no = 0; cell != endc; ++cell, ++cell_no)
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
+ const unsigned int cell_no = cell->active_cell_index();
fe_v.reinit(cell);
fe_v.get_function_gradients(solution, dU);
struct BoundaryConditions
{
- typename EulerEquations<dim>::BoundaryKind
- kind[EulerEquations<dim>::n_components];
+ std::array<typename EulerEquations<dim>::BoundaryKind,
+ EulerEquations<dim>::n_components>
+ kind;
FunctionParser<dim> values;
AllParameters<dim>::BoundaryConditions::BoundaryConditions()
: values(EulerEquations<dim>::n_components)
{
- for (unsigned int c = 0; c < EulerEquations<dim>::n_components; ++c)
- kind[c] = EulerEquations<dim>::no_penetration_boundary;
+ std::fill(kind.begin(),
+ kind.end(),
+ EulerEquations<dim>::no_penetration_boundary);
}
// Then loop over all cells, initialize the FEValues object for the
// current cell and call the function that assembles the problem on this
// cell.
- typename DoFHandler<dim>::active_cell_iterator cell =
- dof_handler.begin_active(),
- endc = dof_handler.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
fe_v.reinit(cell);
cell->get_dof_indices(dof_indices);
void
ConservationLaw<dim>::refine_grid(const Vector<double> &refinement_indicators)
{
- typename DoFHandler<dim>::active_cell_iterator cell =
- dof_handler.begin_active(),
- endc = dof_handler.end();
-
- for (unsigned int cell_no = 0; cell != endc; ++cell, ++cell_no)
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
+ const unsigned int cell_no = cell->active_cell_index();
cell->clear_coarsen_flag();
cell->clear_refine_flag();