]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add failing no_normal_flux test
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 Oct 2013 21:45:02 +0000 (21:45 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 Oct 2013 21:45:02 +0000 (21:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@31402 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/no_flux_12.cc [new file with mode: 0644]
tests/deal.II/no_flux_12.debug.output [new file with mode: 0644]

diff --git a/tests/deal.II/no_flux_12.cc b/tests/deal.II/no_flux_12.cc
new file mode 100644 (file)
index 0000000..716232a
--- /dev/null
@@ -0,0 +1,94 @@
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2012 - 2013 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// add test for ExcNotImplemented() error in compute_no_normal_flux_constraints.
+// reported by Keith Galvin, mailing list, 2013/10/13. Simplified.
+// note that the cylinder boundary is not even the problem here!
+
+/*
+5: An error occurred in line <4586> of file </scratch/deal-trunk/deal.II/include/deal.II/numerics/vector_tools.templates.h> in function
+5:     void dealii::VectorTools::compute_no_normal_flux_constraints(const DH<dim, spacedim>&, unsigned int, const std::set<unsigned char>&, dealii::ConstraintMatrix&, const dealii::Mapping<dim, spacedim>&) [with int dim = 3; DH = dealii::DoFHandler; int spacedim = 3]
+5: The violated condition was: 
+5:     contribution->second.size() == dim-1
+5: The name and call sequence of the exception was:
+5:     ExcNotImplemented()
+  
+ */
+
+#include "../tests.h"
+
+#include <grid/tria.h>
+#include <grid/tria_boundary_lib.h>
+#include <grid/grid_out.h>
+#include <grid/grid_generator.h>
+#include <dofs/dof_handler.h>
+#include <fe/fe_system.h>
+#include <fe/mapping_q.h>
+#include <numerics/vector_tools.h>
+#include <numerics/data_out.h>
+#include <base/exceptions.h>
+#include <base/function.h>
+
+
+template <int dim>
+void run()
+{
+  Triangulation<dim> tria;
+
+  // indicator 6 = cylinder
+  GridGenerator::hyper_cube_with_cylindrical_hole (tria, 0.25, 0.5, 0.5, 1, true);
+  
+  /*  std::string filename = "Mesh.eps";
+  std::ofstream output (filename.c_str());
+  GridOut grid_out;
+  grid_out.write_eps (tria, output);
+  */
+  
+  FESystem<dim> fe(FE_Q<dim>(1), dim);
+  DoFHandler<dim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  ConstraintMatrix constraints;
+  std::set<unsigned char> no_normal_flux_boundaries;
+  no_normal_flux_boundaries.insert (0); // x=0
+  no_normal_flux_boundaries.insert (5); // z=1
+  
+  VectorTools::compute_no_normal_flux_constraints
+    (dof_handler, 0,
+     no_normal_flux_boundaries,
+     constraints);
+
+  constraints.print(deallog.get_file_stream());
+
+  deallog.get_file_stream() << std::flush;
+  constraints.close();
+
+  deallog << "OK" << std::endl;
+}
+
+
+int main ()
+{
+  std::ofstream logfile ("output");
+  logfile.precision (7);
+  logfile.setf(std::ios::fixed);
+  deallog.attach(logfile);
+  deallog.depth_console (0);
+
+  run<3> ();
+}
diff --git a/tests/deal.II/no_flux_12.debug.output b/tests/deal.II/no_flux_12.debug.output
new file mode 100644 (file)
index 0000000..543e413
--- /dev/null
@@ -0,0 +1,31 @@
+
+    202 = 0
+    566 = 0
+    570 = 0
+    576 = 0
+    1098 = 0
+    1100 = 0
+    1104 = 0
+    1616 = 0
+    1620 = 0
+    1708 = 0
+    1918 = 0
+    1920 = 0
+    1922 = 0
+    1930 = 0
+    1962 = 0
+    2138 = 0
+    2140 = 0
+    2156 = 0
+    2160 = 0
+    2196 = 0
+    2198 = 0
+    2246 = 0
+    2416 = 0
+    2892 = 0
+    2894 = 0
+    2902 = 0
+    2906 = 0
+    2912 = 0
+    2918 = 0
+DEAL::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.