]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add failing test
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 May 2013 08:24:07 +0000 (08:24 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 May 2013 08:24:07 +0000 (08:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@29586 0785d39b-7218-0410-832d-ea1e28bc413d

tests/grid/subdomain_id_01.cc [new file with mode: 0644]
tests/grid/subdomain_id_01/cmp/generic [new file with mode: 0644]

diff --git a/tests/grid/subdomain_id_01.cc b/tests/grid/subdomain_id_01.cc
new file mode 100644 (file)
index 0000000..0881a69
--- /dev/null
@@ -0,0 +1,72 @@
+//----------------------------  refine_and_coarsen_3d.cc  ---------------------------
+//    $Id: refine_and_coarsen_for_parents_02.cc 23710 2011-05-17 04:50:10Z bangerth $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2010 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.
+//
+//-----------------------  refine_and_coarsen_for_parents_02.cc  ----------------------
+
+
+// check (level)subdomain_id(). Should be =0.
+
+#include "../tests.h"
+
+#include <deal.II/base/geometry_info.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_accessor.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_refinement.h>
+
+#include <fstream>
+
+
+
+template <class TRIA>
+void check (TRIA & tr)
+{
+  typename TRIA::cell_iterator cell = tr.begin(),
+        endc = tr.end();
+  
+  for (; cell!=endc; ++cell)
+    {
+      deallog << cell->level_subdomain_id()
+             << " " << cell->subdomain_id() << std::endl;
+    }
+  
+  deallog << "OK" << std::endl;
+}
+
+
+int main (int argc, char *argv[]) 
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+  std::ofstream logfile("subdomain_id_01/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  Triangulation<2> tria;
+
+  deallog << tria.locally_owned_subdomain() << std::endl;
+  
+  
+  parallel::distributed::Triangulation<2> tria2(MPI_COMM_WORLD);
+  GridGenerator::hyper_cube (tria);
+  tria.refine_global (2);
+  GridGenerator::hyper_cube (tria2);
+  tria2.refine_global (2);
+  check(tria);
+  check(tria2);
+}
+
+  
+  
diff --git a/tests/grid/subdomain_id_01/cmp/generic b/tests/grid/subdomain_id_01/cmp/generic
new file mode 100644 (file)
index 0000000..521a63a
--- /dev/null
@@ -0,0 +1,10 @@
+
+DEAL::n_active_cells: 4
+DEAL::n_active_cells: 5
+DEAL::OK for 1d
+DEAL::n_active_cells: 16
+DEAL::n_active_cells: 28
+DEAL::OK for 2d
+DEAL::n_active_cells: 64
+DEAL::n_active_cells: 176
+DEAL::OK for 3d

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.