Skip to content

Commit

Permalink
Address more appearances.
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed May 5, 2022
1 parent aa91f71 commit 94eaf43
Show file tree
Hide file tree
Showing 49 changed files with 65 additions and 122 deletions.
3 changes: 1 addition & 2 deletions source/grid/grid_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5479,8 +5479,7 @@ namespace GridGenerator
{
Triangulation<spacedim> volume_mesh;
GridGenerator::hyper_ball(volume_mesh, p, radius);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh, tria, boundary_ids);
tria.set_all_manifold_ids(0);
tria.set_manifold(0, SphericalManifold<spacedim - 1, spacedim>(p));
Expand Down
5 changes: 2 additions & 3 deletions tests/bits/anna_4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ FindBug<dim>::dirichlet_conditions()
component_mask);


std::vector<bool> fixed_dofs(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
std::vector<bool> fixed_dofs(dof_handler.n_dofs());
const std::set<types::boundary_id> boundary_ids = {0};

// get a list of those boundary DoFs which
// we want to be fixed:
Expand Down
10 changes: 4 additions & 6 deletions tests/bits/anna_6.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ ImposeBC<dim>::test_extract_boundary_DoFs()
bc_component_select[1] = true;
bc_component_select[2] = false;

std::vector<bool> ned_boundary_dofs(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
std::vector<bool> ned_boundary_dofs(dof_handler.n_dofs());
const std::set<types::boundary_id> boundary_ids = {0};
DoFTools::extract_boundary_dofs(dof_handler,
bc_component_select,
ned_boundary_dofs,
Expand Down Expand Up @@ -219,9 +218,8 @@ ImposeBC<dim>::test_interpolate_BC()
// check
// (the pressure is assumed to be set to 1
// on the boundary)
std::vector<bool> p_boundary_dofs(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
std::vector<bool> p_boundary_dofs(dof_handler.n_dofs());
const std::set<types::boundary_id> boundary_ids = {0};
DoFTools::extract_boundary_dofs(dof_handler,
bc_component_select,
p_boundary_dofs,
Expand Down
3 changes: 1 addition & 2 deletions tests/codim_one/boundary_indicator_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ main()

// now extract a mesh of the 5
// surface faces
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh,
boundary_mesh,
boundary_ids);
Expand Down
4 changes: 1 addition & 3 deletions tests/codim_one/data_out_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ main()
tria.set_manifold(1, surface_description);
tria.set_manifold(0, surface_description);

std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);

const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh, tria, boundary_ids);

// test for the position
Expand Down
5 changes: 2 additions & 3 deletions tests/codim_one/extract_boundary_mesh_00.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ main()

save_mesh(volume_mesh);

Triangulation<dim - 1, dim> boundary_mesh;
set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
Triangulation<dim - 1, dim> boundary_mesh;
const set<types::boundary_id> boundary_ids = {0};

surface_to_volume_mapping =
GridGenerator::extract_boundary_mesh(volume_mesh,
Expand Down
3 changes: 1 addition & 2 deletions tests/codim_one/extract_boundary_mesh_07.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ namespace Step38
Extract_Mesh_Test<spacedim>::run()
{
GridGenerator::hyper_cube(volume_mesh_triangulation);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};

space_dof_handler.distribute_dofs(space_fe);

Expand Down
3 changes: 1 addition & 2 deletions tests/codim_one/hanging_nodes_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ main()
volume_mesh.begin_active();

cell->face(0)->set_all_boundary_ids(1);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh,
boundary_mesh,
boundary_ids);
Expand Down
3 changes: 1 addition & 2 deletions tests/codim_one/hanging_nodes_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ main()
volume_mesh.begin_active();

cell->face(0)->set_all_boundary_ids(1);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh,
boundary_mesh,
boundary_ids);
Expand Down
3 changes: 1 addition & 2 deletions tests/codim_one/hanging_nodes_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ main()
volume_mesh.begin_active();

cell->face(0)->set_all_boundary_ids(1);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh,
boundary_mesh,
boundary_ids);
Expand Down
4 changes: 1 addition & 3 deletions tests/codim_one/interpolate_boundary_values_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ test()
Triangulation<dim, spacedim> tria;
Triangulation<spacedim> volume_mesh;
GridGenerator::half_hyper_ball(volume_mesh);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);

const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh, tria, boundary_ids);

deallog << tria.n_active_cells() << " active cells" << std::endl;
Expand Down
4 changes: 1 addition & 3 deletions tests/codim_one/transform_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ main()
static SphericalManifold<3 - 1, 3> surface_description;
triangulation.set_manifold(0, surface_description);

std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);

