From e27f910b97d20bf3f37ebeee4a062d2ec3bade0d Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 1 Feb 2017 21:48:50 +0100 Subject: [PATCH] New test --- tests/lac/constraints_merge_12.cc | 64 ++++++++++++++++ tests/lac/constraints_merge_12.output | 105 ++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 tests/lac/constraints_merge_12.cc create mode 100644 tests/lac/constraints_merge_12.output diff --git a/tests/lac/constraints_merge_12.cc b/tests/lac/constraints_merge_12.cc new file mode 100644 index 0000000000..d64041bda4 --- /dev/null +++ b/tests/lac/constraints_merge_12.cc @@ -0,0 +1,64 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 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. +// +// --------------------------------------------------------------------- + + + +// Merge two ConstraintMatrix objects initialized with IndexSets where entries +// have been added in a way that local_lines extends beyond the end of the +// IndexSet + +#include "../tests.h" +#include +#include + +#include +#include + + +void merge_check () +{ + deallog << "Checking ConstraintMatrix::merge with localized lines" << std::endl; + + // set local lines to a very large range that surely triggers an error if + // the implementation is wrong + IndexSet local_lines (100000000); + local_lines.add_range (99999800, 100000000); + local_lines.compress(); + + // works correctly + ConstraintMatrix c1 (local_lines), c2 (local_lines); + for (types::global_dof_index i=99999800; i