]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add new test directory, add failing test
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Mar 2013 21:25:29 +0000 (21:25 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Mar 2013 21:25:29 +0000 (21:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@28767 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f5d0503d22381110f5e2be17141264431802153d..f861ceb40357aced7f34d20edbcf11a39aec8c53 100644 (file)
@@ -13,6 +13,7 @@ nofail-dirs = a-framework       \
               deal.II           \
               integrators       \
               multigrid         \
+              grid              \
               bits              \
               hp                \
               matrix_free       \
diff --git a/tests/grid/Makefile b/tests/grid/Makefile
new file mode 100644 (file)
index 0000000..3dc8d02
--- /dev/null
@@ -0,0 +1,10 @@
+############################################################
+# Makefile,v 1.15 2002/06/13 12:51:13 hartmann Exp
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+############################################################
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+include ../Makefile.rules
+-include Makefile.depend
+-include Makefile.tests
diff --git a/tests/grid/refine_and_coarsen_01.cc b/tests/grid/refine_and_coarsen_01.cc
new file mode 100644 (file)
index 0000000..d38a70e
--- /dev/null
@@ -0,0 +1,73 @@
+//----------------------------  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 that refine_and_coarsen_fixed_fraction behaves correctly
+// if all the indicators are the same.
+
+#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/grid/tria_accessor.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_refinement.h>
+
+#include <fstream>
+
+
+
+template <int dim>
+void check ()
+{
+  Triangulation<dim> tria;
+  GridGenerator::hyper_cube (tria);
+  tria.refine_global (2);
+
+  Vector<float> estimated_error_per_cell;
+  estimated_error_per_cell.reinit(tria.n_active_cells());
+  for (unsigned int j=0; j<estimated_error_per_cell.size(); ++j)
+      estimated_error_per_cell(j)= 1.;
+
+  deallog << "n_active_cells: " << tria.n_active_cells() << std::endl;
+  
+  
+  GridRefinement::refine_and_coarsen_fixed_fraction (tria,
+                                                    estimated_error_per_cell,
+                                                    0.1, 0);
+  tria.execute_coarsening_and_refinement ();
+
+  deallog << "n_active_cells: " << tria.n_active_cells() << std::endl;
+  
+  deallog << "OK for " << dim << "d" << std::endl;
+}
+
+
+int main () 
+{
+  std::ofstream logfile("refine_and_coarsen_01/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  check<1> ();
+  check<2> ();
+  check<3> ();
+}
+
+  
+  
diff --git a/tests/grid/refine_and_coarsen_01/cmp/generic b/tests/grid/refine_and_coarsen_01/cmp/generic
new file mode 100644 (file)
index 0000000..292df5f
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK for 1d
+DEAL::OK for 2d
+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.