]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add tests
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 27 May 2019 13:27:35 +0000 (09:27 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 27 May 2019 13:27:35 +0000 (09:27 -0400)
tests/trilinos/sparsity_pattern_07.cc [new file with mode: 0644]
tests/trilinos/sparsity_pattern_07.mpirun=1.output [new file with mode: 0644]
tests/trilinos/sparsity_pattern_07.mpirun=2.output [new file with mode: 0644]

diff --git a/tests/trilinos/sparsity_pattern_07.cc b/tests/trilinos/sparsity_pattern_07.cc
new file mode 100644 (file)
index 0000000..0d68aa1
--- /dev/null
@@ -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 <deal.II/base/index_set.h>
+#include <deal.II/base/mpi.h>
+
+#include <deal.II/lac/block_sparsity_pattern.h>
+
+#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 (file)
index 0000000..f907400
--- /dev/null
@@ -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 (file)
index 0000000..fb2f89d
--- /dev/null
@@ -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!
+
+
+

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.