]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test for boundary ids for GridGenerator::half_hyper_shell 9448/head
authorGraham Harper <grahambenharper@gmail.com>
Thu, 30 Jan 2020 04:32:52 +0000 (21:32 -0700)
committergrahambenharper <grahambenharper@gmail.com>
Thu, 30 Jan 2020 16:41:34 +0000 (09:41 -0700)
tests/grid/grid_generator_half_hyper_shell.cc [new file with mode: 0644]
tests/grid/grid_generator_half_hyper_shell.output [new file with mode: 0644]

diff --git a/tests/grid/grid_generator_half_hyper_shell.cc b/tests/grid/grid_generator_half_hyper_shell.cc
new file mode 100644 (file)
index 0000000..119430e
--- /dev/null
@@ -0,0 +1,59 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2005 - 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+// Test boundary ids for GridGenerator::half_hyper_shell()
+
+#include <deal.II/base/tensor.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/grid/tria.h>
+
+#include "../tests.h"
+
+
+template <int dim>
+void
+dim_test()
+{
+  Triangulation<dim> tr;
+  double             r_inner = 1.;
+  double             r_outer = 2.;
+
+  GridGenerator::half_hyper_shell(tr, Point<dim>(), r_inner, r_outer, 0, true);
+
+  typename Triangulation<dim>::cell_iterator cell = tr.begin();
+
+  for (; cell != tr.end(); ++cell)
+    {
+      for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+        {
+          if (cell->face(f)->at_boundary())
+            deallog << "half_hyper_shell<" << dim << ">:: cell "
+                    << cell->index() << ", face " << f << ", id "
+                    << cell->face(f)->boundary_id() << std::endl;
+        }
+    }
+}
+
+
+int
+main()
+{
+  initlog();
+
+  dim_test<2>();
+  dim_test<3>();
+}
diff --git a/tests/grid/grid_generator_half_hyper_shell.output b/tests/grid/grid_generator_half_hyper_shell.output
new file mode 100644 (file)
index 0000000..9cc562e
--- /dev/null
@@ -0,0 +1,27 @@
+
+DEAL::half_hyper_shell<2>:: cell 0, face 0, id 3
+DEAL::half_hyper_shell<2>:: cell 0, face 2, id 1
+DEAL::half_hyper_shell<2>:: cell 0, face 3, id 0
+DEAL::half_hyper_shell<2>:: cell 1, face 2, id 1
+DEAL::half_hyper_shell<2>:: cell 1, face 3, id 0
+DEAL::half_hyper_shell<2>:: cell 2, face 2, id 1
+DEAL::half_hyper_shell<2>:: cell 2, face 3, id 0
+DEAL::half_hyper_shell<2>:: cell 3, face 2, id 1
+DEAL::half_hyper_shell<2>:: cell 3, face 3, id 0
+DEAL::half_hyper_shell<2>:: cell 4, face 1, id 2
+DEAL::half_hyper_shell<2>:: cell 4, face 2, id 1
+DEAL::half_hyper_shell<2>:: cell 4, face 3, id 0
+DEAL::half_hyper_shell<3>:: cell 0, face 2, id 2
+DEAL::half_hyper_shell<3>:: cell 0, face 4, id 0
+DEAL::half_hyper_shell<3>:: cell 0, face 5, id 0
+DEAL::half_hyper_shell<3>:: cell 1, face 0, id 0
+DEAL::half_hyper_shell<3>:: cell 1, face 1, id 0
+DEAL::half_hyper_shell<3>:: cell 1, face 2, id 2
+DEAL::half_hyper_shell<3>:: cell 2, face 2, id 2
+DEAL::half_hyper_shell<3>:: cell 2, face 4, id 0
+DEAL::half_hyper_shell<3>:: cell 2, face 5, id 0
+DEAL::half_hyper_shell<3>:: cell 3, face 0, id 0
+DEAL::half_hyper_shell<3>:: cell 3, face 1, id 0
+DEAL::half_hyper_shell<3>:: cell 3, face 2, id 2
+DEAL::half_hyper_shell<3>:: cell 4, face 0, id 1
+DEAL::half_hyper_shell<3>:: cell 4, face 1, id 0

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.