From: Daniel Arndt Date: Fri, 5 May 2017 15:15:43 +0000 (+0200) Subject: Clean testsuite from deprecated Trilinos vector functions X-Git-Tag: v9.0.0-rc1~1613^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eeb89fa124287c53cdacf0a28592bcee30fe0a0;p=dealii.git Clean testsuite from deprecated Trilinos vector functions --- diff --git a/include/deal.II/lac/trilinos_parallel_block_vector.h b/include/deal.II/lac/trilinos_parallel_block_vector.h index bf51547073..0597cce0a9 100644 --- a/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -186,19 +186,6 @@ namespace TrilinosWrappers template BlockVector &operator= (const ::dealii::BlockVector &v); - /** - * Reinitialize the BlockVector to contain as many blocks as there are - * Epetra_Maps given in the input argument, according to the parallel - * distribution of the individual components described in the maps. - * - * If omit_zeroing_entries==false, the vector is filled with - * zeros. - * - * This function is deprecated. - */ - void reinit (const std::vector ¶llel_partitioning, - const bool omit_zeroing_entries = false) DEAL_II_DEPRECATED; - /** * Reinitialize the BlockVector to contain as many blocks as there are * index sets given in the input argument, according to the parallel diff --git a/tests/mpi/trilinos_sadd_02.cc b/tests/mpi/trilinos_sadd_02.cc deleted file mode 100644 index dd96a99b2b..0000000000 --- a/tests/mpi/trilinos_sadd_02.cc +++ /dev/null @@ -1,117 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2011 - 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. -// -// --------------------------------------------------------------------- - - - -// check correct behaviour of sadd of Trilinos vectors -// if they have different Epetra maps - -#include "../tests.h" -#include -#include -#include -#include -#include -#include -#include - -void test () -{ - TrilinosWrappers::MPI::Vector ghosted, ghosted2, distributed, distributed2; - //All processes should own 10 entries - const int entries_per_process = 10; - const int n_proc = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); - IndexSet locally_owned(entries_per_process*n_proc); - IndexSet locally_relevant(entries_per_process*n_proc); - const int my_id = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - const int begin_index = my_id*entries_per_process; - const int end_index = (my_id+1)*entries_per_process; - const int local_begin = std::max(0, begin_index-entries_per_process/2); - const int local_end = entries_per_process*n_proc; - - locally_owned.add_range(begin_index, end_index); - locally_relevant.add_range - (local_begin, local_end); - - distributed.reinit(locally_owned, MPI_COMM_WORLD); - distributed2.reinit(locally_owned, MPI_COMM_WORLD); - ghosted.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD); - ghosted2.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD); - - distributed=1.; - ghosted=distributed; - ghosted *= 1.6; - distributed.sadd (2., ghosted); - ghosted = distributed; - deallog << "sadd (s, v)" < -#include -#include -#include -#include -#include -#include - -void test () -{ - TrilinosWrappers::MPI::Vector ghosted, ghosted2, distributed, distributed2; - const unsigned int my_id = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - const unsigned int n_proc = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); - //All processes except for the last one own elements - const int entries_per_process = (my_id==n_proc-1)?0:10; - IndexSet locally_owned(entries_per_process*(n_proc-1)); - IndexSet locally_relevant(entries_per_process*(n_proc-1)); - const int begin_index = my_id*entries_per_process; - const unsigned int end_index = (my_id+1)*entries_per_process; - const unsigned int local_begin = std::max(0, begin_index-entries_per_process/2); - const unsigned int local_end = entries_per_process*(n_proc-1); - - if (my_id != n_proc-1) - { - locally_owned.add_range(begin_index, end_index); - locally_relevant.add_range(local_begin, local_end); - } - - distributed.reinit(locally_owned, MPI_COMM_WORLD); - distributed2.reinit(locally_owned, MPI_COMM_WORLD); - ghosted.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD); - ghosted2.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD); - - //sadd(s,v) with ghosted vector - distributed=1.; - ghosted=distributed; - ghosted *= 1.6; - distributed.sadd (2., ghosted); - ghosted = distributed; - deallog << "sadd (s, v) ghosted" < -#include -#include -#include -#include - - -void test (TrilinosWrappers::Vector &v, - TrilinosWrappers::Vector &w, - TrilinosWrappers::Vector &x) -{ - for (unsigned int i=0; i -#include -#include -#include -#include - - -void test (TrilinosWrappers::Vector &v, - TrilinosWrappers::Vector &w, - TrilinosWrappers::Vector &x, - TrilinosWrappers::Vector &y) -{ - for (unsigned int i=0; i -#include -#include -#include -#include - - -void test (TrilinosWrappers::Vector &v, - TrilinosWrappers::Vector &w, - TrilinosWrappers::Vector &x) -{ - for (unsigned int i=0; i -#include -#include -#include -#include - - -void test (TrilinosWrappers::Vector &v, - TrilinosWrappers::Vector &w, - TrilinosWrappers::Vector &x) -{ - for (unsigned int i=0; i sizes (2, 3); - dealii::BlockVector w (sizes); + dealii::BlockVector w; + w.reinit(sizes); for (unsigned int i=0; i sizes (2, 3); - TrilinosWrappers::BlockVector v (sizes); + TrilinosWrappers::BlockVector v; + v.reinit(sizes); test (v); } } diff --git a/tests/trilinos/49b.cc b/tests/trilinos/49b.cc index acf85dbe28..a88abebc33 100644 --- a/tests/trilinos/49b.cc +++ b/tests/trilinos/49b.cc @@ -49,7 +49,9 @@ void test (TrilinosWrappers::MPI::BlockVector &v) // now also check the reverse assignment w = 0; - w = v; + TrilinosWrappers::BlockVector v_serial; + v_serial.reinit(v); + w = v_serial; for (unsigned int i=0; i sizes; - Epetra_Map map(TrilinosWrappers::types::int_type(3), - TrilinosWrappers::types::int_type(3), - 0, - Utilities::Trilinos::comm_world()); - sizes.push_back (map); - sizes.push_back (map); - - TrilinosWrappers::MPI::BlockVector v (sizes); + std::vector sizes(2, complete_index_set(3)); + + TrilinosWrappers::MPI::BlockVector v; + v.reinit(sizes, MPI_COMM_WORLD); test (v); } } diff --git a/tests/trilinos/50.cc b/tests/trilinos/50.cc index 98f46bb3ec..9dfbb7094e 100644 --- a/tests/trilinos/50.cc +++ b/tests/trilinos/50.cc @@ -76,7 +76,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/51.cc b/tests/trilinos/51.cc index ef7ccd9b83..e2f8fcfc61 100644 --- a/tests/trilinos/51.cc +++ b/tests/trilinos/51.cc @@ -61,7 +61,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/53.cc b/tests/trilinos/53.cc index a89464ed39..184fd1f362 100644 --- a/tests/trilinos/53.cc +++ b/tests/trilinos/53.cc @@ -67,7 +67,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/54.cc b/tests/trilinos/54.cc index 9fa5ac9cf7..47d01b3d62 100644 --- a/tests/trilinos/54.cc +++ b/tests/trilinos/54.cc @@ -67,7 +67,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/55.cc b/tests/trilinos/55.cc index f626397075..2f4ce06a7c 100644 --- a/tests/trilinos/55.cc +++ b/tests/trilinos/55.cc @@ -66,7 +66,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/56.cc b/tests/trilinos/56.cc index 6573ebcbf9..da2adbcdb3 100644 --- a/tests/trilinos/56.cc +++ b/tests/trilinos/56.cc @@ -66,7 +66,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/57.cc b/tests/trilinos/57.cc index 94c7c242b5..bbcc85f01c 100644 --- a/tests/trilinos/57.cc +++ b/tests/trilinos/57.cc @@ -64,7 +64,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/58.cc b/tests/trilinos/58.cc index ae4e482faf..cd1f84c369 100644 --- a/tests/trilinos/58.cc +++ b/tests/trilinos/58.cc @@ -66,7 +66,8 @@ int main (int argc,char **argv) try { { - TrilinosWrappers::Vector v (100); + TrilinosWrappers::Vector v; + v.reinit(100); test (v); } } diff --git a/tests/trilinos/59.cc b/tests/trilinos/59.cc deleted file mode 100644 index f48c4167ba..0000000000 --- a/tests/trilinos/59.cc +++ /dev/null @@ -1,100 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2004 - 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. -// -// --------------------------------------------------------------------- - - - -// check TrilinosWrappers::Vector (const ::Vector &) copy constructor - -#include "../tests.h" -#include -#include -#include - -#include -#include -#include - - -void test (TrilinosWrappers::Vector &v) -{ - // set only certain elements of the - // vector. - std::vector pattern (v.size(), false); - for (unsigned int i=0; i w (v); - Vector x (v); - - TrilinosWrappers::Vector w1 (w); - TrilinosWrappers::Vector x1 (x); - - for (unsigned int i=0; i x(v.size()); x=v; - TrilinosWrappers::Vector w1(v.size()); + TrilinosWrappers::Vector w1; + w1.reinit(v.size()); w1=w; - TrilinosWrappers::Vector x1(v.size()); + TrilinosWrappers::Vector x1; + x1.reinit(v.size()); x1=x; for (unsigned int i=0; i -#include - -#include -#include -#include - - -void test () -{ - TrilinosWrappers::MPI::Vector - v (Epetra_Map(TrilinosWrappers::types::int_type(100),0, - Utilities::Trilinos::comm_world())); - v(0) = 1; - v = 0; - - deallog << "OK" << std::endl; -} - - - -int main (int argc,char **argv) -{ - std::ofstream logfile("output"); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads()); - - - try - { - { - test (); - } - } - catch (std::exception &exc) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - return 1; - } - catch (...) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - return 1; - }; -} diff --git a/tests/trilinos/65.output b/tests/trilinos/65.output deleted file mode 100644 index 0fd8fc12f0..0000000000 --- a/tests/trilinos/65.output +++ /dev/null @@ -1,2 +0,0 @@ - -DEAL::OK diff --git a/tests/trilinos/block_vector_iterator_01.cc b/tests/trilinos/block_vector_iterator_01.cc index c7866d85b0..10b63cd7cf 100644 --- a/tests/trilinos/block_vector_iterator_01.cc +++ b/tests/trilinos/block_vector_iterator_01.cc @@ -26,7 +26,8 @@ void test () { - TrilinosWrappers::BlockVector v(2); + TrilinosWrappers::BlockVector v; + v.reinit(2); for (unsigned int i=0; i v2(v1.begin(), v1.end()); - - // and reverse way - TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); - deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl; - }; - - // Check 16: initialization through - // iterators. variant with one - // constant object - if (true) - { - TrilinosWrappers::BlockVector v1(ivector); - // initialize first vector with - // simple loop - for (unsigned int i=0; i v2(v1.begin(), v1.end()); - - // and reverse way - TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); - deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl; - }; - - // Check 17: initialization through - // iterators. variant with two - // constant object - if (true) - { - TrilinosWrappers::BlockVector v1(ivector); - // initialize first vector with - // simple loop - for (unsigned int i=0; i v2(v1.begin(), v1.end()); - - // and reverse way - const TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); - deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl; - }; - - // Check 18: initialization through - // iterators. variant with three - // constant object - if (true) - { - TrilinosWrappers::BlockVector v0(ivector); - // initialize first vector with - // simple loop - for (unsigned int i=0; i v2(v1.begin(), v1.end()); - - // and reverse way - const TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end()); - deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl; - }; - - // Check 19: operator[] + // Check 15: operator[] if (true) { - TrilinosWrappers::BlockVector v1(ivector); + TrilinosWrappers::BlockVector v1; + v1.reinit(ivector); for (unsigned int i=0; i