]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added test for BlockDiagonalOperator bug.
authorLuca Heltai <luca.heltai@gmail.com>
Tue, 10 Nov 2015 23:22:26 +0000 (00:22 +0100)
committerLuca Heltai <luca.heltai@gmail.com>
Tue, 10 Nov 2015 23:22:26 +0000 (00:22 +0100)
tests/lac/block_linear_operator_05.cc [new file with mode: 0644]
tests/lac/block_linear_operator_05.with_cxx11=on.with_trilinos=on.output [new file with mode: 0644]

diff --git a/tests/lac/block_linear_operator_05.cc b/tests/lac/block_linear_operator_05.cc
new file mode 100644 (file)
index 0000000..9a9df6d
--- /dev/null
@@ -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 <deal.II/lac/linear_operator.h>
+#include <deal.II/lac/block_linear_operator.h>
+#include <deal.II/lac/trilinos_block_sparse_matrix.h>
+#include <deal.II/lac/trilinos_sparse_matrix.h>
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/trilinos_block_vector.h>
+
+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<TrilinosWrappers::MPI::Vector>(a);
+  auto op_a2  = linear_operator<TrilinosWrappers::Vector>(a);
+
+  TrilinosWrappers::BlockSparseMatrix b;
+
+  auto op_b = linear_operator<TrilinosWrappers::MPI::BlockVector>(b);
+  auto op_b3 = linear_operator<TrilinosWrappers::BlockVector>(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 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.