]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Undo a change to a previously existing test, add a new one.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Sep 2019 02:50:59 +0000 (20:50 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Sep 2019 02:50:59 +0000 (20:50 -0600)
tests/mappings/mapping_fe_field_01.cc
tests/mappings/mapping_fe_field_contravariant_01.cc [new file with mode: 0644]
tests/mappings/mapping_fe_field_contravariant_01.output [new file with mode: 0644]

index c9e1a804286f6862c3cb370ab506f76339b4a048..4e82d95c1234445a00355ce1a915227e3805f9df 100644 (file)
@@ -77,8 +77,7 @@ test(const unsigned int degree)
   FEValues<dim, spacedim> fe_values(map_fe,
                                     fe_sys,
                                     quadrature_formula,
-                                    update_values | update_JxW_values |
-                                      update_volume_elements);
+                                    update_values | update_JxW_values);
 
   typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
                                                              dof_sys
diff --git a/tests/mappings/mapping_fe_field_contravariant_01.cc b/tests/mappings/mapping_fe_field_contravariant_01.cc
new file mode 100644 (file)
index 0000000..60053aa
--- /dev/null
@@ -0,0 +1,111 @@
+// ---------------------------------------------------------------------
+//
+// 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.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Like mapping_fe_field_01, but add an update flag that led to an
+// assertion that checked the size of the wrong field and consequently
+// accidentally aborted an otherwise perfectly valid program
+
+#include <deal.II/base/quadrature_lib.h>
+
+#include <deal.II/dofs/dof_accessor.h>
+
+#include <deal.II/fe/fe.h>
+#include <deal.II/fe/fe_bernstein.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_cartesian.h>
+#include <deal.II/fe/mapping_fe_field.h>
+#include <deal.II/fe/mapping_q.h>
+#include <deal.II/fe/mapping_q1.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/grid/manifold_lib.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/lac/vector.h>
+
+#include <deal.II/numerics/vector_tools.h>
+
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include "../tests.h"
+
+#define PRECISION 2
+
+template <int dim, int spacedim>
+void
+test(const unsigned int degree)
+{
+  deallog << "dim = " << dim << ", spacedim = " << spacedim << std::endl;
+  deallog << "degree = " << degree << std::endl;
+
+  Triangulation<dim, spacedim> tria;
+  GridGenerator::hyper_cube(tria, 0., 1.);
+  tria.refine_global(2);
+
+  FE_Bernstein<dim, spacedim> fe(degree);
+  // FE_Q<dim> fe(degree);
+  FESystem<dim, spacedim> fe_sys(fe, spacedim);
+
+  // DoFHandler<dim> dof(tria);
+  DoFHandler<dim, spacedim> dof_sys(tria);
+  // dof.distribute_dofs(fe);
+  dof_sys.distribute_dofs(fe_sys);
+
+  Vector<double> euler;
+  euler.reinit(dof_sys.n_dofs());
+  const ComponentMask mask(spacedim, true);
+
+  VectorTools::get_position_vector(dof_sys, euler, mask);
+  MappingFEField<dim, spacedim> map_fe(dof_sys, euler, mask);
+
+  QIterated<dim> quadrature_formula(QTrapez<1>(), fe.degree);
+
+  FEValues<dim, spacedim> fe_values(map_fe,
+                                    fe_sys,
+                                    quadrature_formula,
+                                    update_values | update_JxW_values |
+                                      update_volume_elements);
+
+  typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+                                                             dof_sys
+                                                               .begin_active(),
+                                                           endc = dof_sys.end();
+
+  for (; cell != endc; ++cell)
+    {
+      fe_values.reinit(cell);
+      deallog << "Cell " << cell << ": OK" << std::endl;
+    }
+}
+
+int
+main()
+{
+  initlog();
+
+  for (unsigned int d = 1; d < 4; ++d)
+    {
+      test<2, 2>(d);
+      test<2, 3>(d);
+      test<3, 3>(d);
+    }
+}
diff --git a/tests/mappings/mapping_fe_field_contravariant_01.output b/tests/mappings/mapping_fe_field_contravariant_01.output
new file mode 100644 (file)
index 0000000..4aa1739
--- /dev/null
@@ -0,0 +1,307 @@
+
+DEAL::dim = 2, spacedim = 2
+DEAL::degree = 1
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 2, spacedim = 3
+DEAL::degree = 1
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 3, spacedim = 3
+DEAL::degree = 1
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::Cell 2.16: OK
+DEAL::Cell 2.17: OK
+DEAL::Cell 2.18: OK
+DEAL::Cell 2.19: OK
+DEAL::Cell 2.20: OK
+DEAL::Cell 2.21: OK
+DEAL::Cell 2.22: OK
+DEAL::Cell 2.23: OK
+DEAL::Cell 2.24: OK
+DEAL::Cell 2.25: OK
+DEAL::Cell 2.26: OK
+DEAL::Cell 2.27: OK
+DEAL::Cell 2.28: OK
+DEAL::Cell 2.29: OK
+DEAL::Cell 2.30: OK
+DEAL::Cell 2.31: OK
+DEAL::Cell 2.32: OK
+DEAL::Cell 2.33: OK
+DEAL::Cell 2.34: OK
+DEAL::Cell 2.35: OK
+DEAL::Cell 2.36: OK
+DEAL::Cell 2.37: OK
+DEAL::Cell 2.38: OK
+DEAL::Cell 2.39: OK
+DEAL::Cell 2.40: OK
+DEAL::Cell 2.41: OK
+DEAL::Cell 2.42: OK
+DEAL::Cell 2.43: OK
+DEAL::Cell 2.44: OK
+DEAL::Cell 2.45: OK
+DEAL::Cell 2.46: OK
+DEAL::Cell 2.47: OK
+DEAL::Cell 2.48: OK
+DEAL::Cell 2.49: OK
+DEAL::Cell 2.50: OK
+DEAL::Cell 2.51: OK
+DEAL::Cell 2.52: OK
+DEAL::Cell 2.53: OK
+DEAL::Cell 2.54: OK
+DEAL::Cell 2.55: OK
+DEAL::Cell 2.56: OK
+DEAL::Cell 2.57: OK
+DEAL::Cell 2.58: OK
+DEAL::Cell 2.59: OK
+DEAL::Cell 2.60: OK
+DEAL::Cell 2.61: OK
+DEAL::Cell 2.62: OK
+DEAL::Cell 2.63: OK
+DEAL::dim = 2, spacedim = 2
+DEAL::degree = 2
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 2, spacedim = 3
+DEAL::degree = 2
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 3, spacedim = 3
+DEAL::degree = 2
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::Cell 2.16: OK
+DEAL::Cell 2.17: OK
+DEAL::Cell 2.18: OK
+DEAL::Cell 2.19: OK
+DEAL::Cell 2.20: OK
+DEAL::Cell 2.21: OK
+DEAL::Cell 2.22: OK
+DEAL::Cell 2.23: OK
+DEAL::Cell 2.24: OK
+DEAL::Cell 2.25: OK
+DEAL::Cell 2.26: OK
+DEAL::Cell 2.27: OK
+DEAL::Cell 2.28: OK
+DEAL::Cell 2.29: OK
+DEAL::Cell 2.30: OK
+DEAL::Cell 2.31: OK
+DEAL::Cell 2.32: OK
+DEAL::Cell 2.33: OK
+DEAL::Cell 2.34: OK
+DEAL::Cell 2.35: OK
+DEAL::Cell 2.36: OK
+DEAL::Cell 2.37: OK
+DEAL::Cell 2.38: OK
+DEAL::Cell 2.39: OK
+DEAL::Cell 2.40: OK
+DEAL::Cell 2.41: OK
+DEAL::Cell 2.42: OK
+DEAL::Cell 2.43: OK
+DEAL::Cell 2.44: OK
+DEAL::Cell 2.45: OK
+DEAL::Cell 2.46: OK
+DEAL::Cell 2.47: OK
+DEAL::Cell 2.48: OK
+DEAL::Cell 2.49: OK
+DEAL::Cell 2.50: OK
+DEAL::Cell 2.51: OK
+DEAL::Cell 2.52: OK
+DEAL::Cell 2.53: OK
+DEAL::Cell 2.54: OK
+DEAL::Cell 2.55: OK
+DEAL::Cell 2.56: OK
+DEAL::Cell 2.57: OK
+DEAL::Cell 2.58: OK
+DEAL::Cell 2.59: OK
+DEAL::Cell 2.60: OK
+DEAL::Cell 2.61: OK
+DEAL::Cell 2.62: OK
+DEAL::Cell 2.63: OK
+DEAL::dim = 2, spacedim = 2
+DEAL::degree = 3
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 2, spacedim = 3
+DEAL::degree = 3
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::dim = 3, spacedim = 3
+DEAL::degree = 3
+DEAL::Cell 2.0: OK
+DEAL::Cell 2.1: OK
+DEAL::Cell 2.2: OK
+DEAL::Cell 2.3: OK
+DEAL::Cell 2.4: OK
+DEAL::Cell 2.5: OK
+DEAL::Cell 2.6: OK
+DEAL::Cell 2.7: OK
+DEAL::Cell 2.8: OK
+DEAL::Cell 2.9: OK
+DEAL::Cell 2.10: OK
+DEAL::Cell 2.11: OK
+DEAL::Cell 2.12: OK
+DEAL::Cell 2.13: OK
+DEAL::Cell 2.14: OK
+DEAL::Cell 2.15: OK
+DEAL::Cell 2.16: OK
+DEAL::Cell 2.17: OK
+DEAL::Cell 2.18: OK
+DEAL::Cell 2.19: OK
+DEAL::Cell 2.20: OK
+DEAL::Cell 2.21: OK
+DEAL::Cell 2.22: OK
+DEAL::Cell 2.23: OK
+DEAL::Cell 2.24: OK
+DEAL::Cell 2.25: OK
+DEAL::Cell 2.26: OK
+DEAL::Cell 2.27: OK
+DEAL::Cell 2.28: OK
+DEAL::Cell 2.29: OK
+DEAL::Cell 2.30: OK
+DEAL::Cell 2.31: OK
+DEAL::Cell 2.32: OK
+DEAL::Cell 2.33: OK
+DEAL::Cell 2.34: OK
+DEAL::Cell 2.35: OK
+DEAL::Cell 2.36: OK
+DEAL::Cell 2.37: OK
+DEAL::Cell 2.38: OK
+DEAL::Cell 2.39: OK
+DEAL::Cell 2.40: OK
+DEAL::Cell 2.41: OK
+DEAL::Cell 2.42: OK
+DEAL::Cell 2.43: OK
+DEAL::Cell 2.44: OK
+DEAL::Cell 2.45: OK
+DEAL::Cell 2.46: OK
+DEAL::Cell 2.47: OK
+DEAL::Cell 2.48: OK
+DEAL::Cell 2.49: OK
+DEAL::Cell 2.50: OK
+DEAL::Cell 2.51: OK
+DEAL::Cell 2.52: OK
+DEAL::Cell 2.53: OK
+DEAL::Cell 2.54: OK
+DEAL::Cell 2.55: OK
+DEAL::Cell 2.56: OK
+DEAL::Cell 2.57: OK
+DEAL::Cell 2.58: OK
+DEAL::Cell 2.59: OK
+DEAL::Cell 2.60: OK
+DEAL::Cell 2.61: OK
+DEAL::Cell 2.62: OK
+DEAL::Cell 2.63: OK

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.