]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 25 Aug 2010 16:12:46 +0000 (16:12 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 25 Aug 2010 16:12:46 +0000 (16:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@21711 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/Makefile
tests/deal.II/subdomain_on_refinement.cc [new file with mode: 0644]
tests/deal.II/subdomain_on_refinement/cmp/generic [new file with mode: 0644]

index 53a5037840bc7c9d636ad2d1608768165feb3a8b..135a11efd6a244b1b3ddd16c2445794ff2ed0f3c 100644 (file)
@@ -57,7 +57,7 @@ tests_x = block_info block_matrices \
        boundaries \
        sparsity_pattern* \
        grid_tools \
-       subdomain_ids \
+       subdomain_* \
        filtered_iterator* \
        grid_in* \
        grid_in_3d \
diff --git a/tests/deal.II/subdomain_on_refinement.cc b/tests/deal.II/subdomain_on_refinement.cc
new file mode 100644 (file)
index 0000000..80d8567
--- /dev/null
@@ -0,0 +1,71 @@
+//----------------------------  subdomain_on_refinement.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005 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.
+//
+//----------------------------  subdomain_on_refinement.cc  ---------------------------
+
+// check that the subdomain id is inherited from mother to child
+
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_iterator.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
+#include <fe/fe_dgq.h>
+#include <fe/fe_q.h>
+#include <dofs/dof_tools.h>
+
+#include <fstream>
+#include <algorithm>
+#include <cmath>
+
+
+std::ofstream logfile("subdomain_on_refinement/output");
+
+
+DeclException2 (ExcNumberMismatch,
+               int, int,
+               << "The numbers " << arg1 << " and " << arg2
+               << " should be equal, but are not.");
+
+
+template <int dim>
+void test ()
+{
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube(tria, -1, 1);
+  tria.begin_active()->set_subdomain_id (42);
+  tria.refine_global (2);
+  typename Triangulation<dim>::active_cell_iterator
+    cell = tria.begin_active (),
+    endc = tria.end ();
+  for (; cell!=endc; ++cell)
+    Assert (cell->subdomain_id() == 42,
+           ExcInternalError());
+  deallog << "OK" << std::endl;
+}
+
+
+int main ()
+{
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<1> ();
+  test<2> ();
+  test<3> ();
+  
+  return 0;
+}
diff --git a/tests/deal.II/subdomain_on_refinement/cmp/generic b/tests/deal.II/subdomain_on_refinement/cmp/generic
new file mode 100644 (file)
index 0000000..fb71de2
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::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.