triangulation.refine_global(2);
- for (const auto cell : triangulation.active_cell_iterators())
+ for (const auto &cell : triangulation.active_cell_iterators())
for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
++face_no)
{
const Quadrature<dim> support_quadrature(fe.get_unit_support_points());
FEValues<dim> fe_values(fe, support_quadrature, update_quadrature_points);
- for (const auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
fe_values.reinit(cell);
const auto &qp = fe_values.get_quadrature_points();
const Quadrature<dim> support_quadrature(fe.get_unit_support_points());
FEValues<dim> fe_values(fe, support_quadrature, update_quadrature_points);
- for (const auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
fe_values.reinit(cell);
const auto &qp = fe_values.get_quadrature_points();
tria.refine_global(1);
if (adaptive_ref)
{
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center().norm() < 0.5)
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center()[0] < 0.2)
cell->set_refine_flag();
tria.refine_global(1);
for (unsigned int ref = 0; ref < 2; ++ref)
{
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned() && cell->center()(0) < .5 &&
cell->center()(1) < .5)
cell->set_refine_flag();
GridTools::partition_triangulation(n_subdomains, tria);
hp::DoFHandler<dim> hp_dof_handler(tria);
- for (auto cell : hp_dof_handler.active_cell_iterators())
+ for (auto &cell : hp_dof_handler.active_cell_iterators())
{
if (cell == hp_dof_handler.begin_active())
cell->set_active_fe_index(0); // FE_Q
const Coefficient<dim> coefficient;
std::vector<double> coefficient_values(n_q_points);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
cell_matrix = 0;
cell_rhs = 0;
{
// set flags on active cells
tr.clear_user_flags();
- for (auto cell : tr.active_cell_iterators())
+ for (auto &cell : tr.active_cell_iterators())
cell->set_user_flag();
// now verify that it is really only the active cells
- for (auto cell : tr.cell_iterators())
+ for (auto &cell : tr.cell_iterators())
AssertThrow(cell->user_flag_set() == !cell->has_children(),
ExcInternalError());
}
for (unsigned int l = 0; l < tr.n_levels(); ++l)
{
tr.clear_user_flags();
- for (auto cell : tr.active_cell_iterators_on_level(l))
+ for (auto &cell : tr.active_cell_iterators_on_level(l))
cell->set_user_flag();
- for (auto cell : tr.cell_iterators_on_level(l))
+ for (auto &cell : tr.cell_iterators_on_level(l))
AssertThrow(cell->user_flag_set() == !cell->has_children(),
ExcInternalError());
- for (auto cell : tr.cell_iterators())
+ for (auto &cell : tr.cell_iterators())
AssertThrow((cell->user_flag_set() == !cell->has_children()) ||
(l != (unsigned int)cell->level()),
ExcInternalError());
// find set of dofs which belong to enriched cells
std::set<unsigned int> enriched_cell_dofs;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->active_fe_index() != 0)
{
unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
// get material ids:
Vector<float> fe_index(dof_handler.get_triangulation().n_active_cells());
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
fe_index[cell->active_cell_index()] = cell->active_fe_index();
}
update_JxW_values);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->subdomain_id() == this_mpi_process)
{
fe_values_hp.reinit(cell);
// find set of dofs which belong to enriched cells
std::set<unsigned int> enriched_cell_dofs;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->active_fe_index() != 0)
{
unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
// get material ids:
Vector<float> fe_index(dof_handler.get_triangulation().n_active_cells());
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
fe_index[cell->active_cell_index()] = cell->active_fe_index();
}
std::map<typename Triangulation<dim, spacedim>::face_iterator, double> mymap;
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
{
GridGenerator::hyper_cube(tria);
tria.refine_global(ref);
std::vector<CellId> cell_ids;
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
cell_ids.push_back(cell->id());
}
unsigned int i = 0;
bool ok = true;
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
if (cell->id() != unpacked[i++])
{
std::vector<std::vector<unsigned int>> computed_ranks;
unsigned int computed_pts = 0;
- for (auto cell : sphere.active_cell_iterators())
+ for (auto &cell : sphere.active_cell_iterators())
{
// The points we consider are the cell centers
auto center_pt = cell->center();
Triangulation<dim> cube;
GridGenerator::hyper_cube(cube);
cube.refine_global(ref_cube);
- for (auto cell : cube.active_cell_iterators())
+ for (auto &cell : cube.active_cell_iterators())
test_points.emplace_back(cell->center());
deallog << " Testing on " << test_points.size() << " points" << std::endl;
{
GridGenerator::subdivided_hyper_rectangle(
tria, std::vector<unsigned int>(5u, 1), Point<1>(), Point<1>(1.5), true);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
cell->set_material_id(
static_cast<types::material_id>(10.0 * (3.0 + cell->center()[0])));
for (auto face : tria.active_face_iterators())
if (0.5 < face->center()[0])
face->set_all_manifold_ids(42);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
cell->set_manifold_id(
static_cast<types::material_id>(10.0 * (2.0 + cell->center()[0])));
}
for (auto face : tria.active_face_iterators())
if (face->at_boundary() && 0.0 < face->center()[0])
face->set_boundary_id(42);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->center() != Point<dim>())
{
const double angle = std::atan2(cell->center()[0], cell->center()[1]);
for (auto face : tria.active_face_iterators())
if (-0.1 < face->center()[0])
face->set_all_manifold_ids(42);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->center() != Point<dim>())
{
const double angle = std::atan2(cell->center()[0], cell->center()[1]);
};
GridTools::assign_co_dimensional_manifold_indicators(tria, validate);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
deallog << "Cell: " << (int)cell->manifold_id() << std::endl;
if (dim > 1)
Point<2>(2.2, 0.41));
std::set<Triangulation<2>::active_cell_iterator> cells_to_remove;
Tensor<1, 2> cylinder_triangulation_offset;
- for (const auto cell : bulk_triangulation.active_cell_iterators())
+ for (const auto &cell : bulk_triangulation.active_cell_iterators())
{
if ((cell->center() - Point<2>(0.2, 0.2)).norm() < 0.15)
cells_to_remove.insert(cell);
0.41 / 4.0);
GridTools::shift(cylinder_triangulation_offset, cylinder_triangulation);
// dumb hack
- for (const auto cell : cylinder_triangulation.active_cell_iterators())
+ for (const auto &cell : cylinder_triangulation.active_cell_iterators())
cell->set_material_id(2);
// merge them together
auto minimal_line_length = [](const Triangulation<2> &tria) -> double {
double min_line_length = std::numeric_limits<double>::max();
- for (const auto cell : tria.active_cell_iterators())
+ for (const auto &cell : tria.active_cell_iterators())
for (unsigned int line_n = 0; line_n < GeometryInfo<2>::lines_per_cell;
++line_n)
min_line_length = std::min(min_line_length,
const types::manifold_id tfi_id = 1;
const types::manifold_id polar_id = 0;
- for (const auto cell : result_2.active_cell_iterators())
+ for (const auto &cell : result_2.active_cell_iterators())
{
// set all non-boundary manifold ids to the new TFI manifold id.
if (cell->material_id() == 2)
result_2.set_manifold(tfi_id, inner_manifold);
std::vector<Point<2> *> inner_pointers;
- for (const auto cell : result_2.active_cell_iterators())
+ for (const auto &cell : result_2.active_cell_iterators())
{
for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
++face_n)
*ptr += Point<2>(0.2, 0.2) - center;
result_2.refine_global(1);
- for (const auto cell : result_2.active_cell_iterators())
+ for (const auto &cell : result_2.active_cell_iterators())
{
if (cell->at_boundary())
{
mymap;
unsigned int face_counter = 0;
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
{
triangulation.begin_active()->set_all_manifold_ids(spherical_manifold_id);
- for (const auto cell : triangulation.active_cell_iterators())
+ for (const auto &cell : triangulation.active_cell_iterators())
{
deallog << "current cell manifold id: " << cell->manifold_id()
<< std::endl;
<< std::endl;
MappingQGeneric<2, 3> mapping(6);
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
{
const Point<3> projected_point =
GridTools::project_to_object(cell, trial_point);
dof_handler.distribute_dofs(fe);
deallog << "n_dofs=" << dof_handler.n_dofs() << std::endl;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
deallog << cell << ": ";
std::vector<types::global_dof_index> dof_indices(
for (unsigned int step = 0; step < 10; ++step)
{
std::cout << "step " << step << std::endl;
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
++v)
tria.set_all_manifold_ids(0);
tria.set_manifold(0, spherical);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->at_boundary(f))
{
<< std::endl;
}
}
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->at_boundary(f))
{
quadrature,
update_normal_vectors | update_quadrature_points);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
fe_values.reinit(cell, f);
quadrature,
update_normal_vectors | update_quadrature_points);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->at_boundary(f))
{
deallog.precision(10);
deallog << "Cell centers" << std::endl;
- for (auto cell : tria.cell_iterators())
+ for (auto &cell : tria.cell_iterators())
deallog << cell->id() << " has center "
<< cell->center(/*respect_manifold*/ true) << std::endl;
bottom_left,
top_right);
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
{
if (cell->center()[0] < 24.)
cell->set_material_id(0);
tria.refine_global(1);
if (adaptive_ref)
{
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center().norm() < 0.5)
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center()[0] < 0.2)
cell->set_refine_flag();
tria.refine_global(1);
if (adaptive_ref)
{
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center().norm() < 0.5)
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
- for (auto cell : tria.active_cell_iterators())
+ for (auto &cell : tria.active_cell_iterators())
if (cell->is_locally_owned())
if (cell->center()[0] < 0.2)
cell->set_refine_flag();
fe.push_back(FE_Q<dim>(2));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)
<< std::endl;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
deallog << " Cell: " << cell << std::endl;
deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)
<< std::endl;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
deallog << " Cell: " << cell << std::endl;
fe.push_back(FE_Q<dim>(2));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
deallog << "Processor: " << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)
<< std::endl;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
deallog << " Cell: " << cell << std::endl;
fe.push_back(FE_Q<dim>(2));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
fe.push_back(FE_Q<dim>(2));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
fe.push_back(FE_Q<dim>(2));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
// that to build a hash value from it that is then used to assign an
// active_fe_index
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(
(cell->active_cell_index() +
fe.push_back(FESystem<dim>(FE_Q<dim>(2), dim));
hp::DoFHandler<dim> dof_handler(triangulation);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
GridGenerator::hyper_cube(triangulation, -L, L, /*colorize*/ false);
// mark faces
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
const Point<dim> &face_center = cell->face(f)->center();
for (unsigned int ilevel = 0; ilevel < numRefinementLevels; ilevel++)
{
// pick an corner cell and refine
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
{
try
{
GridGenerator::hyper_cube(triangulation, -L, L, /*colorize*/ false);
// mark faces
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
{
const Point<dim> &face_center = cell->face(f)->center();
for (unsigned int ilevel = 0; ilevel < numRefinementLevels; ilevel++)
{
// pick an corner cell and refine
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
{
try
{
}
else
{
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
if (cell->is_locally_owned())
{
if ((cell->center()[0] < -8. && cell->center()[1] < 0) ||
{
std::vector<types::global_dof_index> dof_indices(dof.get_fe().dofs_per_cell);
deallog << "DoF numbers on active cells" << std::endl;
- for (auto cell : dof.active_cell_iterators())
+ for (auto &cell : dof.active_cell_iterators())
if (!cell->is_artificial())
{
cell->get_dof_indices(dof_indices);
for (unsigned int l = 0; l < dof.get_triangulation().n_global_levels(); ++l)
{
deallog << "DoF numbers on level " << l << std::endl;
- for (auto cell : dof.cell_iterators_on_level(l))
+ for (auto &cell : dof.cell_iterators_on_level(l))
if (cell->level_subdomain_id() != numbers::artificial_subdomain_id)
{
cell->get_mg_dof_indices(dof_indices);
{
std::vector<types::global_dof_index> dof_indices(dof.get_fe().dofs_per_cell);
deallog << "DoF numbers on active cells" << std::endl;
- for (auto cell : dof.active_cell_iterators())
+ for (auto &cell : dof.active_cell_iterators())
if (!cell->is_artificial())
{
cell->get_dof_indices(dof_indices);
for (unsigned int l = 0; l < dof.get_triangulation().n_global_levels(); ++l)
{
deallog << "DoF numbers on level " << l << std::endl;
- for (auto cell : dof.cell_iterators_on_level(l))
+ for (auto &cell : dof.cell_iterators_on_level(l))
if (cell->level_subdomain_id() != numbers::artificial_subdomain_id)
{
cell->get_mg_dof_indices(dof_indices);
{
std::vector<types::global_dof_index> dof_indices(dof.get_fe().dofs_per_cell);
deallog << "DoF numbers on active cells" << std::endl;
- for (auto cell : dof.active_cell_iterators())
+ for (auto &cell : dof.active_cell_iterators())
if (!cell->is_artificial())
{
cell->get_dof_indices(dof_indices);
for (unsigned int l = 0; l < dof.get_triangulation().n_global_levels(); ++l)
{
deallog << "DoF numbers on level " << l << std::endl;
- for (auto cell : dof.cell_iterators_on_level(l))
+ for (auto &cell : dof.cell_iterators_on_level(l))
if (cell->level_subdomain_id() != numbers::artificial_subdomain_id)
{
cell->get_mg_dof_indices(dof_indices);
{
std::vector<types::global_dof_index> dof_indices(dof.get_fe().dofs_per_cell);
deallog << "DoF numbers on active cells" << std::endl;
- for (auto cell : dof.active_cell_iterators())
+ for (auto &cell : dof.active_cell_iterators())
if (!cell->is_artificial())
{
cell->get_dof_indices(dof_indices);
for (unsigned int l = 0; l < dof.get_triangulation().n_global_levels(); ++l)
{
deallog << "DoF numbers on level " << l << std::endl;
- for (auto cell : dof.cell_iterators_on_level(l))
+ for (auto &cell : dof.cell_iterators_on_level(l))
if (cell->level_subdomain_id() != numbers::artificial_subdomain_id)
{
cell->get_mg_dof_indices(dof_indices);
FullMatrix<double> cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell);
AffineConstraints<double> constraints;
- for (auto cell : dh.active_cell_iterators())
+ for (auto &cell : dh.active_cell_iterators())
if (cell->is_locally_owned())
{
cell_matrix = 0;
FullMatrix<double> cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell);
AffineConstraints<double> constraints;
- for (auto cell : dh.active_cell_iterators())
+ for (auto &cell : dh.active_cell_iterators())
if (cell->is_locally_owned())
{
cell_matrix = 0;
// set the active_fe_index on all locally active cells equal to the
// subdomain_id. we can later verify this equality also on ghost
// cells
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(cell->subdomain_id());
<< std::endl;
// verify that the information has been communicated between processors
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
Assert(cell->active_fe_index() == cell->subdomain_id(),
// set the active_fe_index on all locally active cells equal to the
// subdomain_id. we can later verify this equality also on ghost
// cells
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(cell->subdomain_id());
<< std::endl;
// verify that the information has been communicated between processors
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
Assert(cell->active_fe_index() == cell->subdomain_id(),
// set the active_fe_index on all locally active cells equal to the
// subdomain_id. we can later verify this equality also on ghost
// cells
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(cell->subdomain_id());
<< std::endl;
// verify that the information has been communicated between processors
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
Assert(cell->active_fe_index() == cell->subdomain_id(),
// set the active_fe_index on all locally active cells equal to the
// subdomain_id. we can later verify this equality also on ghost
// cells
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(cell->subdomain_id());
<< std::endl;
// verify that the information has been communicated between processors
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
Assert(cell->active_fe_index() == cell->subdomain_id(),
parallel::shared::Triangulation<dim>::partition_custom_signal);
triangulation.signals.post_refinement.connect([&triangulation]() {
// partition the triangulation by hand
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
cell->set_subdomain_id(cell->active_cell_index() %
Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD));
});
parallel::shared::Triangulation<dim>::partition_custom_signal);
triangulation.signals.post_refinement.connect([&triangulation]() {
// partition the triangulation by hand
- for (auto cell : triangulation.active_cell_iterators())
+ for (auto &cell : triangulation.active_cell_iterators())
cell->set_subdomain_id(cell->active_cell_index() %
Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD));
});
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
- for (auto cell : dof_handler.active_cell_iterators())
+ for (auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
hp::DoFHandler<dim> dofh(tria);
// assign FEs mostly randomly to each cell
- for (auto cell : dofh.active_cell_iterators())
+ for (auto &cell : dofh.active_cell_iterators())
if (cell->is_locally_owned())
cell->set_active_fe_index(cell->active_cell_index() % fe.size());
dofh.distribute_dofs(fe);