]> https://gitweb.dealii.org/ - dealii.git/commitdiff
clean up tests and use to_string()
authorTimo Heister <timo.heister@gmail.com>
Sun, 5 Jul 2015 17:33:34 +0000 (13:33 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 9 Jul 2015 18:45:57 +0000 (14:45 -0400)
tests/mpi/attach_data_01.cc
tests/mpi/mesh_worker_01.cc
tests/mpi/mesh_worker_02.cc
tests/mpi/mesh_worker_03.cc
tests/mpi/mesh_worker_04.cc
tests/mpi/mesh_worker_05.cc
tests/mpi/mesh_worker_matrix_01.cc

index f53a203bfd9bc36e585ce1d32c39195a88a489bb..081c0498ecf94e8225c291f31b2fe98fcb283c6c 100644 (file)
 
 #include <fstream>
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void pack_function (const typename parallel::distributed::Triangulation<dim,dim>::cell_iterator &cell,
                    const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
@@ -116,13 +109,13 @@ void test()
            cell != tr.end();
            ++cell)
         {
-         if (id_to_string(cell->id())=="0_1:0")
-           {         
+         if (cell->id().to_string()=="0_1:0")
+           {
              cell->set_refine_flag();
            }
-         else if (id_to_string(cell->parent()->id())=="3_0:")
+         else if (cell->parent()->id().to_string()=="3_0:")
            cell->set_coarsen_flag();
-         
+
          if (cell->is_locally_owned())
            {
              deallog << "myid=" << myid << " cellid=" << cell->id();
index 997fa8199ed964caec9192859381204a81d8c437..c58001d21c9b2143c7ff622d33d47c02c8ae0194 100644 (file)
@@ -129,13 +129,6 @@ test_simple(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 //     lctrl);
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 {
index a9048dac751eb47af8721af33d0460a14d9e4306..b4cc614654a475ce55d07d27d190cad7be7293b3 100644 (file)
@@ -128,13 +128,6 @@ test_simple(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 //     lctrl);
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 {
index 6007ee25a7dd74e181ac9c731c4cfc7228ed7d6c..4d8883530bd612e46f98e7a35b25a1c9d20f385d 100644 (file)
@@ -128,13 +128,6 @@ test_simple(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 //     lctrl);
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 {
index 3b2a72b3757484cae3418bf7f4d1765e372d4f4c..00a684982e17dc7d0f15bb799b6d927845929805 100644 (file)
@@ -129,13 +129,6 @@ test_simple(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 //     lctrl);
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 {
index 60b0ca37eb3f90ced336e99d4e509ce2966982ef..ed5c321f9617bf0492967e5f23687595d5198430 100644 (file)
@@ -130,13 +130,6 @@ test_simple(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 //     lctrl);
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 template<int dim>
 void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
 {
index 275b48e8bf5da3c16d87048be834bdcc74e30438..a350c07447f3469fdbcc1d18e7be671e7c2fadce 100644 (file)
@@ -170,13 +170,6 @@ test_simple(DoFHandler<dim> &dofs, bool faces)
   matrix.print(deallog.get_file_stream());
 }
 
-std::string id_to_string(const CellId &id)
-{
-  std::ostringstream ss;
-  ss << id;
-  return ss.str();
-}
-
 
 template<int dim>
 void
@@ -218,7 +211,7 @@ test(const FiniteElement<dim> &fe)
           f >> id;
           if (f.eof())
             break;
-          std::vector<types::global_dof_index> &d = dofmap[id_to_string(id)];
+          std::vector<types::global_dof_index> &d = dofmap[id.to_string()];
           d.reserve(fe.dofs_per_cell);
           for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
             {
@@ -234,7 +227,7 @@ test(const FiniteElement<dim> &fe)
           if (!cell->is_locally_owned())
             continue;
 
-          std::vector<types::global_dof_index>   &renumbered = dofmap[id_to_string(cell->id())];
+          std::vector<types::global_dof_index>   &renumbered = dofmap[cell->id().to_string()];
           cell->set_dof_indices(renumbered);
           cell->update_cell_dof_indices_cache();
 

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.