]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 3 Sep 2011 00:04:52 +0000 (00:04 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 3 Sep 2011 00:04:52 +0000 (00:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@24244 0785d39b-7218-0410-832d-ea1e28bc413d

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

diff --git a/tests/deal.II/grid_tools_02.cc b/tests/deal.II/grid_tools_02.cc
new file mode 100644 (file)
index 0000000..1169640
--- /dev/null
@@ -0,0 +1,69 @@
+//----------------------------  grid_tools.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 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.
+//
+//----------------------------  grid_tools.cc  ---------------------------
+
+
+// check GridTools::diameter for codim-1 meshes
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+#include <iomanip>
+
+std::ofstream logfile("grid_tools_02/output");
+
+
+
+template <int dim>
+void test1 ()
+{
+                                  // test 1: hypercube
+  if (true)
+    {
+      Triangulation<dim,dim+1> tria;
+      GridGenerator::hyper_cube(tria);
+
+      for (unsigned int i=0; i<2; ++i)
+       {
+         tria.refine_global(2);
+         deallog << dim << "d, "
+                 << "hypercube diameter, "
+                 << i*2
+                 << " refinements: "
+                 << GridTools::diameter (tria)
+                 << std::endl;
+       }
+    }
+}
+
+
+
+int main ()
+{
+  deallog << std::setprecision(4);
+  logfile << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test1<1> ();
+  test1<2> ();
+
+  return 0;
+}
+
diff --git a/tests/deal.II/grid_tools_02/cmp/generic b/tests/deal.II/grid_tools_02/cmp/generic
new file mode 100644 (file)
index 0000000..2513d56
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL::1d, hypercube diameter, 0 refinements: 1.000
+DEAL::1d, hypercube diameter, 2 refinements: 1.000
+DEAL::2d, hypercube diameter, 0 refinements: 1.414
+DEAL::2d, hypercube diameter, 2 refinements: 1.414

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.