From 9ff949c98bfc98af2b18cae07fb5a01e813f0a5c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 15 Nov 2013 18:52:33 +0000 Subject: [PATCH] add failing test for no_flux git-svn-id: https://svn.dealii.org/trunk@31674 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/no_flux_13.cc | 75 +++++++++++++++++++++++++++ tests/deal.II/no_flux_13.debug.output | 31 +++++++++++ 2 files changed, 106 insertions(+) create mode 100644 tests/deal.II/no_flux_13.cc create mode 100644 tests/deal.II/no_flux_13.debug.output diff --git a/tests/deal.II/no_flux_13.cc b/tests/deal.II/no_flux_13.cc new file mode 100644 index 0000000000..c87f079be0 --- /dev/null +++ b/tests/deal.II/no_flux_13.cc @@ -0,0 +1,75 @@ +// --------------------------------------------------------------------- +// $Id: no_flux_11.cc 31349 2013-10-20 19:07:06Z maier $ +// +// 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. +// +// --------------------------------------------------------------------- + +// bug report from mailing list from 11/15/2013 (simplified). no_normal_flux throws +// an exception: +/* +-------------------------------------------------------- +An error occurred in line <4314> of file in function + 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] +The violated condition was: + vector_dofs.dof_indices[d] < dof_handler.n_dofs() +The name and call sequence of the exception was: + ExcInternalError() +Additional Information: +(none) +*/ + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace dealii; + +template +void test() +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation,-1.0,1.0); + triangulation.begin_active()->face(1)->set_all_boundary_indicators(1); + + FE_Q fe(1); + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe); + + ConstraintMatrix constraints; + std::set no_normal_flux_boundaries; + no_normal_flux_boundaries.insert (1); + VectorTools::compute_no_normal_flux_constraints (dof_handler, + 0, + no_normal_flux_boundaries, + constraints); + + constraints.close(); + constraints.print(deallog.get_file_stream ()); +} + + +int main () +{ + initlog(); + deallog.depth_console (0); + + test<3> (); +} diff --git a/tests/deal.II/no_flux_13.debug.output b/tests/deal.II/no_flux_13.debug.output new file mode 100644 index 0000000000..543e413fad --- /dev/null +++ b/tests/deal.II/no_flux_13.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