From: Daniel Arndt Date: Tue, 30 May 2017 22:01:31 +0000 (+0200) Subject: Don't use TrilinosWrappers::VectorBase anymore X-Git-Tag: v9.0.0-rc1~1543^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83428c556f5defee834cc0004c47ee18479df1ce;p=dealii.git Don't use TrilinosWrappers::VectorBase anymore --- diff --git a/cmake/config/template-arguments.in b/cmake/config/template-arguments.in index 2be554147c..7946207164 100644 --- a/cmake/config/template-arguments.in +++ b/cmake/config/template-arguments.in @@ -44,7 +44,6 @@ SERIAL_VECTORS := { Vector; LinearAlgebra::distributed::BlockVector; LinearAlgebra::distributed::BlockVector ; - @DEAL_II_EXPAND_TRILINOS_VECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@; @DEAL_II_EXPAND_EPETRA_VECTOR@; @DEAL_II_EXPAND_PETSC_MPI_VECTOR@; @@ -69,12 +68,10 @@ REAL_SERIAL_VECTORS := { Vector; LinearAlgebra::distributed::BlockVector; LinearAlgebra::distributed::BlockVector ; - @DEAL_II_EXPAND_TRILINOS_VECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@; @DEAL_II_EXPAND_EPETRA_VECTOR@; @DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL@; - @DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@; @DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR_REAL@; } @@ -89,7 +86,6 @@ REAL_NONBLOCK_VECTORS := { Vector; LinearAlgebra::distributed::Vector; LinearAlgebra::distributed::Vector ; - @DEAL_II_EXPAND_TRILINOS_VECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@; @DEAL_II_EXPAND_EPETRA_VECTOR@; @DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL@; @@ -115,7 +111,6 @@ VECTORS_WITH_MATRIX := { Vector; LinearAlgebra::distributed::Vector; - @DEAL_II_EXPAND_TRILINOS_VECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@; @DEAL_II_EXPAND_EPETRA_VECTOR@; } diff --git a/cmake/configure/configure_2_trilinos.cmake b/cmake/configure/configure_2_trilinos.cmake index 6350174e35..12234ba3fa 100644 --- a/cmake/configure/configure_2_trilinos.cmake +++ b/cmake/configure/configure_2_trilinos.cmake @@ -188,7 +188,6 @@ ENDMACRO() MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) - SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::VectorBase") SET(DEAL_II_EXPAND_TRILINOS_SPARSITY_PATTERN "TrilinosWrappers::SparsityPattern") SET(DEAL_II_EXPAND_TRILINOS_BLOCK_SPARSITY_PATTERN "TrilinosWrappers::BlockSparsityPattern") SET(DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR "TrilinosWrappers::MPI::BlockVector") diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index cb013d5fa1..81c55596b2 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -1271,8 +1271,7 @@ namespace PETScWrappers if (value == PetscScalar()) { // we have to check after using Insert/Add in any case to be - // consistent with the MPI communication model (see the comments in - // the documentation of TrilinosWrappers::VectorBase), but we can save + // consistent with the MPI communication model, but we can save // some work if the addend is zero. However, these actions are done // in case we pass on to the other function. prepare_action(VectorOperation::add); diff --git a/include/deal.II/lac/trilinos_block_sparse_matrix.h b/include/deal.II/lac/trilinos_block_sparse_matrix.h index f692e8dad6..6fdf7a3769 100644 --- a/include/deal.II/lac/trilinos_block_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_block_sparse_matrix.h @@ -329,9 +329,9 @@ namespace TrilinosWrappers * * This function is only applicable if the matrix only has one block. */ - TrilinosScalar residual (VectorBase &dst, - const VectorBase &x, - const VectorBase &b) const; + TrilinosScalar residual (MPI::Vector &dst, + const MPI::Vector &x, + const MPI::Vector &b) const; /** * Make the clear() function in the base class visible, though it is diff --git a/include/deal.II/lac/trilinos_solver.h b/include/deal.II/lac/trilinos_solver.h index 1375034e8a..d520474017 100644 --- a/include/deal.II/lac/trilinos_solver.h +++ b/include/deal.II/lac/trilinos_solver.h @@ -42,7 +42,6 @@ namespace TrilinosWrappers { // forward declarations class SparseMatrix; - class VectorBase; class PreconditionBase; @@ -154,8 +153,8 @@ namespace TrilinosWrappers */ void solve (const SparseMatrix &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const PreconditionBase &preconditioner); /** @@ -167,8 +166,8 @@ namespace TrilinosWrappers */ void solve (const Epetra_Operator &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const PreconditionBase &preconditioner); /** @@ -182,8 +181,8 @@ namespace TrilinosWrappers */ void solve (const Epetra_Operator &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const Epetra_Operator &preconditioner); /** @@ -677,7 +676,7 @@ namespace TrilinosWrappers * package set in intialize(). Note the matrix is not refactorized during * this call. */ - void solve (VectorBase &x, const VectorBase &b); + void solve (MPI::Vector &x, const MPI::Vector &b); /** * Solve the linear system Ax=b. Creates a factorization of the @@ -687,8 +686,8 @@ namespace TrilinosWrappers */ void solve (const SparseMatrix &A, - VectorBase &x, - const VectorBase &b); + MPI::Vector &x, + const MPI::Vector &b); /** * Solve the linear system Ax=b. This class works with Trilinos diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index c52e99482f..a780f40e99 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -1475,15 +1475,14 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well - * as deal.II's own vector classes Vector and - * LinearAlgebra::distributed::Vector. + * namely TrilinosWrappers::MPI::Vector as well as deal.II's own vector + * classes Vector and LinearAlgebra::distributed::Vector. * - * Note that both vectors have to be distributed vectors generated using - * the same Map as was used for the matrix in case you work on a - * distributed memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class (or one of the two derived classes - * Vector and MPI::Vector). + * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors + * have to be distributed vectors generated using the same Map as was used + * for the matrix rows and columns in case you work on a distributed + * memory architecture, using the interface in the + * TrilinosWrappers::MPI::Vector class. * * In case of a localized Vector, this function will only work when * running on one processor, since the matrix object is inherently @@ -1501,15 +1500,14 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well - * as deal.II's own vector classes Vector and - * LinearAlgebra::distributed::Vector. + * namely TrilinosWrappers::MPI::Vector as well as deal.II's own vector + * classes Vector and LinearAlgebra::distributed::Vector. * - * Note that both vectors have to be distributed vectors generated using - * the same Map as was used for the matrix in case you work on a - * distributed memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class (or one of the two derived classes - * Vector and MPI::Vector). + * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors + * have to be distributed vectors generated using the same Map as was used + * for the matrix rows and columns in case you work on a distributed + * memory architecture, using the interface in the + * TrilinosWrappers::MPI::Vector class. * * In case of a localized Vector, this function will only work when * running on one processor, since the matrix object is inherently @@ -1526,20 +1524,18 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well - * as deal.II's own vector classes Vector and - * LinearAlgebra::distributed::Vector. + * namely TrilinosWrappers::MPI::Vector as well as deal.II's own vector + * classes Vector and LinearAlgebra::distributed::Vector. * * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors * have to be distributed vectors generated using the same Map as was used * for the matrix rows and columns in case you work on a distributed * memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class. + * TrilinosWrappers::MPI::Vector class. * - * In case of a localized Vector (i.e., TrilinosWrappers::VectorBase or - * Vector), this function will only work when running on one - * processor, since the matrix object is inherently distributed. - * Otherwise, and exception will be thrown. + * In case of a localized Vector, this function will only work when + * running on one processor, since the matrix object is inherently + * distributed. Otherwise, and exception will be thrown. * */ template @@ -1554,20 +1550,18 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well - * as deal.II's own vector classes Vector and - * LinearAlgebra::distributed::Vector. + * namely TrilinosWrappers::MPI::Vector as well as deal.II's own vector + * classes Vector and LinearAlgebra::distributed::Vector. * * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors * have to be distributed vectors generated using the same Map as was used * for the matrix rows and columns in case you work on a distributed * memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class. + * TrilinosWrappers::MPI::Vector class. * - * In case of a localized Vector (i.e., TrilinosWrappers::VectorBase or - * Vector), this function will only work when running on one - * processor, since the matrix object is inherently distributed. - * Otherwise, and exception will be thrown. + * In case of a localized Vector, this function will only work when + * running on one processor, since the matrix object is inherently + * distributed. Otherwise, and exception will be thrown. */ template void Tvmult_add (VectorType &dst, @@ -1587,17 +1581,17 @@ namespace TrilinosWrappers * the Trilinos wrapper class) since Trilinos doesn't support this * operation and needs a temporary vector. * - * Note that both vectors have to be distributed vectors generated using - * the same Map as was used for the matrix in case you work on a - * distributed memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class (or one of the two derived classes - * Vector and MPI::Vector). + * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors + * have to be distributed vectors generated using the same Map as was used + * for the matrix rows and columns in case you work on a distributed + * memory architecture, using the interface in the + * TrilinosWrappers::MPI::Vector class. * * In case of a localized Vector, this function will only work when * running on one processor, since the matrix object is inherently * distributed. Otherwise, and exception will be thrown. */ - TrilinosScalar matrix_norm_square (const VectorBase &v) const; + TrilinosScalar matrix_norm_square (const MPI::Vector &v) const; /** * Compute the matrix scalar product $\left(u,Mv\right)$. @@ -1607,18 +1601,18 @@ namespace TrilinosWrappers * the Trilinos wrapper class) since Trilinos doesn't support this * operation and needs a temporary vector. * - * Note that both vectors have to be distributed vectors generated using - * the same Map as was used for the matrix in case you work on a - * distributed memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class (or one of the two derived classes - * Vector and MPI::Vector). + * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors + * have to be distributed vectors generated using the same Map as was used + * for the matrix rows and columns in case you work on a distributed + * memory architecture, using the interface in the + * TrilinosWrappers::MPI::Vector class. * * In case of a localized Vector, this function will only work when * running on one processor, since the matrix object is inherently * distributed. Otherwise, and exception will be thrown. */ - TrilinosScalar matrix_scalar_product (const VectorBase &u, - const VectorBase &v) const; + TrilinosScalar matrix_scalar_product (const MPI::Vector &u, + const MPI::Vector &v) const; /** * Compute the residual of an equation Mx=b, where the residual is @@ -1627,19 +1621,19 @@ namespace TrilinosWrappers * * Source x and destination dst must not be the same vector. * - * Note that both vectors have to be distributed vectors generated using - * the same Map as was used for the matrix in case you work on a - * distributed memory architecture, using the interface in the - * TrilinosWrappers::VectorBase class (or one of the two derived classes - * Vector and MPI::Vector). + * When using a vector of type TrilinosWrappers::MPI::Vector, both vectors + * have to be distributed vectors generated using the same Map as was used + * for the matrix rows and columns in case you work on a distributed + * memory architecture, using the interface in the + * TrilinosWrappers::MPI::Vector class. * * In case of a localized Vector, this function will only work when * running on one processor, since the matrix object is inherently * distributed. Otherwise, and exception will be thrown. */ - TrilinosScalar residual (VectorBase &dst, - const VectorBase &x, - const VectorBase &b) const; + TrilinosScalar residual (MPI::Vector &dst, + const MPI::Vector &x, + const MPI::Vector &b) const; /** * Perform the matrix-matrix multiplication C = A * B, or, if an @@ -1657,7 +1651,7 @@ namespace TrilinosWrappers */ void mmult (SparseMatrix &C, const SparseMatrix &B, - const VectorBase &V = VectorBase()) const; + const MPI::Vector &V = MPI::Vector()) const; /** @@ -1678,7 +1672,7 @@ namespace TrilinosWrappers */ void Tmmult (SparseMatrix &C, const SparseMatrix &B, - const VectorBase &V = VectorBase()) const; + const MPI::Vector &V = MPI::Vector()) const; //@} /** @@ -2988,8 +2982,7 @@ namespace TrilinosWrappers if (value == 0) { // we have to check after Insert/Add in any case to be consistent - // with the MPI communication model (see the comments in the - // documentation of TrilinosWrappers::VectorBase), but we can save some + // with the MPI communication model, but we can save some // work if the addend is zero. However, these actions are done in case // we pass on to the other function. diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 51d9fab6fc..99a61346ea 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -56,7 +56,6 @@ namespace TrilinosWrappers { class Vector; } - class VectorBase; } #endif @@ -230,13 +229,6 @@ public: * result in a copy of the vector on all processors. */ explicit Vector (const TrilinosWrappers::MPI::Vector &v); - - /** - * Another copy constructor: copy the values from a localized Trilinos - * wrapper vector. This copy constructor is only available if Trilinos was - * detected during configuration time. - */ - explicit Vector (const TrilinosWrappers::VectorBase &v); #endif /** @@ -401,14 +393,6 @@ public: */ Vector & operator= (const TrilinosWrappers::MPI::Vector &v); - - /** - * Another copy operator: copy the values from a sequential Trilinos wrapper - * vector class. This operator is only available if Trilinos was detected - * during configuration time. - */ - Vector & - operator= (const TrilinosWrappers::VectorBase &v); #endif /** diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index a5eec8ad6f..a67a8b133e 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -198,31 +198,6 @@ Vector::Vector (const TrilinosWrappers::MPI::Vector &v) } } - - -template -Vector::Vector (const TrilinosWrappers::VectorBase &v) - : - Subscriptor(), - vec_size(v.size()), - max_vec_size(v.size()), - val(nullptr) -{ - if (vec_size != 0) - { - allocate(); - - // get a representation of the vector - // and copy it - TrilinosScalar **start_ptr; - - int ierr = v.trilinos_vector().ExtractView (&start_ptr); - AssertThrow (ierr == 0, ExcTrilinosError(ierr)); - - std::copy (start_ptr[0], start_ptr[0]+vec_size, begin()); - } -} - #endif @@ -904,16 +879,7 @@ Vector::operator= (const TrilinosWrappers::MPI::Vector &v) TrilinosWrappers::MPI::Vector localized_vector; localized_vector.reinit(complete_index_set(v.size())); localized_vector.reinit(v, false, true); - *this = static_cast(localized_vector); - return *this; -} - - -template -Vector & -Vector::operator= (const TrilinosWrappers::VectorBase &v) -{ if (v.size() != vec_size) reinit (v.size(), true); if (vec_size != 0) diff --git a/include/deal.II/multigrid/mg_transfer.h b/include/deal.II/multigrid/mg_transfer.h index cc8b164017..ec76e5322b 100644 --- a/include/deal.II/multigrid/mg_transfer.h +++ b/include/deal.II/multigrid/mg_transfer.h @@ -106,17 +106,6 @@ namespace internal }; #endif - template <> - struct MatrixSelector - { - typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity; - typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix; - - template - static void reinit(Matrix &, Sparsity &, int /*level*/, const SparsityPatternType &, DoFHandlerType &) - { - } - }; #else // ! DEAL_II_WITH_TRILINOS template diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index 7fdcde38f5..7d9d3b8773 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -73,7 +73,6 @@ namespace TrilinosWrappers { class SparseMatrix; class BlockSparseMatrix; - class VectorBase; namespace MPI { class Vector; @@ -850,16 +849,6 @@ namespace MatrixTools * argument is actually not implemented; that argument has true * as its default value to stay consistent with the other functions of same * name in this namespace.) - */ - void - apply_boundary_values (const std::map &boundary_values, - TrilinosWrappers::SparseMatrix &matrix, - TrilinosWrappers::VectorBase &solution, - TrilinosWrappers::VectorBase &right_hand_side, - const bool eliminate_columns = true); - - /** - * Same as above, but for parallel matrices and vectors. * * @note If the matrix is stored in parallel across multiple processors * using MPI, this function only touches rows that are locally stored and diff --git a/source/distributed/solution_transfer.inst.in b/source/distributed/solution_transfer.inst.in index 4001446e94..35094f7952 100644 --- a/source/distributed/solution_transfer.inst.in +++ b/source/distributed/solution_transfer.inst.in @@ -37,8 +37,6 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) #endif #ifdef DEAL_II_WITH_TRILINOS - template class SolutionTransfer >; - template class SolutionTransfer >; template class SolutionTransfer >; diff --git a/source/fe/fe_tools_extrapolate.inst.in b/source/fe/fe_tools_extrapolate.inst.in index 266a8055c3..32eea51849 100644 --- a/source/fe/fe_tools_extrapolate.inst.in +++ b/source/fe/fe_tools_extrapolate.inst.in @@ -15,7 +15,7 @@ -for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS; VEC : REAL_SERIAL_VECTORS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS; VEC : SERIAL_VECTORS) { namespace FETools \{ diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index 35e58a5a9c..da97212ba4 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -63,7 +63,7 @@ namespace #ifdef DEAL_II_WITH_TRILINOS inline TrilinosScalar - max_element (const TrilinosWrappers::VectorBase &criteria) + max_element (const TrilinosWrappers::MPI::Vector &criteria) { TrilinosScalar m = 0; criteria.trilinos_vector().MaxValue(&m); @@ -73,7 +73,7 @@ namespace inline TrilinosScalar - min_element (const TrilinosWrappers::VectorBase &criteria) + min_element (const TrilinosWrappers::MPI::Vector &criteria) { TrilinosScalar m = 0; criteria.trilinos_vector().MinValue(&m); diff --git a/source/lac/constraint_matrix.cc b/source/lac/constraint_matrix.cc index 95ae1d6291..0bc3e713c3 100644 --- a/source/lac/constraint_matrix.cc +++ b/source/lac/constraint_matrix.cc @@ -1366,7 +1366,6 @@ BLOCK_MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix ,PETScWrappe #ifdef DEAL_II_WITH_TRILINOS MATRIX_FUNCTIONS(TrilinosWrappers::SparseMatrix); BLOCK_MATRIX_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix); -MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::SparseMatrix, TrilinosWrappers::VectorBase); MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::SparseMatrix, TrilinosWrappers::MPI::Vector); BLOCK_MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix, TrilinosWrappers::MPI::BlockVector); #endif diff --git a/source/lac/trilinos_block_sparse_matrix.cc b/source/lac/trilinos_block_sparse_matrix.cc index 9c360a8b48..0ddfe18136 100644 --- a/source/lac/trilinos_block_sparse_matrix.cc +++ b/source/lac/trilinos_block_sparse_matrix.cc @@ -331,9 +331,9 @@ namespace TrilinosWrappers TrilinosScalar - BlockSparseMatrix::residual (VectorBase &dst, - const VectorBase &x, - const VectorBase &b) const + BlockSparseMatrix::residual (MPI::Vector &dst, + const MPI::Vector &x, + const MPI::Vector &b) const { vmult (dst, x); dst -= b; diff --git a/source/lac/trilinos_solver.cc b/source/lac/trilinos_solver.cc index 9cb1c028be..297d6bbead 100644 --- a/source/lac/trilinos_solver.cc +++ b/source/lac/trilinos_solver.cc @@ -79,8 +79,8 @@ namespace TrilinosWrappers void SolverBase::solve (const SparseMatrix &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const PreconditionBase &preconditioner) { linear_problem.reset(); @@ -101,8 +101,8 @@ namespace TrilinosWrappers // can be used by the inverse_operator of LinearOperator void SolverBase::solve (const Epetra_Operator &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const PreconditionBase &preconditioner) { linear_problem.reset(); @@ -123,8 +123,8 @@ namespace TrilinosWrappers // can be used by the inverse_operator of LinearOperator void SolverBase::solve (const Epetra_Operator &A, - VectorBase &x, - const VectorBase &b, + MPI::Vector &x, + const MPI::Vector &b, const Epetra_Operator &preconditioner) { linear_problem.reset(); @@ -780,7 +780,7 @@ namespace TrilinosWrappers } - void SolverDirect::solve (VectorBase &x, const VectorBase &b) + void SolverDirect::solve (MPI::Vector &x, const MPI::Vector &b) { // Assign the empty LHS vector to the Epetra_LinearProblem object linear_problem->SetLHS(&x.trilinos_vector()); @@ -862,8 +862,8 @@ namespace TrilinosWrappers void SolverDirect::solve (const SparseMatrix &A, - VectorBase &x, - const VectorBase &b) + MPI::Vector &x, + const MPI::Vector &b) { // We need an Epetra_LinearProblem object to let the Amesos solver know // about the matrix and vectors. diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 541aeb2125..00fc9dd74c 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -1990,19 +1990,11 @@ namespace TrilinosWrappers Assert (&src != &dst, ExcSourceEqualsDestination()); // Reinit a temporary vector with fast argument set, which does not - // overwrite the content (to save time). However, the - // TrilinosWrappers::VectorBase classes do not support this, so create a - // deal.II local vector that has this fast setting. It will be accepted in - // vmult because it only checks the local size. - dealii::Vector temp_vector; - temp_vector.reinit(internal::end(dst)-internal::begin(dst), true); - dealii::VectorView src_view(internal::end(src)-internal::begin(src), - internal::begin(src)); - dealii::VectorView dst_view(internal::end(dst)-internal::begin(dst), - internal::begin(dst)); - vmult (temp_vector, static_cast&>(src_view)); - if (dst_view.size() > 0) - dst_view += temp_vector; + // overwrite the content (to save time). + VectorType tmp_vector; + tmp_vector.reinit(dst, true); + vmult (tmp_vector, src); + dst += tmp_vector; } @@ -2015,30 +2007,22 @@ namespace TrilinosWrappers Assert (&src != &dst, ExcSourceEqualsDestination()); // Reinit a temporary vector with fast argument set, which does not - // overwrite the content (to save time). However, the - // TrilinosWrappers::VectorBase classes do not support this, so create a - // deal.II local vector that has this fast setting. It will be accepted in - // vmult because it only checks the local size. - dealii::Vector temp_vector; - temp_vector.reinit(internal::end(dst)-internal::begin(dst), true); - dealii::VectorView src_view(internal::end(src)-internal::begin(src), - internal::begin(src)); - dealii::VectorView dst_view(internal::end(dst)-internal::begin(dst), - internal::begin(dst)); - Tvmult (temp_vector, static_cast&>(src_view)); - if (dst_view.size() > 0) - dst_view += temp_vector; + // overwrite the content (to save time). + VectorType tmp_vector; + tmp_vector.reinit(dst, true); + Tvmult (tmp_vector, src); + dst += tmp_vector; } TrilinosScalar - SparseMatrix::matrix_norm_square (const VectorBase &v) const + SparseMatrix::matrix_norm_square (const MPI::Vector &v) const { Assert (matrix->RowMap().SameAs(matrix->DomainMap()), ExcNotQuadratic()); - VectorBase temp_vector; + MPI::Vector temp_vector; temp_vector.reinit(v, true); vmult (temp_vector, v); @@ -2048,13 +2032,13 @@ namespace TrilinosWrappers TrilinosScalar - SparseMatrix::matrix_scalar_product (const VectorBase &u, - const VectorBase &v) const + SparseMatrix::matrix_scalar_product (const MPI::Vector &u, + const MPI::Vector &v) const { Assert (matrix->RowMap().SameAs(matrix->DomainMap()), ExcNotQuadratic()); - VectorBase temp_vector; + MPI::Vector temp_vector; temp_vector.reinit(v, true); vmult (temp_vector, v); @@ -2064,9 +2048,9 @@ namespace TrilinosWrappers TrilinosScalar - SparseMatrix::residual (VectorBase &dst, - const VectorBase &x, - const VectorBase &b) const + SparseMatrix::residual (MPI::Vector &dst, + const MPI::Vector &x, + const MPI::Vector &b) const { vmult (dst, x); dst -= b; @@ -2084,7 +2068,7 @@ namespace TrilinosWrappers void perform_mmult (const SparseMatrix &inputleft, const SparseMatrix &inputright, SparseMatrix &result, - const VectorBase &V, + const MPI::Vector &V, const bool transpose_left) { #ifdef DEAL_II_WITH_64BIT_INDICES @@ -2298,7 +2282,7 @@ namespace TrilinosWrappers void SparseMatrix::mmult (SparseMatrix &C, const SparseMatrix &B, - const VectorBase &V) const + const MPI::Vector &V) const { #ifdef DEAL_II_WITH_64BIT_INDICES Assert(false,ExcNotImplemented()) @@ -2311,7 +2295,7 @@ namespace TrilinosWrappers void SparseMatrix::Tmmult (SparseMatrix &C, const SparseMatrix &B, - const VectorBase &V) const + const MPI::Vector &V) const { #ifdef DEAL_II_WITH_64BIT_INDICES Assert(false,ExcNotImplemented()) @@ -3357,6 +3341,7 @@ namespace TrilinosWrappers const dealii::SparsityPattern &, const MPI_Comm &, const bool); + template void SparseMatrix::reinit (const IndexSet &, const IndexSet &, @@ -3365,9 +3350,6 @@ namespace TrilinosWrappers const bool); template void - SparseMatrix::vmult (VectorBase &, - const VectorBase &) const; - template void SparseMatrix::vmult (MPI::Vector &, const MPI::Vector &) const; template void @@ -3382,9 +3364,6 @@ namespace TrilinosWrappers const dealii::LinearAlgebra::EpetraWrappers::Vector &) const; #endif template void - SparseMatrix::Tvmult (VectorBase &, - const VectorBase &) const; - template void SparseMatrix::Tvmult (MPI::Vector &, const MPI::Vector &) const; template void @@ -3399,9 +3378,6 @@ namespace TrilinosWrappers const dealii::LinearAlgebra::EpetraWrappers::Vector &) const; #endif template void - SparseMatrix::vmult_add (VectorBase &, - const VectorBase &) const; - template void SparseMatrix::vmult_add (MPI::Vector &, const MPI::Vector &) const; template void @@ -3416,9 +3392,6 @@ namespace TrilinosWrappers const dealii::LinearAlgebra::EpetraWrappers::Vector &) const; #endif template void - SparseMatrix::Tvmult_add (VectorBase &, - const VectorBase &) const; - template void SparseMatrix::Tvmult_add (MPI::Vector &, const MPI::Vector &) const; template void diff --git a/source/numerics/matrix_tools_once.cc b/source/numerics/matrix_tools_once.cc index 71cb04173a..dcea326a42 100644 --- a/source/numerics/matrix_tools_once.cc +++ b/source/numerics/matrix_tools_once.cc @@ -418,22 +418,6 @@ namespace MatrixTools - - void - apply_boundary_values (const std::map &boundary_values, - TrilinosWrappers::SparseMatrix &matrix, - TrilinosWrappers::VectorBase &solution, - TrilinosWrappers::VectorBase &right_hand_side, - const bool eliminate_columns) - { - // simply redirect to the generic function - // used for both trilinos matrix types - internal::TrilinosWrappers::apply_boundary_values (boundary_values, matrix, solution, - right_hand_side, eliminate_columns); - } - - - void apply_boundary_values (const std::map &boundary_values, TrilinosWrappers::SparseMatrix &matrix, diff --git a/tests/mpi/trilinos_ghost_03_linfty.cc b/tests/mpi/trilinos_ghost_03_linfty.cc index d507b506f9..5b7574d091 100644 --- a/tests/mpi/trilinos_ghost_03_linfty.cc +++ b/tests/mpi/trilinos_ghost_03_linfty.cc @@ -61,7 +61,7 @@ void test () { norm = v_tmp.linfty_norm(); } - catch (TrilinosWrappers::VectorBase::ExcTrilinosError e) + catch (TrilinosWrappers::MPI::Vector::ExcTrilinosError e) { deallog << e.get_exc_name() << std::endl; exc = true; diff --git a/tests/trilinos/update_ghosts.cc b/tests/trilinos/update_ghosts.cc index 053de4453d..04b9af1aa1 100644 --- a/tests/trilinos/update_ghosts.cc +++ b/tests/trilinos/update_ghosts.cc @@ -17,9 +17,8 @@ #include -// Check that the base class vector and also the block vector class support -// update_ghost_values. This method doesn't do anything but is needed for -// genericity. +// Check that the block vector class support update_ghost_values. This method +// doesn't do anything but is needed for genericity. int main(int argc, char **argv) { @@ -27,8 +26,6 @@ int main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); initlog(); - TrilinosWrappers::VectorBase v; - v.update_ghost_values(); TrilinosWrappers::MPI::BlockVector bv; bv.update_ghost_values(); deallog << "OK" << std::endl; diff --git a/tests/trilinos/vector_equality_1.cc b/tests/trilinos/vector_equality_1.cc index cf744d88a0..e8aff5d59f 100644 --- a/tests/trilinos/vector_equality_1.cc +++ b/tests/trilinos/vector_equality_1.cc @@ -15,8 +15,8 @@ -// check TrilinosWrappers::MPI::Vector::operator==(TrilinosWrappers::Vector) for vectors that are not -// equal +// check TrilinosWrappers::MPI::Vector::operator==(TrilinosWrappers::MPI::Vector) +// for vectors that are not equal #include "../tests.h" #include diff --git a/tests/trilinos/vector_equality_2.cc b/tests/trilinos/vector_equality_2.cc index 116fa958ed..67edc78b52 100644 --- a/tests/trilinos/vector_equality_2.cc +++ b/tests/trilinos/vector_equality_2.cc @@ -15,8 +15,8 @@ -// check TrilinosWrappers::MPI::Vector::operator==(TrilinosWrappers::Vector) for vectors that are -// equal +// check TrilinosWrappers::MPI::Vector::operator==(TrilinosWrappers::MPI::Vector) +// for vectors that are equal #include "../tests.h" #include diff --git a/tests/trilinos/vector_equality_3.cc b/tests/trilinos/vector_equality_3.cc index 8762ea8133..93f216d382 100644 --- a/tests/trilinos/vector_equality_3.cc +++ b/tests/trilinos/vector_equality_3.cc @@ -15,8 +15,8 @@ -// check TrilinosWrappers::MPI::Vector::operator!=(TrilinosWrappers::Vector) for vectors that are not -// equal +// check TrilinosWrappers::MPI::Vector::operator!=(TrilinosWrappers::MPI::Vector) +// for vectors that are not equal #include "../tests.h" #include diff --git a/tests/trilinos/vector_equality_4.cc b/tests/trilinos/vector_equality_4.cc index 7d6145e973..6206bb5d91 100644 --- a/tests/trilinos/vector_equality_4.cc +++ b/tests/trilinos/vector_equality_4.cc @@ -15,8 +15,8 @@ -// check TrilinosWrappers::MPI::Vector::operator!=(TrilinosWrappers::Vector) for vectors that are -// equal +// check TrilinosWrappers::MPI::Vector::operator!=(TrilinosWrappers::MPI::Vector) +// for vectors that are equal #include "../tests.h" #include