From 569ecd1ea5acc262bb23bb97bf4b9c1512d1a870 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 11 Nov 2015 00:22:26 +0100 Subject: [PATCH] Added test for BlockDiagonalOperator bug. --- tests/lac/block_linear_operator_05.cc | 53 +++++++++++++++++++ ...r_05.with_cxx11=on.with_trilinos=on.output | 2 + 2 files changed, 55 insertions(+) create mode 100644 tests/lac/block_linear_operator_05.cc create mode 100644 tests/lac/block_linear_operator_05.with_cxx11=on.with_trilinos=on.output diff --git a/tests/lac/block_linear_operator_05.cc b/tests/lac/block_linear_operator_05.cc new file mode 100644 index 0000000000..9a9df6db42 --- /dev/null +++ b/tests/lac/block_linear_operator_05.cc @@ -0,0 +1,53 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2015 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. +// +// --------------------------------------------------------------------- + +// Test that it is possible to create a block diagonal linear operator +// from other linear operators involving Trilinos matrices. + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include + +using namespace dealii; + +int main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); + + initlog(); + deallog << std::setprecision(10); + + TrilinosWrappers::SparseMatrix a; + + auto op_a = linear_operator(a); + auto op_a2 = linear_operator(a); + + TrilinosWrappers::BlockSparseMatrix b; + + auto op_b = linear_operator(b); + auto op_b3 = linear_operator(b); + + auto op_c = block_diagonal_operator<2, TrilinosWrappers::MPI::BlockVector >({{ op_a, op_a}}); + auto op_c2 = block_diagonal_operator<2, TrilinosWrappers::BlockVector >({{ op_a2, op_a2}}); + + deallog << "OK" << std::endl; + + return 0; +} diff --git a/tests/lac/block_linear_operator_05.with_cxx11=on.with_trilinos=on.output b/tests/lac/block_linear_operator_05.with_cxx11=on.with_trilinos=on.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/lac/block_linear_operator_05.with_cxx11=on.with_trilinos=on.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5