From: Daniel Arndt Date: Mon, 8 May 2017 21:28:53 +0000 (+0200) Subject: Remove deprecated serial Trilinos vectors X-Git-Tag: v9.0.0-rc1~1543^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89a4ebe2035118befefd56e914885f93d590bef8;p=dealii.git Remove deprecated serial Trilinos vectors --- diff --git a/cmake/config/template-arguments.in b/cmake/config/template-arguments.in index 289b6b3237..2be554147c 100644 --- a/cmake/config/template-arguments.in +++ b/cmake/config/template-arguments.in @@ -49,7 +49,6 @@ SERIAL_VECTORS := { Vector; @DEAL_II_EXPAND_EPETRA_VECTOR@; @DEAL_II_EXPAND_PETSC_MPI_VECTOR@; - @DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@; @DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR@; } @@ -96,11 +95,6 @@ REAL_NONBLOCK_VECTORS := { Vector; @DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL@; } -// wrappers for non-MPI vectors (PETSc/Trilinos) -EXTERNAL_SEQUENTIAL_VECTORS := { @DEAL_II_EXPAND_TRILINOS_VECTOR@; - @DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@; - } - // wrappers for MPI vectors (PETSc/Trilinos) EXTERNAL_PARALLEL_VECTORS := { @DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@; @DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@; diff --git a/cmake/configure/configure_2_trilinos.cmake b/cmake/configure/configure_2_trilinos.cmake index 5665d907f2..6350174e35 100644 --- a/cmake/configure/configure_2_trilinos.cmake +++ b/cmake/configure/configure_2_trilinos.cmake @@ -188,12 +188,12 @@ ENDMACRO() MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) - SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector") - SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector") + 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") SET(DEAL_II_EXPAND_TRILINOS_MPI_VECTOR "TrilinosWrappers::MPI::Vector") + IF (TRILINOS_WITH_MPI) SET(DEAL_II_EXPAND_EPETRA_VECTOR "LinearAlgebra::EpetraWrappers::Vector") ENDIF() diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index d1011b9b4d..fde42bf2f2 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index 12fe83a300..14459a046c 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/deal.II/lac/block_vector.h b/include/deal.II/lac/block_vector.h index 84882804de..0b29df377f 100644 --- a/include/deal.II/lac/block_vector.h +++ b/include/deal.II/lac/block_vector.h @@ -32,7 +32,10 @@ DEAL_II_NAMESPACE_OPEN #ifdef DEAL_II_WITH_TRILINOS namespace TrilinosWrappers { - class BlockVector; + namespace MPI + { + class BlockVector; + } } #endif @@ -136,7 +139,7 @@ public: * A copy constructor taking a (parallel) Trilinos block vector and copying * it into the deal.II own format. */ - BlockVector (const TrilinosWrappers::BlockVector &v); + BlockVector (const TrilinosWrappers::MPI::BlockVector &v); #endif /** @@ -222,7 +225,7 @@ public: * vector. */ BlockVector & - operator= (const TrilinosWrappers::BlockVector &V); + operator= (const TrilinosWrappers::MPI::BlockVector &V); #endif /** diff --git a/include/deal.II/lac/block_vector.templates.h b/include/deal.II/lac/block_vector.templates.h index b0c941e242..3be23f0d31 100644 --- a/include/deal.II/lac/block_vector.templates.h +++ b/include/deal.II/lac/block_vector.templates.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -77,7 +77,7 @@ BlockVector::BlockVector (const BlockVector &v) #ifdef DEAL_II_WITH_TRILINOS template -BlockVector::BlockVector (const TrilinosWrappers::BlockVector &v) +BlockVector::BlockVector (const TrilinosWrappers::MPI::BlockVector &v) { this->block_indices = v.get_block_indices(); this->components.resize(this->n_blocks()); @@ -151,7 +151,7 @@ BlockVector::~BlockVector () template inline BlockVector & -BlockVector::operator= (const TrilinosWrappers::BlockVector &v) +BlockVector::operator= (const TrilinosWrappers::MPI::BlockVector &v) { BaseClass::operator= (v); return *this; diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 55f5214a68..cb013d5fa1 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -1272,7 +1272,7 @@ namespace PETScWrappers { // 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::Vector), but we can save + // the documentation of TrilinosWrappers::VectorBase), 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 4c0331bb2c..f692e8dad6 100644 --- a/include/deal.II/lac/trilinos_block_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_block_sparse_matrix.h @@ -25,7 +25,7 @@ # include # include # include -# include +# include # include # include @@ -292,9 +292,9 @@ 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::MPI::BlockVector class. + * the same Map as was used for the matrix. + * + * This function only applicable if the matrix only has one block row. */ TrilinosScalar residual (MPI::BlockVector &dst, const MPI::BlockVector &x, @@ -305,25 +305,7 @@ namespace TrilinosWrappers * defined to be r=b-Mx. Write the residual into @p dst. The * l2 norm of the residual vector is returned. * - * 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::BlockVector class. Since the block matrix is in - * general distributed among processes, this function only works when - * running the program on one processor. - */ - TrilinosScalar residual (BlockVector &dst, - const BlockVector &x, - const BlockVector &b) const; - - /** - * Compute the residual of an equation Mx=b, where the residual is - * defined to be r=b-Mx. Write the residual into @p dst. The - * l2 norm of the residual vector is returned. Just like - * the previous function, but only applicable if the matrix only has one - * block row. + * This function is only applicable if the matrix only has one block row. */ TrilinosScalar residual (MPI::BlockVector &dst, const MPI::Vector &x, @@ -332,20 +314,9 @@ namespace TrilinosWrappers /** * Compute the residual of an equation Mx=b, where the residual is * defined to be r=b-Mx. Write the residual into @p dst. The - * l2 norm of the residual vector is returned. Just like - * the previous function, but only applicable if the matrix only has one - * block row. - */ - TrilinosScalar residual (BlockVector &dst, - const Vector &x, - const BlockVector &b) const; - - /** - * Compute the residual of an equation Mx=b, where the residual is - * defined to be r=b-Mx. Write the residual into @p dst. The - * l2 norm of the residual vector is returned. Just like - * the previous function, but only applicable if the matrix only has one - * block column. + * l2 norm of the residual vector is returned. + * + * This function is only applicable if the matrix only has one block column. */ TrilinosScalar residual (MPI::Vector &dst, const MPI::BlockVector &x, @@ -354,20 +325,9 @@ namespace TrilinosWrappers /** * Compute the residual of an equation Mx=b, where the residual is * defined to be r=b-Mx. Write the residual into @p dst. The - * l2 norm of the residual vector is returned. Just like - * the previous function, but only applicable if the matrix only has one - * block column. - */ - TrilinosScalar residual (Vector &dst, - const BlockVector &x, - const Vector &b) const; - - /** - * Compute the residual of an equation Mx=b, where the residual is - * defined to be r=b-Mx. Write the residual into @p dst. The - * l2 norm of the residual vector is returned. Just like - * the previous function, but only applicable if the matrix only has one - * block. + * l2 norm of the residual vector is returned. + * + * This function is only applicable if the matrix only has one block. */ TrilinosScalar residual (VectorBase &dst, const VectorBase &x, diff --git a/include/deal.II/lac/trilinos_block_vector.h b/include/deal.II/lac/trilinos_block_vector.h deleted file mode 100644 index b10402aaf1..0000000000 --- a/include/deal.II/lac/trilinos_block_vector.h +++ /dev/null @@ -1,390 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2008 - 2017 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. -// -// --------------------------------------------------------------------- - -#ifndef dealii__trilinos_block_vector_h -#define dealii__trilinos_block_vector_h - - -#include - -#ifdef DEAL_II_WITH_TRILINOS - -# include -# include -# include -# include -# include -# include - -DEAL_II_NAMESPACE_OPEN - -// forward declaration -template class BlockVector; - -/*! @addtogroup TrilinosWrappers - *@{ - */ - -namespace TrilinosWrappers -{ - // forward declaration - namespace MPI - { - class BlockVector; - } - class BlockVector; - class BlockSparseMatrix; - - - /** - * An implementation of block vectors based on the vector class implemented - * in TrilinosWrappers. While the base class provides for most of the - * interface, this class handles the actual allocation of vectors and - * provides functions that are specific to the underlying vector type. - * - * In contrast to the class MPI::BlockVector, this class is based on a - * localized version of the vectors, which means that the whole vector is - * stored on each processor. Note that matrix vector products with this - * block vector class do only work in case the program is run on only one - * processor, since the Trilinos matrices are inherently parallel. - * - * This class is deprecated, use TrilinosWrappers::MPI::BlockVector instead. - * - * @ingroup Vectors - * @ingroup TrilinosWrappers @see - * @ref GlossBlockLA "Block (linear algebra)" - * @author Martin Kronbichler, 2008 - */ - class BlockVector : public BlockVectorBase - { - public: - /** - * Typedef the base class for simpler access to its own typedefs. - */ - typedef BlockVectorBase BaseClass; - - /** - * Typedef the type of the underlying vector. - */ - typedef BaseClass::BlockType BlockType; - - /** - * Import the typedefs from the base class. - */ - typedef BaseClass::value_type value_type; - typedef BaseClass::pointer pointer; - typedef BaseClass::const_pointer const_pointer; - typedef BaseClass::reference reference; - typedef BaseClass::const_reference const_reference; - typedef BaseClass::size_type size_type; - typedef BaseClass::iterator iterator; - typedef BaseClass::const_iterator const_iterator; - - /** - * Default constructor. Generate an empty vector without any blocks. - */ - BlockVector (); - - /** - * Destructor. Clears memory - */ - ~BlockVector (); - - /** - * Copy operator: fill all components of the vector that are locally - * stored with the given scalar value. - */ - BlockVector & - operator = (const value_type s); - - /** - * Copy operator for a distributed Trilinos vector to a localized one. - */ - BlockVector & - operator = (const MPI::BlockVector &V); - - /** - * Copy operator for arguments of the same type. - */ - BlockVector & - operator = (const BlockVector &V); - - /** - * Another copy function. This one takes a deal.II block vector and copies - * it into a TrilinosWrappers block vector. Note that the number of blocks - * has to be the same in the vector as in the input vector. Use the - * reinit() command for resizing the BlockVector or for changing the - * internal structure of the block components. - * - * Since Trilinos only works on doubles, this function is limited to - * accept only one possible number type in the deal.II vector. - */ - 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 global size - * of the individual components described in the maps. Note that the - * resulting vector will be stored completely on each process. The - * Epetra_Map is useful when data exchange with a distributed vector based - * on the same Epetra_map is intended. In that case, the same communicator - * is used for data exchange. - * - * If omit_zeroing_entries==false, the vector is filled with - * zeros. - */ - void reinit (const std::vector &partitioning, - const bool omit_zeroing_entries = false); - - /** - * Reinitialize the BlockVector to contain as many blocks as there are - * index sets given in the input argument, according to the global size of - * the individual components described in the index set, and using a given - * MPI communicator. The MPI communicator is useful when data exchange - * with a distributed vector based on the same initialization is intended. - * In that case, the same communicator is used for data exchange. - * - * If omit_zeroing_entries==false, the vector is filled with - * zeros. - */ - void reinit (const std::vector &partitioning, - const MPI_Comm &communicator = MPI_COMM_WORLD, - const bool omit_zeroing_entries = false); - - /** - * Reinitialize the BlockVector to contain as many blocks as there are - * elements in the first argument, and with the respective sizes. Since no - * distribution map is given, all vectors are local vectors. - * - * If omit_zeroing_entries==false, the vector is filled with - * zeros. - */ - void reinit (const std::vector &N, - const bool omit_zeroing_entries=false); - - /** - * Reinitialize the vector in the same way as the given to a distributed - * block vector. The elements will be copied in this process. - */ - void reinit (const MPI::BlockVector &V); - - /** - * Change the dimension to that of the vector V. The same applies - * as for the other reinit() function. - * - * The elements of V are not copied, i.e. this function is the - * same as calling reinit (V.size(), omit_zeroing_entries). - * - * Note that you must call this (or the other reinit() functions) - * function, rather than calling the reinit() functions of an individual - * block, to allow the block vector to update its caches of vector sizes. - * If you call reinit() on one of the blocks, then subsequent actions on - * this object may yield unpredictable results since they may be routed to - * the wrong block. - */ - void reinit (const BlockVector &V, - const bool omit_zeroing_entries = false); - - /** - * Change the number of blocks to num_blocks. The individual - * blocks will get initialized with zero size, so it is assumed that the - * user resizes the individual blocks by herself in an appropriate way, - * and calls collect_sizes afterwards. - */ - void reinit (const size_type num_blocks); - - /** - * Swap the contents of this vector and the other vector v. One - * could do this operation with a temporary variable and copying over the - * data elements, but this function is significantly more efficient since - * it only swaps the pointers to the data of the two vectors and therefore - * does not need to allocate temporary storage and move data around. - * - * Limitation: right now this function only works if both vectors have the - * same number of blocks. If needed, the numbers of blocks should be - * exchanged, too. - * - * This function is analogous to the the swap() function of all C++ - * standard containers. Also, there is a global function swap(u,v) that - * simply calls u.swap(v), again in analogy to standard - * functions. - */ - void swap (BlockVector &v); - - /** - * Print to a stream. - */ - void print (std::ostream &out, - const unsigned int precision = 3, - const bool scientific = true, - const bool across = true) const; - - /** - * Exception - */ - DeclException0 (ExcIteratorRangeDoesNotMatchVectorSize); - - /** - * Exception - */ - DeclException0 (ExcNonMatchingBlockVectors); - - /** - * Exception - */ - DeclException2 (ExcNonLocalizedMap, - int, int, - << "For the generation of a localized vector the map has " - << "to assign all elements to all vectors! " - << "local_size = global_size is a necessary condition, but" - << arg1 << " != " << arg2 << " was given!"); - - }; - - - - /*----------------------- Inline functions ----------------------------------*/ - - - - inline - BlockVector::BlockVector () = default; - - - - inline - BlockVector::~BlockVector() = default; - - - - inline - void - BlockVector::swap (BlockVector &v) - { - Assert (n_blocks() == v.n_blocks(), - ExcDimensionMismatch(n_blocks(),v.n_blocks())); - - for (unsigned int row=0; row - BlockVector & - BlockVector::operator = (const ::dealii::BlockVector &v) - { - if (n_blocks() != v.n_blocks()) - { - std::vector block_sizes (v.n_blocks(), 0); - block_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - } - - for (size_type i=0; in_blocks(); ++i) - this->components[i] = v.block(i); - - collect_sizes(); - - return *this; - } - - - /** - * Global function which overloads the default implementation of the C++ - * standard library which uses a temporary object. The function simply - * exchanges the data of the two vectors. - * - * @relates TrilinosWrappers::BlockVector - * @author Martin Kronbichler, 2008 - */ - inline - void swap (BlockVector &u, - BlockVector &v) - { - u.swap (v); - } - -} /* namespace TrilinosWrappers */ - -/*@}*/ - - -namespace internal -{ - namespace LinearOperator - { - template class ReinitHelper; - - /** - * A helper class used internally in linear_operator.h. Specialization for - * TrilinosWrappers::BlockVector. - */ - template<> - class ReinitHelper - { - public: - template - static - void reinit_range_vector (const Matrix &matrix, - TrilinosWrappers::BlockVector &v, - bool omit_zeroing_entries) - { - v.reinit(matrix.range_partitioner(), omit_zeroing_entries); - } - - template - static - void reinit_domain_vector(const Matrix &matrix, - TrilinosWrappers::BlockVector &v, - bool omit_zeroing_entries) - { - v.reinit(matrix.domain_partitioner(), omit_zeroing_entries); - } - }; - - } /* namespace LinearOperator */ -} /* namespace internal */ - - -/** - * Declare dealii::TrilinosWrappers::BlockVector as serial vector. - * - * @author Uwe Koecher, 2017 - */ -template <> -struct is_serial_vector< TrilinosWrappers::BlockVector > : std::true_type -{ -}; - - -/** - * Declare dealii::TrilinosWrappers::MPI::BlockVector as distributed vector. - * - * @author Uwe Koecher, 2017 - */ -template <> -struct is_serial_vector< TrilinosWrappers::MPI::BlockVector > : std::false_type -{ -}; - - -DEAL_II_NAMESPACE_CLOSE - -#endif // DEAL_II_WITH_TRILINOS - -#endif diff --git a/include/deal.II/lac/trilinos_parallel_block_vector.h b/include/deal.II/lac/trilinos_parallel_block_vector.h index 9f2620da09..0b9e00a881 100644 --- a/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -31,7 +31,7 @@ DEAL_II_NAMESPACE_OPEN // forward declaration -template class BlockVector; +template class BlockVectorBase; /*! @addtogroup TrilinosWrappers *@{ @@ -44,7 +44,6 @@ namespace TrilinosWrappers { class BlockVector; } - class BlockVector; class BlockSparseMatrix; @@ -68,13 +67,13 @@ namespace TrilinosWrappers * @ref GlossBlockLA "Block (linear algebra)" * @author Martin Kronbichler, Wolfgang Bangerth, 2008, 2009 */ - class BlockVector : public BlockVectorBase + class BlockVector : public dealii::BlockVectorBase { public: /** * Typedef the base class for simpler access to its own typedefs. */ - typedef BlockVectorBase BaseClass; + typedef dealii::BlockVectorBase BaseClass; /** * Typedef the type of the underlying vector. @@ -158,12 +157,6 @@ namespace TrilinosWrappers */ BlockVector &operator= (BlockVector &&v); - /** - * Copy operator for arguments of the localized Trilinos vector type. - */ - BlockVector & - operator= (const ::dealii::TrilinosWrappers::BlockVector &v); - /** * Another copy function. This one takes a deal.II block vector and * copies it into a TrilinosWrappers block vector. Note that the number @@ -338,7 +331,7 @@ namespace TrilinosWrappers inline BlockVector::BlockVector (const BlockVector &v) : - BlockVectorBase () + dealii::BlockVectorBase () { this->components.resize (v.n_blocks()); this->block_indices = v.block_indices; @@ -467,6 +460,16 @@ namespace internal } /* namespace internal */ +/** + * Declare dealii::TrilinosWrappers::MPI::BlockVector as distributed vector. + * + * @author Uwe Koecher, 2017 + */ +template <> +struct is_serial_vector< TrilinosWrappers::MPI::BlockVector > : std::false_type +{ +}; + DEAL_II_NAMESPACE_CLOSE #endif // DEAL_II_WITH_TRILINOS diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index fb79c1ebd7..c52e99482f 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -1475,7 +1475,7 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::Vector, TrilinosWrappers::MPI::Vector as well + * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well * as deal.II's own vector classes Vector and * LinearAlgebra::distributed::Vector. * @@ -1501,7 +1501,7 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::Vector, TrilinosWrappers::MPI::Vector as well + * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well * as deal.II's own vector classes Vector and * LinearAlgebra::distributed::Vector. * @@ -1526,7 +1526,7 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::Vector, TrilinosWrappers::MPI::Vector as well + * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well * as deal.II's own vector classes Vector and * LinearAlgebra::distributed::Vector. * @@ -1536,7 +1536,7 @@ namespace TrilinosWrappers * memory architecture, using the interface in the * TrilinosWrappers::VectorBase class. * - * In case of a localized Vector (i.e., TrilinosWrappers::Vector or + * 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. @@ -1554,7 +1554,7 @@ namespace TrilinosWrappers * Source and destination must not be the same vector. * * This function can be called with several different vector objects, - * namely TrilinosWrappers::Vector, TrilinosWrappers::MPI::Vector as well + * namely TrilinosWrappers::VectorBase, TrilinosWrappers::MPI::Vector as well * as deal.II's own vector classes Vector and * LinearAlgebra::distributed::Vector. * @@ -1564,7 +1564,7 @@ namespace TrilinosWrappers * memory architecture, using the interface in the * TrilinosWrappers::VectorBase class. * - * In case of a localized Vector (i.e., TrilinosWrappers::Vector or + * 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. @@ -2989,7 +2989,7 @@ namespace TrilinosWrappers { // 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::Vector), but we can save some + // documentation of TrilinosWrappers::VectorBase), 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/trilinos_vector.h b/include/deal.II/lac/trilinos_vector.h index 2d85c1e8cf..60ffa95c6d 100644 --- a/include/deal.II/lac/trilinos_vector.h +++ b/include/deal.II/lac/trilinos_vector.h @@ -159,7 +159,7 @@ namespace TrilinosWrappers * code that may for example look like this: * * @code - * TrilinosWrappers::Vector vector; + * TrilinosWrappers::VectorBase vector; * // do some write operations on the vector * for (size_type i=0; isize(); ++i) * vector(i) = i; @@ -304,7 +304,7 @@ namespace TrilinosWrappers * (but being distributed differently among the processors). A trivial * application of this function is to generate a replication of a whole * vector on each machine, when the calling vector is built according to - * the localized vector class TrilinosWrappers::Vector, and v + * the localized vector class TrilinosWrappers::VectorBase, and v * is a distributed vector. In this case, the variable * omit_zeroing_entries needs to be set to false, * since it does not make sense to exchange data between differently @@ -348,7 +348,7 @@ namespace TrilinosWrappers * object) already is of the same size as the right hand side vector. * Otherwise, an exception will be thrown. */ - Vector &operator= (const ::dealii::TrilinosWrappers::Vector &v); + Vector &operator= (const ::dealii::TrilinosWrappers::VectorBase &v); /** * Another copy function. This one takes a deal.II vector and copies it @@ -592,212 +592,7 @@ namespace TrilinosWrappers #endif /* DOXYGEN */ } /* end of namespace MPI */ - - - - /** - * This class is a specialization of a Trilinos vector to a localized - * version. The purpose of this class is to provide a copy interface from - * the possibly parallel Vector class to a local vector on each processor, - * in order to be able to access all elements in the vector or to apply - * certain deal.II functions. - * - * This class is deprecated, use TrilinosWrappers::MPI::Vector instead. - * - * @ingroup TrilinosWrappers - * @ingroup Vectors - * @author Martin Kronbichler, 2008 - */ - class Vector : public VectorBase - { - public: - /** - * Declare type for container size. - */ - typedef dealii::types::global_dof_index size_type; - - /** - * Reinit function that resizes the vector to the size specified by - * n. The flag omit_zeroing_entries specifies whether - * the vector entries should be initialized to zero (false). If it is set - * to true, the vector entries are in an unspecified state and - * the user has to set all elements. In the current implementation, this - * method still sets the entries to zero, but this might change between - * releases without notification. - */ - void reinit (const size_type n, - const bool omit_zeroing_entries = false); - - /** - * Initialization with an Epetra_Map. Similar to the call in the other - * class MPI::Vector, with the difference that now a copy on all processes - * is generated. This initialization function is appropriate when the data - * in the localized vector should be imported from a distributed vector - * that has been initialized with the same communicator. The variable - * omit_zeroing_entries determines whether the vector should be - * filled with zero (false). If it is set to true, the vector - * entries are in an unspecified state and the user has to set all - * elements. In the current implementation, this method still sets the - * entries to zero, but this might change between releases without - * notification. - * - * Which element of the @p input_map argument are set is in fact ignored, - * the only thing that matters is the size of the index space described by - * this argument. - */ - void reinit (const Epetra_Map &input_map, - const bool omit_zeroing_entries = false); - - /** - * Initialization with an IndexSet. Similar to the call in the other class - * MPI::Vector, with the difference that now a copy on all processes is - * generated. This initialization function is appropriate in case the data - * in the localized vector should be imported from a distributed vector - * that has been initialized with the same communicator. The variable - * omit_zeroing_entries determines whether the vector should be - * filled with zero (false). If it is set to true, the vector - * entries are in an unspecified state and the user has to set all - * elements. In the current implementation, this method still sets the - * entries to zero, but this might change between releases without - * notification. - * - * Which element of the @p input_map argument are set is in fact ignored, - * the only thing that matters is the size of the index space described by - * this argument. - */ - void reinit (const IndexSet &input_map, - const MPI_Comm &communicator = MPI_COMM_WORLD, - const bool omit_zeroing_entries = false); - - /** - * Reinit function. Takes the information of a Vector and copies - * everything to the calling vector, now also allowing different maps. - * - * If the optional flag omit_zeroing_entries is not - * true, the elements in the vector are initialized with zero. If - * it is set to true, the vector entries are in an unspecified - * state and the user has to set all elements. In the current - * implementation, this method does not touch the vector entries in case - * the vector layout is unchanged from before, otherwise entries are set - * to zero. Note that this behavior might change between releases without - * notification. - */ - void reinit (const VectorBase &V, - const bool omit_zeroing_entries = false, - const bool allow_different_maps = false); - - /** - * Set all components of the vector to the given number @p s. Simply pass - * this down to the base class, but we still need to declare this function - * to make the example given in the discussion about making the - * constructor explicit work. - */ - Vector &operator= (const TrilinosScalar s); - - /** - * Set the left hand argument to the (parallel) Trilinos Vector. - * Equivalent to the @p reinit function. - */ - Vector &operator= (const MPI::Vector &v); - - /** - * Set the left hand argument to the deal.II vector. - */ - template - Vector &operator= (const ::dealii::Vector &v); - - /** - * Copy operator. Copies both the dimension and the content in the right - * hand argument. - */ - Vector &operator= (const Vector &v); - - /** - * This function does nothing but is there for compatibility with the @p - * PETScWrappers::Vector class. - * - * For the PETSc vector wrapper class, this function updates the ghost - * values of the PETSc vector. This is necessary after any modification - * before reading ghost values. - * - * However, for the implementation of this class, it is immaterial and - * thus an empty function. - */ - void update_ghost_values () const; - }; - - -// ------------------- inline and template functions -------------- - - - /** - * Global function @p swap which overloads the default implementation of the - * C++ standard library which uses a temporary object. The function simply - * exchanges the data of the two vectors. - * - * @relates TrilinosWrappers::Vector - * @author Martin Kronbichler, Wolfgang Bangerth, 2008 - */ - inline - void swap (Vector &u, Vector &v) - { - u.swap (v); - } - - -#ifndef DOXYGEN - - inline - Vector & - Vector::operator= (const TrilinosScalar s) - { - VectorBase::operator= (s); - - return *this; - } - - - - template - Vector & - Vector::operator= (const ::dealii::Vector &v) - { - if (size() != v.size()) - { - vector.reset(); - - Epetra_LocalMap map ((TrilinosWrappers::types::int_type)v.size(), 0, - Utilities::Trilinos::comm_self()); - vector.reset (new Epetra_FEVector(map)); - owned_elements = v.locally_owned_elements(); - } - - const Epetra_Map &map = vector_partitioner(); - const TrilinosWrappers::types::int_type size = map.NumMyElements(); - - Assert (map.MaxLID() == size-1, - ExcDimensionMismatch(map.MaxLID(), size-1)); - - // Need to copy out values, since the - // deal.II might not use doubles, so - // that a direct access is not possible. - for (TrilinosWrappers::types::int_type i=0; i - class ReinitHelper + class ReinitHelper { public: template static void reinit_range_vector (const Matrix &matrix, - TrilinosWrappers::Vector &v, + TrilinosWrappers::VectorBase &v, bool omit_zeroing_entries) { v.reinit(matrix.locally_owned_range_indices(), @@ -857,7 +652,7 @@ namespace internal template static void reinit_domain_vector(const Matrix &matrix, - TrilinosWrappers::Vector &v, + TrilinosWrappers::VectorBase &v, bool omit_zeroing_entries) { v.reinit(matrix.locally_owned_domain_indices(), @@ -871,12 +666,12 @@ namespace internal /** - * Declare dealii::TrilinosWrappers::Vector as serial vector. + * Declare dealii::TrilinosWrappers::VectorBase as serial vector. * * @author Uwe Koecher, 2017 */ template <> -struct is_serial_vector< TrilinosWrappers::Vector > : std::true_type +struct is_serial_vector< TrilinosWrappers::VectorBase > : std::true_type { }; diff --git a/include/deal.II/lac/trilinos_vector_base.h b/include/deal.II/lac/trilinos_vector_base.h index 54d5043f5c..523db9b0d9 100644 --- a/include/deal.II/lac/trilinos_vector_base.h +++ b/include/deal.II/lac/trilinos_vector_base.h @@ -62,6 +62,10 @@ namespace TrilinosWrappers { // forward declaration class VectorBase; + namespace MPI + { + class Vector; + } /** * @cond internal @@ -189,15 +193,14 @@ namespace TrilinosWrappers /** - * Base class for the two types of Trilinos vectors, the distributed memory - * vector MPI::Vector and a localized vector Vector. The latter is designed - * for use in either serial implementations or as a localized copy on each - * processor. The implementation of this class is based on the Trilinos - * vector class Epetra_FEVector, the (parallel) partitioning of which is - * governed by an Epetra_Map. This means that the vector type is generic and - * can be done in this base class, while the definition of the partition map - * (and hence, the constructor and reinit function) will have to be done in - * the derived classes. The Epetra_FEVector is precisely the kind of vector + * Base class for the the distributed memory vector MPI::Vector that is + * designed for use in either serial implementations or as a localized copy + * on each processor. The implementation of this class is based on the + * Trilinos vector class Epetra_FEVector, the (parallel) partitioning of which + * is governed by an Epetra_Map. This means that the vector type is generic + * and can be done in this base class, while the definition of the partition + * map (and hence, the constructor and reinit function) will have to be done + * in the derived classes. The Epetra_FEVector is precisely the kind of vector * we deal with all the time - we probably get it from some assembly * process, where also entries not locally owned might need to written and * hence need to be forwarded to the owner. The only requirement for this diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index f63389c22b..51d9fab6fc 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -56,7 +56,7 @@ namespace TrilinosWrappers { class Vector; } - class Vector; + class VectorBase; } #endif @@ -236,7 +236,7 @@ public: * wrapper vector. This copy constructor is only available if Trilinos was * detected during configuration time. */ - explicit Vector (const TrilinosWrappers::Vector &v); + explicit Vector (const TrilinosWrappers::VectorBase &v); #endif /** @@ -408,7 +408,7 @@ public: * during configuration time. */ Vector & - operator= (const TrilinosWrappers::Vector &v); + 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 f4db5bc8c8..a5eec8ad6f 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -183,7 +183,8 @@ Vector::Vector (const TrilinosWrappers::MPI::Vector &v) // be a better solution than // this, but it has not yet been // found. - TrilinosWrappers::Vector localized_vector; + TrilinosWrappers::MPI::Vector localized_vector; + localized_vector.reinit(complete_index_set(vec_size)); localized_vector.reinit (v, false, true); // get a representation of the vector @@ -200,7 +201,7 @@ Vector::Vector (const TrilinosWrappers::MPI::Vector &v) template -Vector::Vector (const TrilinosWrappers::Vector &v) +Vector::Vector (const TrilinosWrappers::VectorBase &v) : Subscriptor(), vec_size(v.size()), @@ -900,9 +901,10 @@ Vector::operator= (const TrilinosWrappers::MPI::Vector &v) // of the Trilinos vectors and // then call the other = // operator. - TrilinosWrappers::Vector localized_vector; + TrilinosWrappers::MPI::Vector localized_vector; + localized_vector.reinit(complete_index_set(v.size())); localized_vector.reinit(v, false, true); - *this = localized_vector; + *this = static_cast(localized_vector); return *this; } @@ -910,7 +912,7 @@ Vector::operator= (const TrilinosWrappers::MPI::Vector &v) template Vector & -Vector::operator= (const TrilinosWrappers::Vector &v) +Vector::operator= (const TrilinosWrappers::VectorBase &v) { if (v.size() != vec_size) reinit (v.size(), true); diff --git a/include/deal.II/multigrid/mg_transfer.h b/include/deal.II/multigrid/mg_transfer.h index 211c0e6ea3..cc8b164017 100644 --- a/include/deal.II/multigrid/mg_transfer.h +++ b/include/deal.II/multigrid/mg_transfer.h @@ -107,7 +107,7 @@ namespace internal #endif template <> - struct MatrixSelector + struct MatrixSelector { typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity; typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix; diff --git a/include/deal.II/numerics/error_estimator.templates.h b/include/deal.II/numerics/error_estimator.templates.h index 8c46da764b..4f77738bfe 100644 --- a/include/deal.II/numerics/error_estimator.templates.h +++ b/include/deal.II/numerics/error_estimator.templates.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index 03655e4354..a647c5a54d 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -49,7 +49,7 @@ # include # include # include -# include +# include #endif #include diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index 6a86068070..7fdcde38f5 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -72,9 +72,8 @@ namespace PETScWrappers namespace TrilinosWrappers { class SparseMatrix; - class Vector; class BlockSparseMatrix; - class BlockVector; + class VectorBase; namespace MPI { class Vector; @@ -855,21 +854,10 @@ namespace MatrixTools void apply_boundary_values (const std::map &boundary_values, TrilinosWrappers::SparseMatrix &matrix, - TrilinosWrappers::Vector &solution, - TrilinosWrappers::Vector &right_hand_side, + TrilinosWrappers::VectorBase &solution, + TrilinosWrappers::VectorBase &right_hand_side, const bool eliminate_columns = true); - /** - * This function does the same as the one above, except now working on block - * structures. - */ - void - apply_boundary_values (const std::map &boundary_values, - TrilinosWrappers::BlockSparseMatrix &matrix, - TrilinosWrappers::BlockVector &solution, - TrilinosWrappers::BlockVector &right_hand_side, - const bool eliminate_columns = true); - /** * Same as above, but for parallel matrices and vectors. * diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 7ee26717ae..23aede8a5b 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/algorithms/operator.cc b/source/algorithms/operator.cc index 7f1487b271..2ebf93e656 100644 --- a/source/algorithms/operator.cc +++ b/source/algorithms/operator.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include DEAL_II_NAMESPACE_OPEN diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 9e83208967..6363a2fbed 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -30,7 +30,7 @@ # include # include # include -# include +# include # endif #endif diff --git a/source/base/time_stepping.cc b/source/base/time_stepping.cc index fa8c69ecb8..61f08baf9c 100644 --- a/source/base/time_stepping.cc +++ b/source/base/time_stepping.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include DEAL_II_NAMESPACE_OPEN diff --git a/source/base/time_stepping.inst.in b/source/base/time_stepping.inst.in index 63b45cc761..bc21a7f516 100644 --- a/source/base/time_stepping.inst.in +++ b/source/base/time_stepping.inst.in @@ -30,14 +30,6 @@ for (S : REAL_SCALARS; V : DEAL_II_VEC_TEMPLATES) template class EmbeddedExplicitRungeKutta >; } -for (V : EXTERNAL_SEQUENTIAL_VECTORS) -{ - template class RungeKutta; - template class ExplicitRungeKutta; - template class ImplicitRungeKutta; - template class EmbeddedExplicitRungeKutta; -} - for (V : EXTERNAL_PARALLEL_VECTORS) { template class RungeKutta; diff --git a/source/base/utilities.cc b/source/base/utilities.cc index b53cd7e230..6b4c9ff6c8 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -61,7 +61,7 @@ DEAL_II_DISABLE_EXTRA_DIAGNOSTICS # include # include # include -# include +# include # endif # include "Teuchos_RCP.hpp" # include "Epetra_SerialComm.h" diff --git a/source/distributed/grid_refinement.cc b/source/distributed/grid_refinement.cc index efd9a05fe4..3157b0d2d5 100644 --- a/source/distributed/grid_refinement.cc +++ b/source/distributed/grid_refinement.cc @@ -18,7 +18,7 @@ #include #include #include -#include +#include #ifdef DEAL_II_WITH_P4EST diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index 27481365db..4d0d413d0e 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/distributed/solution_transfer.inst.in b/source/distributed/solution_transfer.inst.in index a5f6505c6d..4001446e94 100644 --- a/source/distributed/solution_transfer.inst.in +++ b/source/distributed/solution_transfer.inst.in @@ -37,9 +37,7 @@ 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 >; template class SolutionTransfer >; diff --git a/source/dofs/dof_accessor_get.cc b/source/dofs/dof_accessor_get.cc index c4d8ca4ec3..d937c77fbf 100644 --- a/source/dofs/dof_accessor_get.cc +++ b/source/dofs/dof_accessor_get.cc @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/dofs/dof_accessor_set.cc b/source/dofs/dof_accessor_set.cc index 99bc584562..33e873cc31 100644 --- a/source/dofs/dof_accessor_set.cc +++ b/source/dofs/dof_accessor_set.cc @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/fe/fe_tools_extrapolate.inst.in b/source/fe/fe_tools_extrapolate.inst.in index 32eea51849..266a8055c3 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 : SERIAL_VECTORS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS; VEC : REAL_SERIAL_VECTORS) { namespace FETools \{ diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index ea1927e460..845c1a0387 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index b612064a07..0f8ddfbb14 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index 2be8224305..45bd6fa291 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index 4b7ec43102..949d169292 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index 809a6f1d1a..35e58a5a9c 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -63,7 +63,7 @@ namespace #ifdef DEAL_II_WITH_TRILINOS inline TrilinosScalar - max_element (const TrilinosWrappers::Vector &criteria) + max_element (const TrilinosWrappers::VectorBase &criteria) { TrilinosScalar m = 0; criteria.trilinos_vector().MaxValue(&m); @@ -73,7 +73,7 @@ namespace inline TrilinosScalar - min_element (const TrilinosWrappers::Vector &criteria) + min_element (const TrilinosWrappers::VectorBase &criteria) { TrilinosScalar m = 0; criteria.trilinos_vector().MinValue(&m); diff --git a/source/lac/block_matrix_array.cc b/source/lac/block_matrix_array.cc index 8191a18605..c389f9d37f 100644 --- a/source/lac/block_matrix_array.cc +++ b/source/lac/block_matrix_array.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/lac/constraint_matrix.cc b/source/lac/constraint_matrix.cc index 11c69edb1e..95ae1d6291 100644 --- a/source/lac/constraint_matrix.cc +++ b/source/lac/constraint_matrix.cc @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -1366,8 +1366,7 @@ 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::Vector); -BLOCK_MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix, TrilinosWrappers::BlockVector); +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/constraint_matrix.inst.in b/source/lac/constraint_matrix.inst.in index 3061248ab3..936a743f44 100644 --- a/source/lac/constraint_matrix.inst.in +++ b/source/lac/constraint_matrix.inst.in @@ -47,18 +47,6 @@ for (S: REAL_SCALARS; T : DEAL_II_VEC_TEMPLATES) } -for (V: EXTERNAL_SEQUENTIAL_VECTORS) -{ - template void ConstraintMatrix::condense(const V&, V&) const; - template void ConstraintMatrix::condense(V&vec) const; - template void ConstraintMatrix::distribute_local_to_global ( - const Vector&, const std::vector &, V&, const FullMatrix&) const; - template void ConstraintMatrix::distribute_local_to_global ( - const Vector&, const std::vector &, const std::vector &, V&, const FullMatrix&, bool) const; - template void ConstraintMatrix::set_zero(V&) const; -} - - for (V: EXTERNAL_PARALLEL_VECTORS) { template void ConstraintMatrix::set_zero(V&) const; diff --git a/source/lac/solver.cc b/source/lac/solver.cc index 141e317af1..c4cf5a2b05 100644 --- a/source/lac/solver.cc +++ b/source/lac/solver.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/lac/trilinos_block_sparse_matrix.cc b/source/lac/trilinos_block_sparse_matrix.cc index 69a4a2c935..9c360a8b48 100644 --- a/source/lac/trilinos_block_sparse_matrix.cc +++ b/source/lac/trilinos_block_sparse_matrix.cc @@ -300,22 +300,8 @@ namespace TrilinosWrappers // TODO: In the following we // use the same code as just - // above six more times. Use + // above three more times. Use // templates. - TrilinosScalar - BlockSparseMatrix::residual (BlockVector &dst, - const BlockVector &x, - const BlockVector &b) const - { - vmult (dst, x); - dst -= b; - dst *= -1.; - - return dst.l2_norm(); - } - - - TrilinosScalar BlockSparseMatrix::residual (MPI::BlockVector &dst, const MPI::Vector &x, @@ -330,20 +316,6 @@ namespace TrilinosWrappers - TrilinosScalar - BlockSparseMatrix::residual (BlockVector &dst, - const Vector &x, - const BlockVector &b) const - { - vmult (dst, x); - dst -= b; - dst *= -1.; - - return dst.l2_norm(); - } - - - TrilinosScalar BlockSparseMatrix::residual (MPI::Vector &dst, const MPI::BlockVector &x, @@ -358,20 +330,6 @@ namespace TrilinosWrappers - TrilinosScalar - BlockSparseMatrix::residual (Vector &dst, - const BlockVector &x, - const Vector &b) const - { - vmult (dst, x); - dst -= b; - dst *= -1.; - - return dst.l2_norm(); - } - - - TrilinosScalar BlockSparseMatrix::residual (VectorBase &dst, const VectorBase &x, diff --git a/source/lac/trilinos_block_vector.cc b/source/lac/trilinos_block_vector.cc index ed1e7bcd38..a9e0ff757e 100644 --- a/source/lac/trilinos_block_vector.cc +++ b/source/lac/trilinos_block_vector.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -#include +#include #ifdef DEAL_II_WITH_TRILINOS @@ -67,19 +67,6 @@ namespace TrilinosWrappers - BlockVector & - BlockVector::operator = (const ::dealii::TrilinosWrappers::BlockVector &v) - { - Assert (n_blocks() == v.n_blocks(), - ExcDimensionMismatch(n_blocks(),v.n_blocks())); - - for (size_type i=0; in_blocks(); ++i) - this->components[i] = v.block(i); - - return *this; - } - - BlockVector::~BlockVector () {} @@ -207,176 +194,7 @@ namespace TrilinosWrappers } } /* end of namespace MPI */ - - - - - - - BlockVector & - BlockVector::operator = (const value_type s) - { - BaseClass::operator = (s); - return *this; - } - - - - void - BlockVector::reinit (const std::vector &input_maps, - const bool omit_zeroing_entries) - { - size_type no_blocks = input_maps.size(); - std::vector block_sizes (no_blocks); - - for (size_type i=0; iblock_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - - for (size_type i=0; i &partitioning, - const MPI_Comm &communicator, - const bool omit_zeroing_entries) - { - size_type no_blocks = partitioning.size(); - std::vector block_sizes (no_blocks); - - for (size_type i=0; iblock_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - - for (size_type i=0; i &block_sizes, - const bool omit_zeroing_entries) - { - this->block_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - - for (size_type i=0; i block_sizes (num_blocks, 0); - block_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - - for (size_type i=0; i block_sizes (v.n_blocks(), 0); - block_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - } - - for (size_type i=0; in_blocks(); ++i) - this->components[i] = v.block(i); - - collect_sizes(); - - return *this; - } - - - - void BlockVector::print (std::ostream &out, - const unsigned int precision, - const bool scientific, - const bool across) const - { - for (size_type i=0; in_blocks(); ++i) - { - if (across) - out << 'C' << i << ':'; - else - out << "Component " << i << std::endl; - this->components[i].print(out, precision, scientific, across); - } - } - -} +} /* end of namespace TrilinosWrappers */ DEAL_II_NAMESPACE_CLOSE diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index bf1c800007..541aeb2125 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -1991,7 +1991,7 @@ namespace TrilinosWrappers // Reinit a temporary vector with fast argument set, which does not // overwrite the content (to save time). However, the - // TrilinosWrappers::Vector classes do not support this, so create a + // 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; @@ -2016,7 +2016,7 @@ namespace TrilinosWrappers // Reinit a temporary vector with fast argument set, which does not // overwrite the content (to save time). However, the - // TrilinosWrappers::Vector classes do not support this, so create a + // 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; @@ -3368,9 +3368,6 @@ namespace TrilinosWrappers SparseMatrix::vmult (VectorBase &, const VectorBase &) const; template void - SparseMatrix::vmult (Vector &, - const Vector &) const; - template void SparseMatrix::vmult (MPI::Vector &, const MPI::Vector &) const; template void @@ -3388,9 +3385,6 @@ namespace TrilinosWrappers SparseMatrix::Tvmult (VectorBase &, const VectorBase &) const; template void - SparseMatrix::Tvmult (Vector &, - const Vector &) const; - template void SparseMatrix::Tvmult (MPI::Vector &, const MPI::Vector &) const; template void @@ -3408,9 +3402,6 @@ namespace TrilinosWrappers SparseMatrix::vmult_add (VectorBase &, const VectorBase &) const; template void - SparseMatrix::vmult_add (Vector &, - const Vector &) const; - template void SparseMatrix::vmult_add (MPI::Vector &, const MPI::Vector &) const; template void @@ -3428,9 +3419,6 @@ namespace TrilinosWrappers SparseMatrix::Tvmult_add (VectorBase &, const VectorBase &) const; template void - SparseMatrix::Tvmult_add (Vector &, - const Vector &) const; - template void SparseMatrix::Tvmult_add (MPI::Vector &, const MPI::Vector &) const; template void diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 9f33b388ce..446456765c 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -19,7 +19,7 @@ #ifdef DEAL_II_WITH_TRILINOS # include -# include +# include # include # include @@ -230,7 +230,7 @@ namespace TrilinosWrappers void - Vector::reinit (const BlockVector &v, + Vector::reinit (const MPI::BlockVector &v, const bool import_data) { nonlocal_vector.reset(); @@ -444,7 +444,7 @@ namespace TrilinosWrappers Vector & - Vector::operator = (const TrilinosWrappers::Vector &v) + Vector::operator = (const TrilinosWrappers::VectorBase &v) { nonlocal_vector.reset(); @@ -489,173 +489,7 @@ namespace TrilinosWrappers } } /* end of namespace MPI */ - - - - void - Vector::reinit (const size_type n, - const bool /*omit_zeroing_entries*/) - { - owned_elements = complete_index_set(n); - Epetra_LocalMap map ((TrilinosWrappers::types::int_type)n, 0, - Utilities::Trilinos::comm_self()); - vector.reset (new Epetra_FEVector (map)); - - last_action = Zero; - } - - - - void - Vector::reinit (const Epetra_Map &input_map, - const bool /*omit_zeroing_entries*/) - { - Epetra_LocalMap map (TrilinosWrappers::n_global_elements(input_map), - input_map.IndexBase(), - input_map.Comm()); - vector.reset (new Epetra_FEVector(map)); - owned_elements = complete_index_set(TrilinosWrappers::n_global_elements(input_map)); - - last_action = Zero; - } - - - - void - Vector::reinit (const IndexSet &partitioning, - const MPI_Comm &communicator, - const bool /*omit_zeroing_entries*/) - { - Epetra_LocalMap map (static_cast(partitioning.size()), - 0, -#ifdef DEAL_II_WITH_MPI - Epetra_MpiComm(communicator)); -#else - Epetra_SerialComm()); - (void)communicator; -#endif - vector.reset (new Epetra_FEVector(map)); - - last_action = Zero; - owned_elements = partitioning; - } - - - - void - Vector::reinit (const VectorBase &v, - const bool omit_zeroing_entries, - const bool allow_different_maps) - { - // In case we do not allow to - // have different maps, this - // call means that we have to - // reset the vector. So clear - // the vector, initialize our - // map with the map in v, and - // generate the vector. - if (allow_different_maps == false) - { - // check equality for MPI communicators -#ifdef DEAL_II_WITH_MPI - const Epetra_MpiComm *my_comm = dynamic_cast(&vector->Comm()); - const Epetra_MpiComm *v_comm = dynamic_cast(&v.vector->Comm()); - const bool same_communicators = my_comm != nullptr && v_comm != nullptr && - my_comm->DataPtr() == v_comm->DataPtr(); -#else - const bool same_communicators = true; -#endif - if (!same_communicators || local_range() != v.local_range()) - { - Epetra_LocalMap map (TrilinosWrappers::global_length(*(v.vector)), - v.vector->Map().IndexBase(), - v.vector->Comm()); - vector.reset (new Epetra_FEVector(map)); - owned_elements = v.owned_elements; - } - else if (omit_zeroing_entries) - { - int ierr; - Assert (vector->Map().SameAs(v.vector->Map()) == true, - ExcMessage ("The Epetra maps in the assignment operator =" - " do not match, even though the local_range " - " seems to be the same. Check vector setup!")); - - ierr = vector->GlobalAssemble(last_action); - (void)ierr; - Assert (ierr == 0, ExcTrilinosError(ierr)); - - ierr = vector->PutScalar(0.0); - Assert (ierr == 0, ExcTrilinosError(ierr)); - } - last_action = Zero; - } - - // Otherwise, we have to check - // that the two vectors are - // already of the same size, - // create an object for the data - // exchange and then insert all - // the data. - else - { - Assert (omit_zeroing_entries == false, - ExcMessage ("It is not possible to exchange data with the " - "option 'omit_zeroing_entries' set, which would not write " - "elements.")); - - AssertThrow (size() == v.size(), - ExcDimensionMismatch (size(), v.size())); - - Epetra_Import data_exchange (vector->Map(), v.vector->Map()); - - const int ierr = vector->Import(*v.vector, data_exchange, Insert); - AssertThrow (ierr == 0, ExcTrilinosError(ierr)); - - last_action = Insert; - } - - } - - - - Vector & - Vector::operator = (const MPI::Vector &v) - { - if (size() != v.size()) - { - Epetra_LocalMap map (TrilinosWrappers::n_global_elements(v.vector->Map()), - v.vector->Map().IndexBase(), - v.vector->Comm()); - vector.reset (new Epetra_FEVector(map)); - } - - reinit (v, false, true); - return *this; - } - - - - Vector & - Vector::operator = (const Vector &v) - { - if (size() != v.size()) - { - Epetra_LocalMap map (TrilinosWrappers::n_global_elements(v.vector->Map()), - v.vector->Map().IndexBase(), - v.vector->Comm()); - vector.reset (new Epetra_FEVector(map)); - owned_elements = v.owned_elements; - } - - const int ierr = vector->Update(1.0, *v.vector, 0.0); - Assert (ierr == 0, ExcTrilinosError(ierr)); - (void)ierr; - - return *this; - } - -} +} /* end of namespace TrilinosWrappers */ DEAL_II_NAMESPACE_CLOSE diff --git a/source/lac/vector_memory.cc b/source/lac/vector_memory.cc index 3cbd37ae29..db462c0ebd 100644 --- a/source/lac/vector_memory.cc +++ b/source/lac/vector_memory.cc @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include diff --git a/source/meshworker/mesh_worker_info.cc b/source/meshworker/mesh_worker_info.cc index d9982c46ca..1eda327aac 100644 --- a/source/meshworker/mesh_worker_info.cc +++ b/source/meshworker/mesh_worker_info.cc @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/meshworker/mesh_worker_vector_selector.cc b/source/meshworker/mesh_worker_vector_selector.cc index a40a97a77d..c78d216f08 100644 --- a/source/meshworker/mesh_worker_vector_selector.cc +++ b/source/meshworker/mesh_worker_vector_selector.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include diff --git a/source/multigrid/mg_base.cc b/source/multigrid/mg_base.cc index 640eef3b8c..37fa24b6b6 100644 --- a/source/multigrid/mg_base.cc +++ b/source/multigrid/mg_base.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include diff --git a/source/multigrid/mg_level_global_transfer.cc b/source/multigrid/mg_level_global_transfer.cc index 65ccf6223a..4676b5a27e 100644 --- a/source/multigrid/mg_level_global_transfer.cc +++ b/source/multigrid/mg_level_global_transfer.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 8f2a04178b..69e7f14b94 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/multigrid/multigrid.cc b/source/multigrid/multigrid.cc index 32f49db7e8..9a4ab4c21b 100644 --- a/source/multigrid/multigrid.cc +++ b/source/multigrid/multigrid.cc @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/numerics/data_out_dof_data.cc b/source/numerics/data_out_dof_data.cc index d3500b1278..3dba0c37c2 100644 --- a/source/numerics/data_out_dof_data.cc +++ b/source/numerics/data_out_dof_data.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index b612b576f4..35dc8f5fdb 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/numerics/dof_output_operator.cc b/source/numerics/dof_output_operator.cc index f8d61c6f83..f9ba5e8412 100644 --- a/source/numerics/dof_output_operator.cc +++ b/source/numerics/dof_output_operator.cc @@ -28,7 +28,7 @@ #include #include #include -#include +#include DEAL_II_NAMESPACE_OPEN diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index df6e3a2a41..baef5624eb 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/source/numerics/fe_field_function.cc b/source/numerics/fe_field_function.cc index 817af94c38..c8959674be 100644 --- a/source/numerics/fe_field_function.cc +++ b/source/numerics/fe_field_function.cc @@ -27,7 +27,7 @@ #include #include #include -#include +#include DEAL_II_NAMESPACE_OPEN diff --git a/source/numerics/matrix_tools.cc b/source/numerics/matrix_tools.cc index 7e11e2fe0d..1f54ac4d0a 100644 --- a/source/numerics/matrix_tools.cc +++ b/source/numerics/matrix_tools.cc @@ -45,7 +45,7 @@ # include # include # include -# include +# include #endif #include diff --git a/source/numerics/matrix_tools_once.cc b/source/numerics/matrix_tools_once.cc index cea0b6260c..71cb04173a 100644 --- a/source/numerics/matrix_tools_once.cc +++ b/source/numerics/matrix_tools_once.cc @@ -45,7 +45,7 @@ # include # include # include -# include +# include #endif #include @@ -422,8 +422,8 @@ namespace MatrixTools void apply_boundary_values (const std::map &boundary_values, TrilinosWrappers::SparseMatrix &matrix, - TrilinosWrappers::Vector &solution, - TrilinosWrappers::Vector &right_hand_side, + TrilinosWrappers::VectorBase &solution, + TrilinosWrappers::VectorBase &right_hand_side, const bool eliminate_columns) { // simply redirect to the generic function @@ -449,20 +449,6 @@ namespace MatrixTools - void - apply_boundary_values (const std::map &boundary_values, - TrilinosWrappers::BlockSparseMatrix &matrix, - TrilinosWrappers::BlockVector &solution, - TrilinosWrappers::BlockVector &right_hand_side, - const bool eliminate_columns) - { - internal::TrilinosWrappers::apply_block_boundary_values (boundary_values, matrix, - solution, right_hand_side, - eliminate_columns); - } - - - void apply_boundary_values (const std::map &boundary_values, TrilinosWrappers::BlockSparseMatrix &matrix, diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 1a2148bab6..61ce839040 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 41c4f00da2..fdcc6c2984 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include DEAL_II_NAMESPACE_OPEN