]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Failing test in mapping q eulerian. 6330/head
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 25 Apr 2018 13:00:42 +0000 (15:00 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 27 Apr 2018 12:05:42 +0000 (14:05 +0200)
tests/mappings/mapping_q_eulerian_10.cc [new file with mode: 0644]
tests/mappings/mapping_q_eulerian_10.output [new file with mode: 0644]

diff --git a/tests/mappings/mapping_q_eulerian_10.cc b/tests/mappings/mapping_q_eulerian_10.cc
new file mode 100644 (file)
index 0000000..a72e3b6
--- /dev/null
@@ -0,0 +1,71 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2001 - 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 at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// Check that it is possible to perform two consecutive distribute dofs
+// when using MappingQEulerian
+
+#include "../tests.h"
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/geometry_info.h>
+#include<deal.II/dofs/dof_handler.h>
+#include<deal.II/dofs/dof_accessor.h>
+#include<deal.II/dofs/dof_tools.h>
+#include<deal.II/fe/fe_q.h>
+#include<deal.II/fe/fe_values.h>
+#include<deal.II/fe/fe_system.h>
+#include<deal.II/fe/mapping_q1_eulerian.h>
+#include<deal.II/fe/mapping_q1.h>
+#include <deal.II/fe/mapping_q_eulerian.h>
+#include <deal.II/grid/grid_generator.h>
+#include<deal.II/numerics/vector_tools.h>
+
+template<int dim, int spacedim>
+void test()
+{
+  Triangulation<dim,spacedim> tria;
+  GridGenerator::hyper_cube (tria);
+
+  FESystem<dim,spacedim> fe(FE_Q<dim,spacedim>(1), spacedim);
+  DoFHandler<dim,spacedim> dh(tria);
+
+  dh.distribute_dofs(fe);
+
+  deallog << "dim, spacedim: " << dim << ", " << spacedim << std::endl
+          << "cells: " << tria.n_active_cells() << ", dofs: "
+          << dh.n_dofs() <<std::endl;
+
+  // Create a Mapping
+  Vector<double> map_vector(dh.n_dofs());
+  MappingQEulerian<dim,Vector<double>,spacedim> mapping(1, dh, map_vector);
+
+  tria.refine_global (1);
+
+  dh.distribute_dofs(fe);
+
+  deallog << "After refine:" << std::endl
+          << "cells: " << tria.n_active_cells() << ", dofs: "
+          << dh.n_dofs() <<std::endl;
+}
+
+using namespace dealii;
+int main()
+{
+  initlog();
+  test<1,1>();
+  test<1,2>();
+  test<2,2>();
+  test<2,3>();
+  test<3,3>();
+}
diff --git a/tests/mappings/mapping_q_eulerian_10.output b/tests/mappings/mapping_q_eulerian_10.output
new file mode 100644 (file)
index 0000000..562627c
--- /dev/null
@@ -0,0 +1,21 @@
+
+DEAL::dim, spacedim: 1, 1
+DEAL::cells: 1, dofs: 2
+DEAL::After refine:
+DEAL::cells: 2, dofs: 3
+DEAL::dim, spacedim: 1, 2
+DEAL::cells: 1, dofs: 4
+DEAL::After refine:
+DEAL::cells: 2, dofs: 6
+DEAL::dim, spacedim: 2, 2
+DEAL::cells: 1, dofs: 8
+DEAL::After refine:
+DEAL::cells: 4, dofs: 18
+DEAL::dim, spacedim: 2, 3
+DEAL::cells: 1, dofs: 12
+DEAL::After refine:
+DEAL::cells: 4, dofs: 27
+DEAL::dim, spacedim: 3, 3
+DEAL::cells: 1, dofs: 24
+DEAL::After refine:
+DEAL::cells: 8, dofs: 81

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.