From 5044fb56c8d80f6a0c8afe58e3d855a330260139 Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 23 Oct 2013 21:45:02 +0000 Subject: [PATCH] add failing no_normal_flux test git-svn-id: https://svn.dealii.org/trunk@31402 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/no_flux_12.cc | 94 +++++++++++++++++++++++++++ tests/deal.II/no_flux_12.debug.output | 31 +++++++++ 2 files changed, 125 insertions(+) create mode 100644 tests/deal.II/no_flux_12.cc create mode 100644 tests/deal.II/no_flux_12.debug.output diff --git a/tests/deal.II/no_flux_12.cc b/tests/deal.II/no_flux_12.cc new file mode 100644 index 0000000000..716232ac0e --- /dev/null +++ b/tests/deal.II/no_flux_12.cc @@ -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 in function +5: void dealii::VectorTools::compute_no_normal_flux_constraints(const DH&, unsigned int, const std::set&, dealii::ConstraintMatrix&, const dealii::Mapping&) [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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template +void run() +{ + Triangulation 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 fe(FE_Q(1), dim); + DoFHandler dof_handler (tria); + dof_handler.distribute_dofs (fe); + + ConstraintMatrix constraints; + std::set 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 index 0000000000..543e413fad --- /dev/null +++ b/tests/deal.II/no_flux_12.debug.output @@ -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 -- 2.39.5