]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a test. 2804/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 11 Jul 2016 12:46:48 +0000 (07:46 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 11 Jul 2016 12:46:48 +0000 (07:46 -0500)
tests/mappings/mapping_q_generic_cell_cache.cc [new file with mode: 0644]
tests/mappings/mapping_q_generic_cell_cache.output [new file with mode: 0644]

diff --git a/tests/mappings/mapping_q_generic_cell_cache.cc b/tests/mappings/mapping_q_generic_cell_cache.cc
new file mode 100644 (file)
index 0000000..436cdb0
--- /dev/null
@@ -0,0 +1,56 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 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.
+//
+// ---------------------------------------------------------------------
+
+// Test high order MappingQ on a ChartManifold.
+
+#include "../tests.h"
+
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/tria.h>
+
+#include <iostream>
+#include <fstream>
+
+using namespace dealii;
+
+
+int main()
+{
+  initlog ();
+
+  Triangulation<2> triangulation;
+  FE_DGQ<2> fe(0);
+  QMidpoint<2> qf_cell;
+
+  GridGenerator::hyper_cube(triangulation, 0.0, 1.0);
+  FEValues<2> fe_values (fe, qf_cell, update_JxW_values);
+
+  // compute the volume of the mesh
+  fe_values.reinit(triangulation.begin_active());
+  const double volume_before = fe_values.JxW(0);
+  deallog << volume_before << std::endl;
+
+  // shrink the mesh
+  GridTools::scale (0.5, triangulation);
+
+  // Now we measure the volume again:
+  fe_values.reinit(triangulation.begin_active());
+  const double volume_after = fe_values.JxW(0);
+  deallog << volume_after << std::endl;
+}
diff --git a/tests/mappings/mapping_q_generic_cell_cache.output b/tests/mappings/mapping_q_generic_cell_cache.output
new file mode 100644 (file)
index 0000000..57cbd70
--- /dev/null
@@ -0,0 +1,3 @@
+
+DEAL::1.00000
+DEAL::0.250000

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.