From 1c7b8fd9f43ee4871bf5de087af862e44a081d82 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 13 May 2017 18:08:17 +0200 Subject: [PATCH] Use valid arguments in ChunkSparsityPattern constructor --- source/lac/chunk_sparsity_pattern.cc | 2 +- tests/sparsity/chunk_sparsity_pattern_12.cc | 30 +++++++++++++++++++ .../sparsity/chunk_sparsity_pattern_12.output | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/sparsity/chunk_sparsity_pattern_12.cc create mode 100644 tests/sparsity/chunk_sparsity_pattern_12.output diff --git a/source/lac/chunk_sparsity_pattern.cc b/source/lac/chunk_sparsity_pattern.cc index 89bc4fbe3f..3db63c4b1d 100644 --- a/source/lac/chunk_sparsity_pattern.cc +++ b/source/lac/chunk_sparsity_pattern.cc @@ -40,7 +40,7 @@ ChunkSparsityPattern::ChunkSparsityPattern (const ChunkSparsityPattern &s) "is the sparsity pattern for an empty matrix. This constructor can " "not be used to copy-construct a non-empty sparsity pattern.")); - reinit (0,0,0,0); + reinit (0,0,0,chunk_size); } diff --git a/tests/sparsity/chunk_sparsity_pattern_12.cc b/tests/sparsity/chunk_sparsity_pattern_12.cc new file mode 100644 index 0000000000..752bc8741f --- /dev/null +++ b/tests/sparsity/chunk_sparsity_pattern_12.cc @@ -0,0 +1,30 @@ +// --------------------------------------------------------------------- +// +// 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. +// +// --------------------------------------------------------------------- + + + +// check the copy constructor of ChunkSparsityPattern + +#include "sparsity_pattern_common.h" + +int main () +{ + initlog(); + + ChunkSparsityPattern chunk1 (); + ChunkSparsityPattern chunk2 = chunk1; + + deallog << "OK" << std::endl; +} diff --git a/tests/sparsity/chunk_sparsity_pattern_12.output b/tests/sparsity/chunk_sparsity_pattern_12.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/sparsity/chunk_sparsity_pattern_12.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5