]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Treat types::subdomain_id consistently throughout the testsuite. 3300/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Oct 2016 21:21:24 +0000 (16:21 -0500)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Oct 2016 21:21:24 +0000 (16:21 -0500)
13 files changed:
tests/bits/subdomain_ids_01.cc
tests/bits/subdomain_ids_02.cc
tests/bits/subdomain_ids_04.cc
tests/bits/subdomain_ids_05.cc
tests/bits/subdomain_ids_06.cc
tests/bits/subdomain_ids_07.cc
tests/mpi/p4est_2d_coarse_01.cc
tests/mpi/p4est_2d_ghost_01.cc
tests/mpi/p4est_2d_ghost_02.cc
tests/mpi/p4est_2d_refine_01.cc
tests/mpi/p4est_3d_ghost_01.cc
tests/mpi/tria_ghost_owners_01.cc
tests/mpi/tria_ghost_owners_02.cc

index 697f3b2d09c2334671bfb700b1988d4da07d04f1..6752dbe3c7fab0a3d803b0af9de1af846d74b4c1 100644 (file)
@@ -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<bool> selected_dofs (dof_handler.n_dofs());
-  for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
+  for (types::subdomain_id subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
       // count number on dofs on
       // subdomain. note that they add up to
index 090e34859787fa8519dd75884dd8df01b90164e1..74b54566972c14dfca2c70b5d7e0904b3cb3ca4a 100644 (file)
@@ -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.
 //
@@ -72,7 +72,7 @@ void test ()
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
 
-  std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
+  std::vector<types::subdomain_id> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler,
                                        subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
index 2ab9f81caa688baf0042b96a21e934fea57dd1cc..8de740f29c949b484a06246f23468d8c231e78a8 100644 (file)
@@ -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.
 //
@@ -82,7 +82,7 @@ void test ()
   // subdomain numbers. first output these
   // numbers, then also check that this is
   // indeed so
-  std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
+  std::vector<types::subdomain_id> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler, subdomain_association);
 
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
index 0f45eab2590beb185f090b4873f6b63d445c1331..0978077f3eac674da603d8a0344c2ebad1478c17 100644 (file)
@@ -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.
 //
@@ -72,7 +72,7 @@ void test ()
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
 
-  std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
+  std::vector<types::subdomain_id> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler,
                                        subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
index 32318f2fe7ee839d5ba7ffb7405bf3bd49f265f0..e973e3a44792f6cc597ad9c74212a80d5e754ca7 100644 (file)
@@ -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.
 //
@@ -65,7 +65,7 @@ void test ()
       cell->set_subdomain_id (subdomain);
     }
 
