From: Martin Kronbichler Date: Thu, 29 Jun 2023 18:23:21 +0000 (+0200) Subject: Shorten another matrix-free test X-Git-Tag: relicensing~831^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b546aa6903c4d88b0660ebc80d9ac65ff02d05b;p=dealii.git Shorten another matrix-free test --- diff --git a/tests/matrix_free/matrix_vector_hp_parallel_01.cc b/tests/matrix_free/matrix_vector_hp_parallel_01.cc index 1221396a3b..49760e44fe 100644 --- a/tests/matrix_free/matrix_vector_hp_parallel_01.cc +++ b/tests/matrix_free/matrix_vector_hp_parallel_01.cc @@ -64,36 +64,7 @@ public: const LinearAlgebra::distributed::Vector &src, const std::pair &cell_range) const { - // ask MatrixFree for cell_range for different orders - std::pair subrange_deg = - data.create_cell_subrange_hp(cell_range, 1); - if (subrange_deg.second > subrange_deg.first) - helmholtz_operator, 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, 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, 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, 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, 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, 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, 8>( - data, dst, src, subrange_deg); + helmholtz_operator_no_template(data, dst, src, cell_range); } void @@ -121,9 +92,7 @@ test() const SphericalManifold manifold; parallel::distributed::Triangulation tria(MPI_COMM_WORLD); GridGenerator::hyper_ball(tria); - typename Triangulation::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::face_indices()) if (cell->at_boundary(f)) cell->face(f)->set_all_manifold_ids(0); @@ -133,12 +102,9 @@ test() // refine a few cells for (unsigned int i = 0; i < 11 - 3 * dim; ++i) { - typename Triangulation::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(); } @@ -159,9 +125,7 @@ test() DoFHandler dof(tria); // set the active FE index in a random order { - typename DoFHandler::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; @@ -212,9 +176,7 @@ test() FullMatrix cell_matrix; std::vector local_dof_indices; - typename DoFHandler::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;