]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New tensor_product_manifold_03 test
authorStefano Dominici <sfndmn@gmail.com>
Thu, 18 Oct 2018 12:51:43 +0000 (14:51 +0200)
committerStefano Dominici <sfndmn@gmail.com>
Thu, 18 Oct 2018 12:51:43 +0000 (14:51 +0200)
This test exposes the bug and currently fails.

It attempts the assignment of a TensorProductManifold object, to a
Triangulation object, in an inner visibility scope. Once the execution
flows leaves the inner scope, the local manifold objects are destroyed
triggering a subscriptor error.

tests/manifold/tensor_product_manifold_03.cc [new file with mode: 0644]
tests/manifold/tensor_product_manifold_03.output [new file with mode: 0644]

diff --git a/tests/manifold/tensor_product_manifold_03.cc b/tests/manifold/tensor_product_manifold_03.cc
new file mode 100644 (file)
index 0000000..ecfea9c
--- /dev/null
@@ -0,0 +1,52 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 - 2017 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 the correct handling of data members within the TensorProductManifold
+// class. The test generates a general hypercube grid and, in an inner scope,
+// attempts to assign a TensorProductManifold to it. The test is succesfull if
+// it terminates without subscriptor errors or memory leaks.
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/manifold_lib.h>
+#include <deal.II/grid/tensor_product_manifold.h>
+
+#include "../tests.h"
+
+
+void
+test()
+{
+  Triangulation<3, 3> tria;
+  GridGenerator::hyper_cube(tria);
+  {
+    FunctionManifold<1, 1>                     F("x", "x");
+    PolarManifold<2, 2>                        G(Point<2>(0.5, 0.5));
+    TensorProductManifold<3, 2, 2, 2, 1, 1, 1> manifold(G, F);
+    tria.set_all_manifold_ids(0);
+    tria.set_manifold(0, manifold);
+  }
+  tria.refine_global(1);
+}
+
+
+
+int
+main()
+{
+  test();
+
+  return 0;
+}
diff --git a/tests/manifold/tensor_product_manifold_03.output b/tests/manifold/tensor_product_manifold_03.output
new file mode 100644 (file)
index 0000000..e69de29

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.