From 2a249072eed49639a7e939d4eb2d2a2e07129c53 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 27 Oct 2016 16:21:24 -0500 Subject: [PATCH] Treat types::subdomain_id consistently throughout the testsuite. --- tests/bits/subdomain_ids_01.cc | 4 ++-- tests/bits/subdomain_ids_02.cc | 4 ++-- tests/bits/subdomain_ids_04.cc | 4 ++-- tests/bits/subdomain_ids_05.cc | 4 ++-- tests/bits/subdomain_ids_06.cc | 4 ++-- tests/bits/subdomain_ids_07.cc | 4 ++-- tests/mpi/p4est_2d_coarse_01.cc | 5 ++--- tests/mpi/p4est_2d_ghost_01.cc | 5 ++--- tests/mpi/p4est_2d_ghost_02.cc | 5 ++--- tests/mpi/p4est_2d_refine_01.cc | 5 ++--- tests/mpi/p4est_3d_ghost_01.cc | 5 ++--- tests/mpi/tria_ghost_owners_01.cc | 16 ++++++++-------- tests/mpi/tria_ghost_owners_02.cc | 16 ++++++++-------- 13 files changed, 38 insertions(+), 43 deletions(-) diff --git a/tests/bits/subdomain_ids_01.cc b/tests/bits/subdomain_ids_01.cc index 697f3b2d09..6752dbe3c7 100644 --- a/tests/bits/subdomain_ids_01.cc +++ b/tests/bits/subdomain_ids_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2001 - 2015 by the deal.II authors +// Copyright (C) 2001 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -73,7 +73,7 @@ void test () deallog << dof_handler.n_dofs() << std::endl; std::vector selected_dofs (dof_handler.n_dofs()); - for (unsigned int subdomain=0; subdomain<(1< subdomain_association (dof_handler.n_dofs()); + std::vector subdomain_association (dof_handler.n_dofs()); DoFTools::get_subdomain_association (dof_handler, subdomain_association); for (unsigned int subdomain=0; subdomain<(1< subdomain_association (dof_handler.n_dofs()); + std::vector subdomain_association (dof_handler.n_dofs()); DoFTools::get_subdomain_association (dof_handler, subdomain_association); for (unsigned int i=0; i subdomain_association (dof_handler.n_dofs()); + std::vector subdomain_association (dof_handler.n_dofs()); DoFTools::get_subdomain_association (dof_handler, subdomain_association); for (unsigned int subdomain=0; subdomain<(1<set_subdomain_id (subdomain); } - std::vector subdomain_association (tria.n_active_cells()); + std::vector subdomain_association (tria.n_active_cells()); GridTools::get_subdomain_association (tria, subdomain_association); for (unsigned int subdomain=0; subdomain<(1< subdomain_association (dof_handler.n_dofs()); + std::vector subdomain_association (dof_handler.n_dofs()); DoFTools::get_subdomain_association (dof_handler, subdomain_association); for (unsigned int subdomain=0; subdomain<(1<subdomain_id() << std::endl; -// std::vector< unsigned int > cell_subd; -// cell_subd.resize(tr.n_active_cells()); +// std::vector cell_subd(tr.n_active_cells()); // GridTools::get_subdomain_association(tr, cell_subd); // for (unsigned int i=0;i cell_subd; - cell_subd.resize(tr.n_active_cells()); + std::vector cell_subd(tr.n_active_cells()); GridTools::get_subdomain_association(tr, cell_subd); for (unsigned int i=0; i cell_subd; - cell_subd.resize(tr.n_active_cells()); + std::vector cell_subd(tr.n_active_cells()); GridTools::get_subdomain_association(tr, cell_subd); for (unsigned int i=0; i cell_subd; - cell_subd.resize(tr.n_active_cells()); + std::vector cell_subd(tr.n_active_cells()); GridTools::get_subdomain_association(tr, cell_subd); if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) diff --git a/tests/mpi/p4est_3d_ghost_01.cc b/tests/mpi/p4est_3d_ghost_01.cc index 37cd1b7fc8..acecad8001 100644 --- a/tests/mpi/p4est_3d_ghost_01.cc +++ b/tests/mpi/p4est_3d_ghost_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2009 - 2015 by the deal.II authors +// Copyright (C) 2009 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -61,8 +61,7 @@ void test() if (myid==0) { - std::vector< unsigned int > cell_subd; - cell_subd.resize(tr.n_active_cells()); + std::vector cell_subd(tr.n_active_cells()); GridTools::get_subdomain_association(tr, cell_subd); for (unsigned int i=0; i &s) +void mpi_check(const std::set &s) { MPI_Barrier(MPI_COMM_WORLD); unsigned int tag = 1234; - for (std::set::iterator it = s.begin(); + for (std::set::iterator it = s.begin(); it != s.end(); ++it) MPI_Send(NULL, 0, MPI_INT, *it, tag, MPI_COMM_WORLD); @@ -84,16 +84,16 @@ void test() deallog << "* cycle " << ref << std::endl; deallog << "ghost owners: "; - std::set ghost_owners = tr.ghost_owners(); - for (std::set::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it) + std::set ghost_owners = tr.ghost_owners(); + for (std::set::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it) deallog << *it << " "; deallog << std::endl; mpi_check(ghost_owners); deallog << "level ghost owners: "; - std::set level_ghost_owners = tr.level_ghost_owners(); - for (std::set::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it) + std::set level_ghost_owners = tr.level_ghost_owners(); + for (std::set::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it) deallog << *it << " "; deallog << std::endl; @@ -104,7 +104,7 @@ void test() Assert(is_subset, ExcInternalError()); Vector indicators (tr.n_active_cells()); - std::set neighbors; + std::set neighbors; { for (typename Triangulation::active_cell_iterator cell = tr.begin_active(); cell != tr.end(); ++cell) diff --git a/tests/mpi/tria_ghost_owners_02.cc b/tests/mpi/tria_ghost_owners_02.cc index 23d0fa438c..0afc062003 100644 --- a/tests/mpi/tria_ghost_owners_02.cc +++ b/tests/mpi/tria_ghost_owners_02.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2009 - 2015 by the deal.II authors +// Copyright (C) 2009 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -40,11 +40,11 @@ // make sure if i is in s on proc j, j is in s on proc i -void mpi_check(const std::set &s) +void mpi_check(const std::set &s) { MPI_Barrier(MPI_COMM_WORLD); unsigned int tag = 1234; - for (std::set::iterator it = s.begin(); + for (std::set::iterator it = s.begin(); it != s.end(); ++it) MPI_Send(NULL, 0, MPI_INT, *it, tag, MPI_COMM_WORLD); @@ -77,16 +77,16 @@ void test() deallog << "* cycle " << ref << std::endl; deallog << "ghost owners: "; - std::set ghost_owners = tr.ghost_owners(); - for (std::set::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it) + std::set ghost_owners = tr.ghost_owners(); + for (std::set::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it) deallog << *it << " "; deallog << std::endl; mpi_check(ghost_owners); deallog << "level ghost owners: "; - std::set level_ghost_owners = tr.level_ghost_owners(); - for (std::set::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it) + std::set level_ghost_owners = tr.level_ghost_owners(); + for (std::set::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it) deallog << *it << " "; deallog << std::endl; @@ -97,7 +97,7 @@ void test() Assert(is_subset, ExcInternalError()); Vector indicators (tr.n_active_cells()); - std::set neighbors; + std::set neighbors; { for (typename Triangulation::active_cell_iterator cell = tr.begin_active(); cell != tr.end(); ++cell) -- 2.39.5