-  std::vector<unsigned int> subdomain_association (tria.n_active_cells());
+  std::vector<types::subdomain_id> subdomain_association (tria.n_active_cells());
   GridTools::get_subdomain_association (tria,
                                         subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
index e2b6bcab578ac48d601f4cc7a8cca8603f47f40b..1e07f17ecae024f7d45a6cf801dc866eea3163c8 100644 (file)
@@ -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.
 //
@@ -72,7 +72,7 @@ void test ()
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
 
-  std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
+  std::vector<types::subdomain_id> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler,
                                        subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
index 5a4a89045ed629bc0bf729885114a7b1dae618d8..2815b5510e90ac4ab3061000a08d0de564b87ff1 100644 (file)
@@ -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()
                 << tr.begin_active()->subdomain_id()
                 << std::endl;
 
-//      std::vector< unsigned int > cell_subd;
-//      cell_subd.resize(tr.n_active_cells());
+//      std::vector<types::subdomain_id> cell_subd(tr.n_active_cells());
 
 //      GridTools::get_subdomain_association(tr, cell_subd);
 //       for (unsigned int i=0;i<tr.n_active_cells();++i)
index 022582b09190e22660ec287d403ecaf1c6f07e8f..a0efb9294a5feedc4b678a9e93bc5de19352d425 100644 (file)
@@ -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.
 //
@@ -50,8 +50,7 @@ void test()
       if (myid==0)
         {
 
-          std::vector< unsigned int > cell_subd;
-          cell_subd.resize(tr.n_active_cells());
+          std::vector<types::subdomain_id> cell_subd(tr.n_active_cells());
 
           GridTools::get_subdomain_association(tr, cell_subd);
           for (unsigned int i=0; i<tr.n_active_cells(); ++i)
index 7d91d97ee2c16e8ba274abedd27c9d0fe0249750..b3bc511126aaefc426ccdfdf1b135b46795a922a 100644 (file)
@@ -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.
 //
@@ -56,8 +56,7 @@ void test()
           if (myid==0)
             {
 
-              std::vector< unsigned int > cell_subd;
-              cell_subd.resize(tr.n_active_cells());
+              std::vector<types::subdomain_id> cell_subd(tr.n_active_cells());
 
               GridTools::get_subdomain_association(tr, cell_subd);
               for (unsigned int i=0; i<tr.n_active_cells(); ++i)
index 83af42e359b1ca67e77e0abbfeb8de91c4e4ba34..677bbb73029aeca2f3085989fccaf6b1e15962b2 100644 (file)
@@ -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.
 //
@@ -47,8 +47,7 @@ void test()
       GridGenerator::hyper_cube(tr);
       tr.refine_global(1);
 
-      std::vector< unsigned int > cell_subd;
-      cell_subd.resize(tr.n_active_cells());
+      std::vector<types::subdomain_id> cell_subd(tr.n_active_cells());
 
       GridTools::get_subdomain_association(tr, cell_subd);
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index 37cd1b7fc8b42c8f8b38fc8f55a9fcd51b20b960..acecad8001567f5ce06a5b328b0ab2e2af3d5d77 100644 (file)
@@ -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<types::subdomain_id> cell_subd(tr.n_active_cells());
 
           GridTools::get_subdomain_association(tr, cell_subd);
           for (unsigned int i=0; i<tr.n_active_cells(); ++i)
index 73464c24fea8e2c85b2ed1fd34e5bb86166e79b3..2ebb9c7fc07f4d600331cc677e0669c3b36ab519 100644 (file)
@@ -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.
 //
 
 
 // make sure if i is in s on proc j, j is in s on proc i
-void mpi_check(const std::set<unsigned int> &s)
+void mpi_check(const std::set<types::subdomain_id> &s)
 {
   MPI_Barrier(MPI_COMM_WORLD);
   unsigned int tag = 1234;
-  for (std::set<unsigned int>::iterator it = s.begin();
+  for (std::set<types::subdomain_id>::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<unsigned int> ghost_owners = tr.ghost_owners();
-      for (std::set<unsigned int>::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it)
+      std::set<types::subdomain_id> ghost_owners = tr.ghost_owners();
+      for (std::set<types::subdomain_id>::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<unsigned int> level_ghost_owners = tr.level_ghost_owners();
-      for (std::set<unsigned int>::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it)
+      std::set<types::subdomain_id> level_ghost_owners = tr.level_ghost_owners();
+      for (std::set<types::subdomain_id>::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<float> indicators (tr.n_active_cells());
-      std::set<unsigned int> neighbors;
+      std::set<types::subdomain_id> neighbors;
       {
         for (typename Triangulation<dim>::active_cell_iterator
              cell = tr.begin_active(); cell != tr.end(); ++cell)
index 23d0fa438cac4e509dafd016de87e27777c77c0e..0afc062003359017b790e27b1a12a9f7d16caa0c 100644 (file)
@@ -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.
 //
 
 
 // make sure if i is in s on proc j, j is in s on proc i
-void mpi_check(const std::set<unsigned int> &s)
+void mpi_check(const std::set<types::subdomain_id> &s)
 {
   MPI_Barrier(MPI_COMM_WORLD);
   unsigned int tag = 1234;
-  for (std::set<unsigned int>::iterator it = s.begin();
+  for (std::set<types::subdomain_id>::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<unsigned int> ghost_owners = tr.ghost_owners();
-      for (std::set<unsigned int>::iterator it = ghost_owners.begin(); it!=ghost_owners.end(); ++it)
+      std::set<types::subdomain_id> ghost_owners = tr.ghost_owners();
+      for (std::set<types::subdomain_id>::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<unsigned int> level_ghost_owners = tr.level_ghost_owners();
-      for (std::set<unsigned int>::iterator it = level_ghost_owners.begin(); it!=level_ghost_owners.end(); ++it)
+      std::set<types::subdomain_id> level_ghost_owners = tr.level_ghost_owners();
+      for (std::set<types::subdomain_id>::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<float> indicators (tr.n_active_cells());
-      std::set<unsigned int> neighbors;
+      std::set<types::subdomain_id> neighbors;
       {
         for (typename Triangulation<dim>::active_cell_iterator
              cell = tr.begin_active(); cell != tr.end(); ++cell)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.