]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add failing test
authorTimo Heister <timo.heister@gmail.com>
Sun, 26 May 2013 13:59:55 +0000 (13:59 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sun, 26 May 2013 13:59:55 +0000 (13:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@29605 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/tria_01.cc [new file with mode: 0644]
tests/mpi/tria_01/ncpu_10/cmp/generic [new file with mode: 0644]
tests/mpi/tria_01/ncpu_2/cmp/generic [new file with mode: 0644]
tests/mpi/tria_01/ncpu_4/cmp/generic [new file with mode: 0644]

diff --git a/tests/mpi/tria_01.cc b/tests/mpi/tria_01.cc
new file mode 100644 (file)
index 0000000..4417c12
--- /dev/null
@@ -0,0 +1,95 @@
+//---------------------------------------------------------------------------
+//    $Id: p4est_2d_coarse_01.cc 29074 2013-03-27 14:53:45Z heister $
+//    Version: $Name$
+//
+//    Copyright (C) 2009, 2010, 2011 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+// test n_levels and iterators on those levels
+// begin(i) should work even if we have no cells on that level
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/grid_in.h>
+#include <deal.II/base/utilities.h>
+
+
+#include <fstream>
+
+
+template<int dim>
+void test()
+{
+  unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
+  GridGenerator::hyper_cube(tr);
+  tr.refine_global(1);
+  if (myid == 0)
+    deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+  
+  deallog << "proc " << myid << ", n levels " << tr.n_levels() << std::endl;
+  deallog << "proc " << myid << ", n gobal levels " << tr.n_global_levels() << std::endl;
+  
+  deallog << "begin().cell_index " << tr.begin()->index() << std::endl;
+  deallog << "begin(0).cell_index " << tr.begin(0)->index() << std::endl;
+  
+  deallog << "begin(1)==end(1)? " << (tr.begin(1)==tr.end(1)) << std::endl;
+
+  if (myid!=0)
+    Assert(tr.begin(1)==tr.end(1), ExcInternalError());  
+  
+  deallog << "subdomainid = "
+         << tr.begin_active()->subdomain_id()
+         << std::endl;
+  
+  const unsigned int checksum = tr.get_checksum ();
+  if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+    deallog << "Checksum: "
+           << checksum
+           << std::endl;
+
+  if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+    deallog << "OK" << std::endl;
+}
+
+
+int main(int argc, char *argv[])
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+
+  unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+
+  deallog.push(Utilities::int_to_string(myid));
+
+  if (myid == 0)
+    {
+      std::ofstream logfile(output_file_for_mpi("tria_01").c_str());
+      deallog.attach(logfile);
+      deallog.depth_console(0);
+      deallog.threshold_double(1.e-10);
+
+      deallog.push("2d");
+      test<2>();
+      deallog.pop();
+    }
+  else
+    test<2>();
+
+}
diff --git a/tests/mpi/tria_01/ncpu_10/cmp/generic b/tests/mpi/tria_01/ncpu_10/cmp/generic
new file mode 100644 (file)
index 0000000..106d06a
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL:0:2d::subdomainid = 0
+DEAL:0:2d::#cells = 29035
+DEAL:0:2d::Checksum: 1364131841
+DEAL:0:2d::OK
diff --git a/tests/mpi/tria_01/ncpu_2/cmp/generic b/tests/mpi/tria_01/ncpu_2/cmp/generic
new file mode 100644 (file)
index 0000000..106d06a
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL:0:2d::subdomainid = 0
+DEAL:0:2d::#cells = 29035
+DEAL:0:2d::Checksum: 1364131841
+DEAL:0:2d::OK
diff --git a/tests/mpi/tria_01/ncpu_4/cmp/generic b/tests/mpi/tria_01/ncpu_4/cmp/generic
new file mode 100644 (file)
index 0000000..106d06a
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL:0:2d::subdomainid = 0
+DEAL:0:2d::#cells = 29035
+DEAL:0:2d::Checksum: 1364131841
+DEAL:0:2d::OK

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.