const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_mesh,
triangulation,
boundary_ids);
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_05.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ check_this(const DoFHandler<dim> &dof_handler)
// third further restrict to
// boundary indicator 0
{
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
DoFTools::extract_boundary_dofs(dof_handler,
component_select,
boundary_dofs,
Expand Down
5 changes: 2 additions & 3 deletions tests/dofs/dof_tools_09.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ void
check_this(const DoFHandler<dim> &dof_handler)
{
std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;

// check for boundary id 0 alone
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};

DoFTools::map_dof_to_boundary_indices(dof_handler, map);
for (unsigned int i = 0; i < map.size(); ++i)
deallog << (map[i] == numbers::invalid_dof_index ?
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_14.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ check_this(const DoFHandler<dim> &dof_handler)
deallog << dof_handler.n_boundary_dofs(fm) << std::endl;

// with std::set
std::set<types::boundary_id> s;
s.insert(0);
const std::set<types::boundary_id> s = {0};
deallog << dof_handler.n_boundary_dofs(s) << std::endl;
}
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_16a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ check_this(const DoFHandler<dim> &dof_handler)
return;

std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert(0);
const std::set<types::boundary_id> set = {0};
DoFTools::map_dof_to_boundary_indices(dof_handler, set, map);

// create sparsity pattern
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_16b.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ check_this(const DoFHandler<dim> &dof_handler)
return;

std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert(0);
const std::set<types::boundary_id> set = {0};
DoFTools::map_dof_to_boundary_indices(dof_handler, set, map);

// create sparsity pattern
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_16c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ check_this(const DoFHandler<dim> &dof_handler)
return;

std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert(0);
const std::set<types::boundary_id> set = {0};
DoFTools::map_dof_to_boundary_indices(dof_handler, set, map);

std::map<types::boundary_id, const Function<dim> *> boundary_ids;
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_16d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ check_this(const DoFHandler<dim> &dof_handler)
return;

std::vector<types::global_dof_index> map(dof_handler.n_dofs());
std::set<types::boundary_id> set;
set.insert(0);
const std::set<types::boundary_id> set = {0};
DoFTools::map_dof_to_boundary_indices(dof_handler, set, map);

std::map<types::boundary_id, const Function<dim> *> boundary_ids;
Expand Down
3 changes: 1 addition & 2 deletions tests/dofs/dof_tools_20.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ check_this(const DoFHandler<dim> &dof_handler)
// third further restrict to
// boundary indicator 0
{
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
DoFTools::extract_dofs_with_support_on_boundary(dof_handler,
component_select,
boundary_dofs,
Expand Down
5 changes: 2 additions & 3 deletions tests/dofs/interpolate_boundary_values_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ FindBug<dim>::dirichlet_conditions()
component_mask);


std::vector<bool> fixed_dofs(dof_handler.n_dofs());
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
std::vector<bool> fixed_dofs(dof_handler.n_dofs());
const std::set<types::boundary_id> boundary_ids = {0};

// get a list of those boundary DoFs which
// we want to be fixed:
Expand Down
3 changes: 1 addition & 2 deletions tests/examples/step-56.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ namespace Step56
// sparsity patterns and matrices for each level. The resize()
// function of MGLevelObject<T> will destroy all existing contained
// objects.
std::set<types::boundary_id> zero_boundary_ids;
zero_boundary_ids.insert(0);
const std::set<types::boundary_id> zero_boundary_ids = {0};

mg_constrained_dofs.clear();
mg_constrained_dofs.initialize(velocity_dof_handler);
Expand Down
3 changes: 1 addition & 2 deletions tests/manifold/tensor_product_manifold_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ test()
{
Triangulation<3, 3> volume_tria;
GridGenerator::cylinder(volume_tria);
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert(0);
const std::set<types::boundary_id> boundary_ids = {0};
GridGenerator::extract_boundary_mesh(volume_tria, tria, boundary_ids);
}
tria.set_all_manifold_ids(0);
Expand Down
5 changes: 2 additions & 3 deletions tests/mappings/mapping_q_eulerian_08.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@ test(const unsigned int n_ref = 0)
}

// now go through all GMG levels:
std::set<types::boundary_id> dirichlet_boundary_ids;
dirichlet_boundary_ids.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> dirichlet_boundary_ids = {0};
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary_ids);
Expand Down
5 changes: 2 additions & 3 deletions tests/mappings/mapping_q_eulerian_14.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ test(const unsigned int n_ref = 0)
}

// now go through all GMG levels:
std::set<types::boundary_id> dirichlet_boundary_ids;
dirichlet_boundary_ids.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> dirichlet_boundary_ids = {0};
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary_ids);
Expand Down
2 changes: 1 addition & 1 deletion tests/matrix_free/copy_feevaluation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test()
stokes_sub_blocks[dim] = 1;
DoFRenumbering::component_wise(dof_handler, stokes_sub_blocks);

std::set<types::boundary_id> no_normal_flux_boundaries = {1};
const std::set<types::boundary_id> no_normal_flux_boundaries = {1};
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
VectorTools::compute_no_normal_flux_constraints(
dof_handler, 0, no_normal_flux_boundaries, constraints, mapping);
Expand Down
3 changes: 1 addition & 2 deletions tests/meshworker/step-50-mesh_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,9 @@ namespace Step50
constraints.reinit(locally_relevant_set);
DoFTools::make_hanging_node_constraints(mg_dof_handler, constraints);

