]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
test hyper_shell
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Jun 2007 21:10:32 +0000 (21:10 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 6 Jun 2007 21:10:32 +0000 (21:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@14763 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/Makefile
tests/deal.II/grid_hyper_shell.cc [new file with mode: 0644]

index e035d6199b2e9b5d7f4dd2eda00280d4f751ce64..f70f63994510b0f9f86e3b561b116176aef0ad2e 100644 (file)
@@ -38,6 +38,7 @@ tests_x = block_matrices \
        grid_test \
        grid_transform \
        grid_transform_3d \
+       grid_hyper_* \
        measure_et_al \
        normals_at_vertices \
        intergrid_constraints \
diff --git a/tests/deal.II/grid_hyper_shell.cc b/tests/deal.II/grid_hyper_shell.cc
new file mode 100644 (file)
index 0000000..7a45b20
--- /dev/null
@@ -0,0 +1,55 @@
+//----------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2007 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.
+//
+//----------------------------------------------------------------------
+
+
+#include "../tests.h"
+#include <grid/tria_boundary_lib.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_out.h>
+#include <base/logstream.h>
+#include <cmath>
+#include <cstdlib>
+
+#include <fstream>
+#include <iostream>
+
+std::ofstream logfile("grid_hyper_shell/output");
+
+
+template<int dim>
+void check (double r1, double r2, unsigned int n, bool log)
+{
+  Point<dim> center;
+  Triangulation<dim> tria;
+  GridGenerator::hyper_shell (tria, center, r1, r2, n);
+  static const HyperShellBoundary<dim> boundary(center);
+  tria.set_boundary(0, boundary);
+
+  tria.refine_global(2);
+  
+  GridOut grid_out;
+  if (log)
+    grid_out.write_eps (tria, logfile);
+  else
+    grid_out.write_dx (tria, std::cout);
+}
+
+
+int main()
+{
+  check<2> (4., 5., 10, true);
+  check<3> (3., 5., 6, true);
+}

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.