]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added a simple test for the hpDoFHandler, which tests the behaviour
authoroliver <oliver@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Dec 2005 22:08:16 +0000 (22:08 +0000)
committeroliver <oliver@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Dec 2005 22:08:16 +0000 (22:08 +0000)
when coarsening and refining is applied to the triangulation.

git-svn-id: https://svn.dealii.org/trunk@11900 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/Makefile [new file with mode: 0644]
tests/hp/hp_dof_handler.cc [new file with mode: 0644]
tests/hp/hp_dof_handler/cmp/generic [new file with mode: 0644]

diff --git a/tests/hp/Makefile b/tests/hp/Makefile
new file mode 100644 (file)
index 0000000..cb96e01
--- /dev/null
@@ -0,0 +1,37 @@
+############################################################
+# $Id$
+# Copyright (C) 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+############################################################
+
+############################################################
+# Include general settings for including DEAL libraries
+############################################################
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+debug-mode = on
+
+libraries = $(lib-deal2-1d.g) \
+            $(lib-deal2-2d.g) \
+            $(lib-deal2-3d.g) \
+            $(lib-lac.g)  \
+            $(lib-base.g)
+
+default: run-tests 
+
+############################################################
+
+tests_x = hp_dof_handler
+
+# from above list of regular expressions, generate the real set of
+# tests
+expand = $(shell echo $(addsuffix .cc,$(1)) \
+           | $(PERL) -pi -e 's/\.cc//g;')
+tests = $(call expand,$(tests_x))
+
+############################################################
+
+
+include ../Makefile.rules
+include Makefile.depend
+include Makefile.tests
diff --git a/tests/hp/hp_dof_handler.cc b/tests/hp/hp_dof_handler.cc
new file mode 100644 (file)
index 0000000..a31c6d3
--- /dev/null
@@ -0,0 +1,60 @@
+//----------------------------  mg_dof_handler.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 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.
+//
+//----------------------------  mg_dof_handler.cc  ---------------------------
+
+
+/* Author: Ralf Hartmann, 2005, O. Kayser-Herold, simply modified
+  the mg_dof_handler.cc test for the hpDoFHandler. */
+
+#include <base/logstream.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_accessor.h>
+#include <grid/grid_out.h>
+#include <fe/fe_dgq.h>
+#include <dofs/hp_dof_handler.h>
+
+#include <fstream>
+
+
+int main ()
+{
+  std::ofstream logfile("hp_dof_handler/output");
+  logfile.precision(2);
+  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const unsigned int dim=2;
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube(tria);
+
+  FECollection<dim> fe_collection;
+  fe_collection.add_fe (FE_DGQ<dim> (1));
+
+  hpDoFHandler<dim> dof_handler(tria);
+  
+  tria.begin_active()->set_refine_flag();
+  tria.execute_coarsening_and_refinement();
+
+  Triangulation<dim>::active_cell_iterator
+    cell=tria.begin_active(),
+    endc=tria.end();
+  for (; cell!=endc; ++cell)
+    cell->set_coarsen_flag();
+  tria.execute_coarsening_and_refinement();
+
+  dof_handler.distribute_dofs(fe_collection);
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/hp/hp_dof_handler/cmp/generic b/tests/hp/hp_dof_handler/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+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.