std::set<types::boundary_id> dirichlet_boundary_ids;
const std::set<types::boundary_id> dirichlet_boundary_ids = {0};
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ConstantFunction<dim> homogeneous_dirichlet_bc(1.0);
dirichlet_boundary_ids.insert(0);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
VectorTools::interpolate_boundary_values(mg_dof_handler,
dirichlet_boundary,
Expand Down
5 changes: 2 additions & 3 deletions tests/mpi/no_flux_constraints_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ test()
AffineConstraints<double> constraints;
constraints.reinit(relevant_set);
DoFTools::make_hanging_node_constraints(dofh, constraints);
std::set<types::boundary_id> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert(0);
const unsigned int degree = 1;
const std::set<types::boundary_id> no_normal_flux_boundaries = {0};
const unsigned int degree = 1;
VectorTools::compute_no_normal_flux_constraints(
dofh, 0, no_normal_flux_boundaries, constraints, MappingQ<dim>(degree));
constraints.close();
Expand Down
6 changes: 2 additions & 4 deletions tests/mpi/step-37.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ namespace Step37
const unsigned int nlevels = triangulation.n_global_levels();
mg_matrices.resize(0, nlevels - 1);

std::set<types::boundary_id> dirichlet_boundary;
dirichlet_boundary.insert(0);
const std::set<types::boundary_id> dirichlet_boundary = {0};
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
Expand Down Expand Up @@ -325,11 +324,10 @@ namespace Step37
DoFTools::make_hanging_node_constraints(
dof_handler, hanging_nodes_laplace_constraints);

std::set<types::boundary_id> dirichlet_boundary_ids;
const std::set<types::boundary_id> dirichlet_boundary_ids = {0};
std::map<types::boundary_id, const Function<dim> *>
dirichlet_boundary_functions;
PotentialBCFunction<dim> bc_func(240, Point<dim>());
dirichlet_boundary_ids.insert(0);
dirichlet_boundary_functions[0] = &bc_func;
VectorTools::interpolate_boundary_values(*mapping.get(),
dof_handler,
Expand Down
5 changes: 2 additions & 3 deletions tests/multigrid-global-coarsening/multigrid_a_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ test(const unsigned int n_refinements, const unsigned int fe_degree_fine)
dof_handler.distribute_dofs(*fe);
dof_handler.distribute_mg_dofs();

std::set<types::boundary_id> dirichlet_boundary;
dirichlet_boundary.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> dirichlet_boundary = {0};
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
Expand Down
5 changes: 2 additions & 3 deletions tests/multigrid-global-coarsening/multigrid_p_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ test(const unsigned int n_refinements, const unsigned int fe_degree_fine)
dof_handler.distribute_mg_dofs();

// set up constraints
std::set<types::boundary_id> dirichlet_boundary;
dirichlet_boundary.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> dirichlet_boundary = {0};
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
Expand Down
5 changes: 2 additions & 3 deletions tests/multigrid-global-coarsening/multigrid_p_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ test(const unsigned int n_refinements,
dof_handler.distribute_mg_dofs();

// set up constraints
std::set<types::boundary_id> dirichlet_boundary;
dirichlet_boundary.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> dirichlet_boundary = {0};
MGConstrainedDoFs mg_constrained_dofs;
mg_constrained_dofs.initialize(dof_handler);
mg_constrained_dofs.make_zero_boundary_constraints(dof_handler,
dirichlet_boundary);
Expand Down
6 changes: 2 additions & 4 deletions tests/multigrid/constrained_dofs_03.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ check_fe(FiniteElement<dim> &fe, ComponentMask &component_mask)
dofh.distribute_dofs(fe);
dofh.distribute_mg_dofs();

MGConstrainedDoFs mg_constrained_dofs;
std::set<types::boundary_id> boundary_indicators;

boundary_indicators.insert(0);
MGConstrainedDoFs mg_constrained_dofs;
const std::set<types::boundary_id> boundary_indicators = {0};
mg_constrained_dofs.initialize(dofh);
mg_constrained_dofs.make_zero_boundary_constraints(dofh,
boundary_indicators,
Expand Down
3 changes: 1 addition & 2 deletions tests/multigrid/interface_matrix_entry_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ test()
constraints.reinit(locally_relevant_set);
DoFTools::make_hanging_node_constraints(mg_dof_handler, constraints);

std::set<types::boundary_id> dirichlet_boundary_ids;
const std::set<types::boundary_id> dirichlet_boundary_ids = {0};
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ConstantFunction<dim> homogeneous_dirichlet_bc(0.0);
dirichlet_boundary_ids.insert(0);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
VectorTools::interpolate_boundary_values(mg_dof_handler,
dirichlet_boundary,
Expand Down

0 comments on commit 94eaf43

Please sign in to comment.