const LinearAlgebra::distributed::Vector<Number> &src,
const std::pair<unsigned int, unsigned int> &cell_range) const
{
- // ask MatrixFree for cell_range for different orders
- std::pair<unsigned int, unsigned int> subrange_deg =
- data.create_cell_subrange_hp(cell_range, 1);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 1, LinearAlgebra::distributed::Vector<Number>, 2>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 2);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 2, LinearAlgebra::distributed::Vector<Number>, 3>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 3);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 3, LinearAlgebra::distributed::Vector<Number>, 4>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 4);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 4, LinearAlgebra::distributed::Vector<Number>, 5>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 5);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 5, LinearAlgebra::distributed::Vector<Number>, 6>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 6);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 6, LinearAlgebra::distributed::Vector<Number>, 7>(
- data, dst, src, subrange_deg);
- subrange_deg = data.create_cell_subrange_hp(cell_range, 7);
- if (subrange_deg.second > subrange_deg.first)
- helmholtz_operator<dim, 7, LinearAlgebra::distributed::Vector<Number>, 8>(
- data, dst, src, subrange_deg);
+ helmholtz_operator_no_template<dim>(data, dst, src, cell_range);
}
void
const SphericalManifold<dim> manifold;
parallel::distributed::Triangulation<dim> tria(MPI_COMM_WORLD);
GridGenerator::hyper_ball(tria);
- typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : tria.active_cell_iterators())
for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
// refine a few cells
for (unsigned int i = 0; i < 11 - 3 * dim; ++i)
{
- typename Triangulation<dim>::active_cell_iterator cell =
- tria.begin_active(),
- endc = tria.end();
- unsigned int counter = 0;
- for (; cell != endc; ++cell, ++counter)
- if (cell->is_locally_owned() && (counter % (7 - i) == 0))
+ unsigned int counter = 0;
+ for (const auto &cell : tria.active_cell_iterators())
+ if (cell->is_locally_owned() && ((counter++) % (7 - i) == 0))
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
}
DoFHandler<dim> dof(tria);
// set the active FE index in a random order
{
- typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : dof.active_cell_iterators())
{
if (cell->is_locally_owned() == false)
continue;
FullMatrix<double> cell_matrix;
std::vector<types::global_dof_index> local_dof_indices;
- typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
- for (; cell != endc; ++cell)
+ for (const auto &cell : dof.active_cell_iterators())
{
if (cell->is_locally_owned() == false)
continue;