From a7f114eda21211c5895c86f61b937b43a05cbd78 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 27 May 2019 09:27:35 -0400 Subject: [PATCH] Add tests --- tests/trilinos/sparsity_pattern_07.cc | 49 +++++++++++++++++++ .../sparsity_pattern_07.mpirun=1.output | 6 +++ .../sparsity_pattern_07.mpirun=2.output | 13 +++++ 3 files changed, 68 insertions(+) create mode 100644 tests/trilinos/sparsity_pattern_07.cc create mode 100644 tests/trilinos/sparsity_pattern_07.mpirun=1.output create mode 100644 tests/trilinos/sparsity_pattern_07.mpirun=2.output diff --git a/tests/trilinos/sparsity_pattern_07.cc b/tests/trilinos/sparsity_pattern_07.cc new file mode 100644 index 0000000000..0d68aa125a --- /dev/null +++ b/tests/trilinos/sparsity_pattern_07.cc @@ -0,0 +1,49 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2019 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.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + + +// check TrilinosWrappers::SparsityPattern::row_length +#include +#include + +#include + +#include "../tests.h" + +int +main(int argc, char **argv) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + + MPILogInitAll mpi_log; + + const unsigned int n = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); + IndexSet owned_set(n); + owned_set.add_index(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)); + IndexSet relevant_set(n); + relevant_set.add_range(0, n); + IndexSet empty_set; + TrilinosWrappers::SparsityPattern sparsity(owned_set, + empty_set, + relevant_set, + MPI_COMM_WORLD); + + deallog << "\nBefore compressing sparsity pattern..." << std::endl; + sparsity.compress(); + deallog << "Compressing sparsity pattern worked!\n\n" << std::endl; + + return 0; +} diff --git a/tests/trilinos/sparsity_pattern_07.mpirun=1.output b/tests/trilinos/sparsity_pattern_07.mpirun=1.output new file mode 100644 index 0000000000..f907400e86 --- /dev/null +++ b/tests/trilinos/sparsity_pattern_07.mpirun=1.output @@ -0,0 +1,6 @@ + +DEAL:0:: +Before compressing sparsity pattern... +DEAL:0::Compressing sparsity pattern worked! + + diff --git a/tests/trilinos/sparsity_pattern_07.mpirun=2.output b/tests/trilinos/sparsity_pattern_07.mpirun=2.output new file mode 100644 index 0000000000..fb2f89d478 --- /dev/null +++ b/tests/trilinos/sparsity_pattern_07.mpirun=2.output @@ -0,0 +1,13 @@ + +DEAL:0:: +Before compressing sparsity pattern... +DEAL:0::Compressing sparsity pattern worked! + + + +DEAL:1:: +Before compressing sparsity pattern... +DEAL:1::Compressing sparsity pattern worked! + + + -- 2.39.5