@DEAL_II_EXPAND_TRILINOS_VECTOR@;
@DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@;
@DEAL_II_EXPAND_EPETRA_VECTOR@;
- @DEAL_II_EXPAND_PETSC_VECTOR@;
@DEAL_II_EXPAND_PETSC_MPI_VECTOR@;
@DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@;
@DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@;
- @DEAL_II_EXPAND_PETSC_BLOCKVECTOR@;
@DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR@;
}
@DEAL_II_EXPAND_TRILINOS_VECTOR@;
@DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@;
@DEAL_II_EXPAND_EPETRA_VECTOR@;
- @DEAL_II_EXPAND_PETSC_VECTOR_REAL@;
@DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL@;
@DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR@;
@DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR@;
- @DEAL_II_EXPAND_PETSC_BLOCKVECTOR_REAL@;
@DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR_REAL@;
}
@DEAL_II_EXPAND_TRILINOS_VECTOR@;
@DEAL_II_EXPAND_TRILINOS_MPI_VECTOR@;
@DEAL_II_EXPAND_EPETRA_VECTOR@;
- @DEAL_II_EXPAND_PETSC_VECTOR_REAL@;
@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@;
- @DEAL_II_EXPAND_PETSC_VECTOR@;
- @DEAL_II_EXPAND_PETSC_BLOCKVECTOR@
}
// wrappers for MPI vectors (PETSc/Trilinos)
#include <deal.II/numerics/data_out.h>
#include <deal.II/lac/full_matrix.h>
-// IndexSet is used to set the size of PETScWrappers::Vector:
+// IndexSet is used to set the size of each PETScWrappers::MPI::Vector:
#include <deal.II/base/index_set.h>
// PETSc appears here because SLEPc depends on this library:
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <complex>
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 2016 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__petsc_block_sparse_matrix_h
-#define dealii__petsc_block_sparse_matrix_h
-
-
-#include <deal.II/base/config.h>
-
-#ifdef DEAL_II_WITH_PETSC
-
-# include <deal.II/base/table.h>
-# include <deal.II/lac/block_matrix_base.h>
-# include <deal.II/lac/petsc_sparse_matrix.h>
-# include <deal.II/lac/petsc_block_vector.h>
-# include <deal.II/lac/exceptions.h>
-
-# include <cmath>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-
-namespace PETScWrappers
-{
-
- /*! @addtogroup PETScWrappers
- *@{
- */
-
- /**
- * Blocked sparse matrix based on the PETScWrappers::SparseMatrix class.
- * This class implements the functions that are specific to the PETSc
- * SparseMatrix base objects for a blocked sparse matrix, and leaves the
- * actual work relaying most of the calls to the individual blocks to the
- * functions implemented in the base class. See there also for a description
- * of when this class is useful.
- *
- * In contrast to the deal.II-type SparseMatrix class, the PETSc matrices do
- * not have external objects for the sparsity patterns. Thus, one does not
- * determine the size of the individual blocks of a block matrix of this
- * type by attaching a block sparsity pattern, but by calling reinit() to
- * set the number of blocks and then by setting the size of each block
- * separately. In order to fix the data structures of the block matrix, it
- * is then necessary to let it know that we have changed the sizes of the
- * underlying matrices. For this, one has to call the collect_sizes()
- * function, for much the same reason as is documented with the
- * BlockSparsityPattern class.
- *
- * @ingroup Matrix1 @see
- * @ref GlossBlockLA "Block (linear algebra)"
- * @author Wolfgang Bangerth, 2004
- */
- class BlockSparseMatrix : public BlockMatrixBase<PETScWrappers::SparseMatrix>
- {
- public:
- /**
- * Typedef the base class for simpler access to its own typedefs.
- */
- typedef BlockMatrixBase<SparseMatrix> BaseClass;
-
- /**
- * Typedef the type of the underlying matrix.
- */
- 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;
-
- /**
- * Constructor; initializes the matrix to be empty, without any structure,
- * i.e. the matrix is not usable at all. This constructor is therefore
- * only useful for matrices which are members of a class. All other
- * matrices should be created at a point in the data flow where all
- * necessary information is available.
- *
- * You have to initialize the matrix before usage with
- * reinit(BlockSparsityPattern). The number of blocks per row and column
- * are then determined by that function.
- */
- BlockSparseMatrix ();
-
- /**
- * Destructor.
- */
- ~BlockSparseMatrix ();
-
- /**
- * Pseudo copy operator only copying empty objects. The sizes of the block
- * matrices need to be the same.
- */
- BlockSparseMatrix &
- operator = (const BlockSparseMatrix &);
-
- /**
- * This operator assigns a scalar to a matrix. Since this does usually not
- * make much sense (should we set all matrix entries to this value? Only
- * the nonzero entries of the sparsity pattern?), this operation is only
- * allowed if the actual value to be assigned is zero. This operator only
- * exists to allow for the obvious notation <tt>matrix=0</tt>, which sets
- * all elements of the matrix to zero, but keep the sparsity pattern
- * previously used.
- */
- BlockSparseMatrix &
- operator = (const double d);
-
- /**
- * Resize the matrix, by setting the number of block rows and columns.
- * This deletes all blocks and replaces them by uninitialized ones, i.e.
- * ones for which also the sizes are not yet set. You have to do that by
- * calling the @p reinit functions of the blocks themselves. Do not forget
- * to call collect_sizes() after that on this object.
- *
- * The reason that you have to set sizes of the blocks yourself is that
- * the sizes may be varying, the maximum number of elements per row may be
- * varying, etc. It is simpler not to reproduce the interface of the @p
- * SparsityPattern class here but rather let the user call whatever
- * function she desires.
- */
- void reinit (const size_type n_block_rows,
- const size_type n_block_columns);
-
- /**
- * This function collects the sizes of the sub-objects and stores them in
- * internal arrays, in order to be able to relay global indices into the
- * matrix to indices into the subobjects. You *must* call this function
- * each time after you have changed the size of the sub-objects.
- */
- void collect_sizes ();
-
- /**
- * Matrix-vector multiplication: let $dst = M*src$ with $M$ being this
- * matrix.
- */
- void vmult (BlockVector &dst,
- const BlockVector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block column.
- */
- void vmult (BlockVector &dst,
- const Vector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block row.
- */
- void vmult (Vector &dst,
- const BlockVector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block.
- */
- void vmult (Vector &dst,
- const Vector &src) const;
-
- /**
- * Matrix-vector multiplication: let $dst = M^T*src$ with $M$ being this
- * matrix. This function does the same as vmult() but takes the transposed
- * matrix.
- */
- void Tvmult (BlockVector &dst,
- const BlockVector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block row.
- */
- void Tvmult (BlockVector &dst,
- const Vector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block column.
- */
- void Tvmult (Vector &dst,
- const BlockVector &src) const;
-
- /**
- * Matrix-vector multiplication. Just like the previous function, but only
- * applicable if the matrix has only one block.
- */
- void Tvmult (Vector &dst,
- const Vector &src) const;
-
- /**
- * Return the partitioning of the domain space of this matrix, i.e., the
- * partitioning of the vectors this matrix has to be multiplied with.
- */
- std::vector< size_type > locally_owned_domain_sizes() const;
-
- /**
- * Return the partitioning of the range space of this matrix, i.e., the
- * partitioning of the vectors that are result from matrix-vector
- * products.
- */
- std::vector< size_type > locally_owned_range_sizes() const;
-
- /**
- * Make the clear() function in the base class visible, though it is
- * protected.
- */
- using BlockMatrixBase<SparseMatrix>::clear;
-
- /**
- * @addtogroup Exceptions
- * @{
- */
-
- /**
- * Exception
- */
- DeclException4 (ExcIncompatibleRowNumbers,
- int, int, int, int,
- << "The blocks [" << arg1 << ',' << arg2 << "] and ["
- << arg3 << ',' << arg4 << "] have differing row numbers.");
- /**
- * Exception
- */
- DeclException4 (ExcIncompatibleColNumbers,
- int, int, int, int,
- << "The blocks [" << arg1 << ',' << arg2 << "] and ["
- << arg3 << ',' << arg4 << "] have differing column numbers.");
- ///@}
- };
-
-
-
- /*@}*/
-
-// ------------- inline and template functions -----------------
-
- inline
- BlockSparseMatrix &
- BlockSparseMatrix::operator = (const double d)
- {
- Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
-
- for (size_type r=0; r<this->n_block_rows(); ++r)
- for (size_type c=0; c<this->n_block_cols(); ++c)
- this->block(r,c) = d;
-
- return *this;
- }
-
-
-
- inline
- void
- BlockSparseMatrix::vmult (BlockVector &dst,
- const BlockVector &src) const
- {
- BaseClass::vmult_block_block (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::vmult (BlockVector &dst,
- const Vector &src) const
- {
- BaseClass::vmult_block_nonblock (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::vmult (Vector &dst,
- const BlockVector &src) const
- {
- BaseClass::vmult_nonblock_block (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::vmult (Vector &dst,
- const Vector &src) const
- {
- BaseClass::vmult_nonblock_nonblock (dst, src);
- }
-
-
- inline
- void
- BlockSparseMatrix::Tvmult (BlockVector &dst,
- const BlockVector &src) const
- {
- BaseClass::Tvmult_block_block (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::Tvmult (BlockVector &dst,
- const Vector &src) const
- {
- BaseClass::Tvmult_block_nonblock (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::Tvmult (Vector &dst,
- const BlockVector &src) const
- {
- BaseClass::Tvmult_nonblock_block (dst, src);
- }
-
-
-
- inline
- void
- BlockSparseMatrix::Tvmult (Vector &dst,
- const Vector &src) const
- {
- BaseClass::Tvmult_nonblock_nonblock (dst, src);
- }
-
-}
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif // DEAL_II_WITH_PETSC
-
-#endif // dealii__petsc_block_sparse_matrix_h
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 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__petsc_block_vector_h
-#define dealii__petsc_block_vector_h
-
-
-#include <deal.II/base/config.h>
-
-#ifdef DEAL_II_WITH_PETSC
-
-# include <deal.II/lac/petsc_vector.h>
-# include <deal.II/lac/petsc_parallel_block_vector.h>
-# include <deal.II/lac/block_indices.h>
-# include <deal.II/lac/block_vector_base.h>
-# include <deal.II/lac/exceptions.h>
-# include <deal.II/lac/vector_type_traits.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-
-namespace PETScWrappers
-{
- /*! @addtogroup PETScWrappers
- *@{
- */
-
- /**
- * An implementation of block vectors based on the vector class implemented
- * in PETScWrappers. 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.
- *
- * This class is deprecated, use PETScWrappers::MPI::BlockVector.
- *
- * @ingroup Vectors
- *
- * @see
- * @ref GlossBlockLA "Block (linear algebra)"
- * @author Wolfgang Bangerth, 2004
- */
- class BlockVector : public BlockVectorBase<Vector>
- {
- public:
- /**
- * Typedef the base class for simpler access to its own typedefs.
- */
- typedef BlockVectorBase<Vector> 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;
-
- /**
- * Constructor. There are three ways to use this constructor. First,
- * without any arguments, it generates an object with no blocks. Given one
- * argument, it initializes <tt>num_blocks</tt> blocks, but these blocks
- * have size zero. The third variant finally initializes all blocks to the
- * same size <tt>block_size</tt>.
- *
- * Confer the other constructor further down if you intend to use blocks
- * of different sizes.
- */
- explicit BlockVector (const unsigned int num_blocks = 0,
- const size_type block_size = 0);
-
- /**
- * Copy-Constructor. Dimension set to that of V, all components are copied
- * from V
- */
- BlockVector (const BlockVector &V);
-
- /**
- * Copy-constructor: copy the values from a PETSc wrapper parallel block
- * vector class.
- *
- *
- * Note that due to the communication model of MPI, @em all processes have
- * to actually perform this operation, even if they do not use the result.
- * It is not sufficient if only one processor tries to copy the elements
- * from the other processors over to its own process space.
- */
- explicit BlockVector (const MPI::BlockVector &v);
-
- /**
- * Constructor. Set the number of blocks to <tt>n.size()</tt> and
- * initialize each block with <tt>n[i]</tt> zero elements.
- */
- BlockVector (const std::vector<size_type> &n);
-
- /**
- * Constructor. Set the number of blocks to <tt>n.size()</tt>. Initialize
- * the vector with the elements pointed to by the range of iterators given
- * as second and third argument. Apart from the first argument, this
- * constructor is in complete analogy to the respective constructor of the
- * <tt>std::vector</tt> class, but the first argument is needed in order
- * to know how to subdivide the block vector into different blocks.
- */
- template <typename InputIterator>
- BlockVector (const std::vector<size_type> &n,
- const InputIterator first,
- const InputIterator end);
-
- /**
- * Destructor. Clears memory
- */
- ~BlockVector ();
-
- /**
- * Copy operator: fill all components of the vector with the given scalar
- * value.
- */
- BlockVector &operator = (const value_type s);
-
- /**
- * Copy operator for arguments of the same type.
- */
- BlockVector &
- operator= (const BlockVector &V);
-
- /**
- * Copy all the elements of the parallel block vector @p v into this local
- * vector. Note that due to the communication model of MPI, @em all
- * processes have to actually perform this operation, even if they do not
- * use the result. It is not sufficient if only one processor tries to
- * copy the elements from the other processors over to its own process
- * space.
- */
- BlockVector &
- operator = (const MPI::BlockVector &v);
-
- /**
- * Reinitialize the BlockVector to contain <tt>num_blocks</tt> blocks of
- * size <tt>block_size</tt> each.
- *
- * If <tt>omit_zeroing_entries==false</tt>, the vector is filled with
- * zeros.
- */
- void reinit (const unsigned int num_blocks,
- const size_type block_size,
- const bool omit_zeroing_entries = false);
-
- /**
- * Reinitialize the BlockVector such that it contains
- * <tt>block_sizes.size()</tt> blocks. Each block is reinitialized to
- * dimension <tt>block_sizes[i]</tt>.
- *
- * If the number of blocks is the same as before this function was called,
- * all vectors remain the same and reinit() is called for each vector.
- *
- * If <tt>omit_zeroing_entries==false</tt>, the vector is filled with
- * zeros.
- *
- * 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 std::vector<size_type> &N,
- const bool omit_zeroing_entries=false);
-
- /**
- * Change the dimension to that of the vector <tt>V</tt>. The same applies
- * as for the other reinit() function.
- *
- * The elements of <tt>V</tt> are not copied, i.e. this function is the
- * same as calling <tt>reinit (V.size(), omit_zeroing_entries)</tt>.
- *
- * 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() of one of the blocks, then subsequent actions of
- * 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 <tt>num_blocks</tt>. 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 <tt>collect_sizes</tt> afterwards.
- */
- void reinit (const unsigned int num_blocks);
-
- /**
- * Swap the contents of this vector and the other vector <tt>v</tt>. 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 <tt>u.swap(v)</tt>, 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;
-
- /**
- * @addtogroup Exceptions
- * @{
- */
-
- /**
- * Exception
- */
- DeclException0 (ExcIteratorRangeDoesNotMatchVectorSize);
- ///@}
- } DEAL_II_DEPRECATED;
-
- /*@}*/
-
- /*----------------------- Inline functions ----------------------------------*/
-
-
-
- inline
- BlockVector::BlockVector (const unsigned int n_blocks,
- const size_type block_size)
- {
- reinit (n_blocks, block_size);
- }
-
-
-
- inline
- BlockVector::BlockVector (const std::vector<size_type> &n)
- {
- reinit (n, false);
- }
-
-
- inline
- BlockVector::BlockVector (const BlockVector &v)
- :
- BlockVectorBase<Vector > ()
- {
- this->components.resize (v.n_blocks());
- block_indices = v.block_indices;
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- this->components[i] = v.components[i];
- }
-
-
-
- inline
- BlockVector::BlockVector (const MPI::BlockVector &v)
- :
- BlockVectorBase<Vector > ()
- {
- this->components.resize (v.get_block_indices().size());
- block_indices = v.get_block_indices();
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- this->components[i] = v.block(i);
- }
-
-
-
- template <typename InputIterator>
- BlockVector::BlockVector (const std::vector<size_type> &n,
- const InputIterator first,
- const InputIterator end)
- {
- // first set sizes of blocks, but
- // don't initialize them as we will
- // copy elements soon
- (void)end;
- reinit (n, true);
- InputIterator start = first;
- for (unsigned int b=0; b<n.size(); ++b)
- {
- InputIterator end = start;
- std::advance (end, static_cast<signed int>(n[b]));
-
- for (size_type i=0; i<n[b]; ++i, ++start)
- this->block(b)(i) = *start;
- }
- Assert (start == end, ExcIteratorRangeDoesNotMatchVectorSize());
- }
-
-
-
- inline
- BlockVector &
- BlockVector::operator = (const value_type s)
- {
- BaseClass::operator = (s);
- return *this;
- }
-
-
-
- inline
- BlockVector &
- BlockVector::operator = (const BlockVector &v)
- {
- BaseClass::operator = (v);
- return *this;
- }
-
-
-
- inline
- BlockVector &
- BlockVector::operator = (const MPI::BlockVector &v)
- {
- BaseClass::operator = (v);
- return *this;
- }
-
-
-
- inline
- BlockVector::~BlockVector ()
- {}
-
-
- inline
- void
- BlockVector::reinit (const unsigned int n_bl,
- const size_type bl_sz,
- const bool omit_zeroing_entries)
- {
- std::vector<size_type> n(n_bl, bl_sz);
- reinit(n, omit_zeroing_entries);
- }
-
-
-
- inline
- void
- BlockVector::reinit (const std::vector<size_type> &n,
- const bool omit_zeroing_entries)
- {
- block_indices.reinit (n);
- if (this->components.size() != this->n_blocks())
- this->components.resize(this->n_blocks());
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- this->components[i].reinit(n[i], omit_zeroing_entries);
- }
-
-
- inline
- void
- BlockVector::reinit (const BlockVector &v,
- const bool omit_zeroing_entries)
- {
- block_indices = v.get_block_indices();
- if (this->components.size() != this->n_blocks())
- this->components.resize(this->n_blocks());
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- block(i).reinit(v.block(i), omit_zeroing_entries);
- }
-
-
-
- inline
- void
- BlockVector::reinit (const unsigned int num_blocks)
- {
- reinit (num_blocks, 0, true);
- }
-
-
-
- inline
- void
- BlockVector::swap (BlockVector &v)
- {
- Assert (this->n_blocks() == v.n_blocks(),
- ExcDimensionMismatch(this->n_blocks(), v.n_blocks()));
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- this->components[i].swap (v.components[i]);
- ::dealii::swap (this->block_indices, v.block_indices);
- }
-
-
-
- inline
- void
- BlockVector::print (std::ostream &out,
- const unsigned int precision,
- const bool scientific,
- const bool across) const
- {
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- {
- if (across)
- out << 'C' << i << ':';
- else
- out << "Component " << i << std::endl;
- this->components[i].print(out, precision, scientific, across);
- }
- }
-
-
-
-
- /**
- * 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 PETScWrappers::BlockVector
- * @author Wolfgang Bangerth, 2000
- */
- inline
- void swap (BlockVector &u,
- BlockVector &v)
- {
- u.swap (v);
- }
-
-}
-
-
-namespace internal
-{
- namespace LinearOperator
- {
- template <typename> class ReinitHelper;
-
- /**
- * A helper class used internally in linear_operator.h. Specialization for
- * PETScWrappers::BlockVector.
- */
- template<>
- class ReinitHelper<PETScWrappers::BlockVector>
- {
- public:
- template <typename Matrix>
- static
- void reinit_range_vector (const Matrix &matrix,
- PETScWrappers::BlockVector &v,
- bool omit_zeroing_entries)
- {
- v.reinit(matrix.locally_owned_range_sizes(), omit_zeroing_entries);
- }
-
- template <typename Matrix>
- static
- void reinit_domain_vector(const Matrix &matrix,
- PETScWrappers::BlockVector &v,
- bool omit_zeroing_entries)
- {
- v.reinit(matrix.locally_owned_domain_sizes(), omit_zeroing_entries);
- }
- };
-
- } /* namespace LinearOperator */
-} /* namespace internal */
-
-
-/**
- * Declare dealii::PETScWrappers::BlockVector as serial vector.
- *
- * @author Uwe Koecher, 2017
- */
-template <>
-struct is_serial_vector< PETScWrappers::BlockVector > : std::true_type
-{
-};
-
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif // DEAL_II_WITH_PETSC
-
-#endif
#include <deal.II/base/config.h>
#ifdef DEAL_II_WITH_PETSC
-
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/petsc_matrix_base.h>
-# include <deal.II/lac/petsc_vector.h>
-
+# include <deal.II/lac/petsc_parallel_vector.h>
DEAL_II_NAMESPACE_OPEN
BlockVector &
operator= (const BlockVector &V);
- /**
- * Copy the given sequential (non-distributed) block vector into the
- * present parallel block vector. It is assumed that they have the same
- * size, and this operation does not change the partitioning of the
- * parallel vectors by which its elements are distributed across several
- * MPI processes. What this operation therefore does is to copy that
- * chunk of the given vector @p v that corresponds to elements of the
- * target vector that are stored locally, and copies them, for each of
- * the individual blocks of this object. Elements that are not stored
- * locally are not touched.
- *
- * This being a parallel vector, you must make sure that @em all
- * processes call this function at the same time. It is not possible to
- * change the local part of a parallel vector on only one process,
- * independent of what other processes do, with this function.
- */
- BlockVector &
- operator= (const PETScWrappers::BlockVector &v);
-
/**
* Reinitialize the BlockVector to contain @p n_blocks of size @p
* block_size, each of which stores @p local_size elements locally. The
*/
namespace PETScWrappers
{
- // forward declaration for copy constructor from sequential vector
- class Vector;
-
/**
* Namespace for PETSc classes that work in parallel over MPI, such as
* distributed vectors and matrices.
*/
Vector &operator= (const Vector &v);
- /**
- * Copy the given sequential (non-distributed) vector into the present
- * parallel vector. It is assumed that they have the same size, and this
- * operation does not change the partitioning of the parallel vector by
- * which its elements are distributed across several MPI processes. What
- * this operation therefore does is to copy that chunk of the given
- * vector @p v that corresponds to elements of the target vector that
- * are stored locally, and copies them. Elements that are not stored
- * locally are not touched.
- *
- * This being a parallel vector, you must make sure that @em all
- * processes call this function at the same time. It is not possible to
- * change the local part of a parallel vector on only one process,
- * independent of what other processes do, with this function.
- */
- Vector &operator= (const PETScWrappers::Vector &v);
-
/**
* 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
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/petsc_matrix_base.h>
+# include <deal.II/lac/petsc_vector_base.h>
# include <vector>
DEAL_II_NAMESPACE_OPEN
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 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__petsc_vector_h
-#define dealii__petsc_vector_h
-
-
-#include <deal.II/base/config.h>
-
-#ifdef DEAL_II_WITH_PETSC
-
-# include <deal.II/base/subscriptor.h>
-# include <deal.II/lac/exceptions.h>
-# include <deal.II/lac/petsc_vector_base.h>
-# include <deal.II/lac/petsc_parallel_vector.h>
-# include <deal.II/lac/vector.h>
-# include <deal.II/lac/vector_type_traits.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-namespace PETScWrappers
-{
- /*! @addtogroup PETScWrappers
- *@{
- */
-
- /**
- * Implementation of a sequential vector class based on PETSC. All the
- * functionality is actually in the base class, except for the calls to
- * generate a sequential vector. This is possible since PETSc only works on
- * an abstract vector type and internally distributes to functions that do
- * the actual work depending on the actual vector type (much like using
- * virtual functions). Only the functions creating a vector of specific type
- * differ, and are implemented in this particular class.
- *
- * This class is deprecated, use PETScWrappers::MPI::Vector instead.
- *
- * @ingroup Vectors
- * @author Wolfgang Bangerth, 2004
- */
- class Vector : public VectorBase
- {
- public:
- /**
- * Declare type for container size.
- */
- typedef types::global_dof_index size_type;
-
- /**
- * Default constructor. Initialize the vector as empty.
- */
- Vector ();
-
- /**
- * Constructor. Set dimension to @p n and initialize all elements with
- * zero.
- *
- * The constructor is made explicit to avoid accidents like this:
- * <tt>v=0;</tt>. Presumably, the user wants to set every element of the
- * vector to zero, but instead, what happens is this call:
- * <tt>v=Vector@<number@>(0);</tt>, i.e. the vector is replaced by one of
- * length zero.
- */
- explicit Vector (const size_type n);
-
- /**
- * Copy-constructor from deal.II vectors. Sets the dimension to that of
- * the given vector, and copies all elements.
- */
- template <typename Number>
- explicit Vector (const dealii::Vector<Number> &v);
-
- /**
- * Construct it from an existing PETSc Vector of type Vec. Note: this does
- * not copy the contents and just keeps a pointer. You need to make sure
- * the vector is not used twice at the same time or destroyed while in
- * use. This class does not destroy the PETSc object. Handle with care!
- */
- explicit Vector (const Vec &v);
-
- /**
- * Copy-constructor the values from a PETSc wrapper vector class.
- */
- Vector (const Vector &v);
-
- /**
- * Copy-constructor: copy the values from a PETSc wrapper parallel vector
- * class.
- *
- * Note that due to the communication model of MPI, @em all processes have
- * to actually perform this operation, even if they do not use the result.
- * It is not sufficient if only one processor tries to copy the elements
- * from the other processors over to its own process space.
- */
- explicit Vector (const MPI::Vector &v);
-
- /**
- * Release all memory and return to a state just like after having called
- * the default constructor.
- */
- void clear ();
-
- /**
- * Copy the given vector. Resize the present vector if necessary.
- */
- Vector &operator = (const Vector &v);
-
- /**
- * Copy all the elements of the parallel vector @p v into this local
- * vector. Note that due to the communication model of MPI, @em all
- * processes have to actually perform this operation, even if they do not
- * use the result. It is not sufficient if only one processor tries to
- * copy the elements from the other processors over to its own process
- * space.
- */
- Vector &operator = (const MPI::Vector &v);
-
- /**
- * 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.
- *
- * Since the semantics of assigning a scalar to a vector are not
- * immediately clear, this operator should really only be used if you want
- * to set the entire vector to zero. This allows the intuitive notation
- * <tt>v=0</tt>. Assigning other values is deprecated and may be
- * disallowed in the future.
- */
- Vector &operator = (const PetscScalar s);
-
- /**
- * Copy the values of a deal.II vector (as opposed to those of the PETSc
- * vector wrapper class) into this object.
- */
- template <typename number>
- Vector &operator = (const dealii::Vector<number> &v);
-
- /**
- * Change the dimension of the vector to @p N. It is unspecified how
- * resizing the vector affects the memory allocation of this object; i.e.,
- * it is not guaranteed that resizing it to a smaller size actually also
- * reduces memory consumption, or if for efficiency the same amount of
- * memory is used for less data.
- *
- * If @p omit_zeroing_entries is false, the vector is filled by zeros.
- * Otherwise, the elements are left an unspecified state.
- */
- void reinit (const size_type N,
- const bool omit_zeroing_entries = false);
-
- /**
- * Change the dimension to that of the vector @p v. The same applies as
- * for the other reinit() function.
- *
- * The elements of @p v are not copied, i.e. this function is the same as
- * calling <tt>reinit (v.size(), omit_zeroing_entries)</tt>.
- */
- void reinit (const Vector &v,
- const bool omit_zeroing_entries = false);
-
- protected:
- /**
- * Create a vector of length @p n. For this class, we create a sequential
- * vector. @p n denotes the total size of the vector to be created.
- */
- void create_vector (const size_type n);
- } DEAL_II_DEPRECATED;
-
- /*@}*/
-
-// ------------------ template and inline 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 PETScWrappers::Vector
- * @author Wolfgang Bangerth, 2004
- */
- inline
- void swap (Vector &u, Vector &v)
- {
- u.swap (v);
- }
-
-
-#ifndef DOXYGEN
-
- template <typename number>
- Vector::Vector (const dealii::Vector<number> &v)
- {
- Vector::create_vector (v.size());
-
- *this = v;
- }
-
-
-
- inline
- Vector::Vector (const Vec &v)
- :
- VectorBase(v)
- {}
-
-
- inline
- Vector &
- Vector::operator = (const PetscScalar s)
- {
- VectorBase::operator = (s);
-
- return *this;
- }
-
-
- inline
- Vector &
- Vector::operator = (const Vector &v)
- {
- // if the vectors have different sizes,
- // then first resize the present one
- if (size() != v.size())
- reinit (v.size(), true);
-
- const PetscErrorCode ierr = VecCopy (v.vector, vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
-
-
-
- inline
- Vector &
- Vector::operator = (const MPI::Vector &v)
- {
- PetscErrorCode ierr;
- if (attained_ownership)
- {
- // the petsc function we call wants to
- // generate the vector itself, so destroy
- // the old one first
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
- ierr = VecDestroy (vector);
-#else
- ierr = VecDestroy (&vector);
-#endif
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- }
-
- attained_ownership = true;
-
- // then do the gather
- // operation. <rant>petsc has changed its
- // interface again, and replaced a single
- // function call by several calls that
- // are hard to understand. gets me all
- // annoyed at their development
- // model</rant>
-#if DEAL_II_PETSC_VERSION_LT(2,2,0)
- ierr = VecConvertMPIToSeqAll (static_cast<const Vec &>(v),
- &vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#else
-
- VecScatter ctx;
-
- ierr = VecScatterCreateToAll (static_cast<const Vec &>(v), &ctx, &vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#if ((PETSC_VERSION_MAJOR == 2) && \
- ((PETSC_VERSION_MINOR < 3) || \
- ((PETSC_VERSION_MINOR == 3) && \
- (PETSC_VERSION_SUBMINOR < 3))))
- ierr = VecScatterBegin (static_cast<const Vec &>(v), vector,
- INSERT_VALUES, SCATTER_FORWARD, ctx);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- ierr = VecScatterEnd (static_cast<const Vec &>(v), vector,
- INSERT_VALUES, SCATTER_FORWARD, ctx);
-
-#else
-
- ierr = VecScatterBegin (ctx,static_cast<const Vec &>(v), vector,
- INSERT_VALUES, SCATTER_FORWARD);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- ierr = VecScatterEnd (ctx, static_cast<const Vec &>(v), vector,
- INSERT_VALUES, SCATTER_FORWARD);
-
-#endif
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
- ierr = VecScatterDestroy (ctx);
-#else
- ierr = VecScatterDestroy (&ctx);
-#endif
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-#endif
-
- return *this;
- }
-
-
-
- template <typename number>
- inline
- Vector &
- Vector::operator = (const dealii::Vector<number> &v)
- {
- reinit (v.size(), true);
- // the following isn't necessarily fast,
- // but this is due to the fact that PETSc
- // doesn't offer an inlined access
- // operator.
- //
- // if someone wants to contribute some
- // code: to make this code faster, one
- // could either first convert all values
- // to PetscScalar, and then set them all
- // at once using VecSetValues. This has
- // the drawback that it could take quite
- // some memory, if the vector is large,
- // and it would in addition allocate
- // memory on the heap, which is
- // expensive. an alternative would be to
- // split the vector into chunks of, say,
- // 128 elements, convert a chunk at a
- // time and set it in the output vector
- // using VecSetValues. since 128 elements
- // is small enough, this could easily be
- // allocated on the stack (as a local
- // variable) which would make the whole
- // thing much more efficient.
- //
- // a second way to make things faster is
- // for the special case that
- // number==PetscScalar. we could then
- // declare a specialization of this
- // template, and omit the conversion. the
- // problem with this is that the best we
- // can do is to use VecSetValues, but
- // this isn't very efficient either: it
- // wants to see an array of indices,
- // which in this case a) again takes up a
- // whole lot of memory on the heap, and
- // b) is totally dumb since its content
- // would simply be the sequence
- // 0,1,2,3,...,n. the best of all worlds
- // would probably be a function in Petsc
- // that would take a pointer to an array
- // of PetscScalar values and simply copy
- // n elements verbatim into the vector...
- for (size_type i=0; i<v.size(); ++i)
- (*this)(i) = v(i);
-
- compress (::dealii::VectorOperation::insert);
-
- return *this;
- }
-#endif // DOXYGEN
-
-}
-
-namespace internal
-{
- namespace LinearOperator
- {
- template <typename> class ReinitHelper;
-
- /**
- * A helper class used internally in linear_operator.h. Specialization for
- * PETScWrappers::Vector.
- */
- template<>
- class ReinitHelper<PETScWrappers::Vector>
- {
- public:
- template <typename Matrix>
- static
- void reinit_range_vector (const Matrix &matrix,
- PETScWrappers::Vector &v,
- bool omit_zeroing_entries)
- {
- v.reinit( matrix.m(),
- omit_zeroing_entries);
- }
-
- template <typename Matrix>
- static
- void reinit_domain_vector(const Matrix &matrix,
- PETScWrappers::Vector &v,
- bool omit_zeroing_entries)
- {
- v.reinit( matrix.n(),
- omit_zeroing_entries);
- }
- };
-
- } /* namespace LinearOperator */
-} /* namespace internal */
-
-
-/**
- * Declare dealii::PETScWrappers::Vector as serial vector.
- *
- * @author Uwe Koecher, 2017
- */
-template <>
-struct is_serial_vector< PETScWrappers::Vector > : std::true_type
-{
-};
-
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif // DEAL_II_WITH_PETSC
-
-/*---------------------------- petsc_vector.h ---------------------------*/
-
-#endif
-/*---------------------------- petsc_vector.h ---------------------------*/
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/grid/tria_iterator.h>
# include <deal.II/lac/petsc_parallel_sparse_matrix.h>
# include <deal.II/lac/petsc_sparse_matrix.h>
# include <deal.II/lac/petsc_parallel_vector.h>
-# include <deal.II/lac/petsc_vector.h>
+# include <deal.II/lac/petsc_parallel_vector.h>
# include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
#endif
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_epetra_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#endif
#ifdef DEAL_II_WITH_PETSC
-# include <petscsys.h>
-# include <deal.II/lac/petsc_block_vector.h>
-# include <deal.II/lac/petsc_parallel_block_vector.h>
-# include <deal.II/lac/petsc_vector.h>
-# include <deal.II/lac/petsc_parallel_vector.h>
+# include <petscsys.h>
+# include <deal.II/lac/petsc_parallel_block_vector.h>
+# include <deal.II/lac/petsc_parallel_vector.h>
#endif
#ifdef DEAL_II_WITH_SLEPC
::release_unused_memory ();
GrowingVectorMemory<PETScWrappers::MPI::BlockVector>
::release_unused_memory ();
- GrowingVectorMemory<PETScWrappers::Vector>
- ::release_unused_memory ();
- GrowingVectorMemory<PETScWrappers::BlockVector>
- ::release_unused_memory ();
# ifdef DEAL_II_WITH_SLEPC
// and now end SLEPc (with PETSc)
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_epetra_vector.h>
#include <deal.II/base/utilities.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#ifdef DEAL_II_WITH_PETSC
- template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, DoFHandler<deal_II_dimension,deal_II_space_dimension> >;
-
- template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, DoFHandler<deal_II_dimension,deal_II_space_dimension> >;
-
template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::Vector, DoFHandler<deal_II_dimension,deal_II_space_dimension> >;
template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension,deal_II_space_dimension> >;
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/vector_element_access.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/parallel_vector.h>
#include <deal.II/lac/parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/trilinos_parallel_block_vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/trilinos_parallel_block_vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/parallel_vector.h>
#include <deal.II/lac/parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/trilinos_parallel_block_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector_base.h>
#include <deal.II/lac/block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
// functions being unused:
DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
-#ifdef DEAL_II_WITH_PETSC
- inline
- PetscScalar
- max_element (const PETScWrappers::Vector &criteria)
- {
- // this is horribly slow (since we have
- // to get the array of values from PETSc
- // in every iteration), but works
- PetscScalar m = 0;
-#ifndef PETSC_USE_COMPLEX
- for (unsigned int i=0; i<criteria.size(); ++i)
- m = std::max (m, criteria(i));
-#else
- Assert(false, ExcMessage("The GridRefinement functions should only get real-valued vectors of refinement indicators."
- " Using these functions with complex-valued PETSc vectors does not make sense."))
-#endif
- return m;
- }
-
-
- inline
- PetscScalar
- min_element (const PETScWrappers::Vector &criteria)
- {
- // this is horribly slow (since we have
- // to get the array of values from PETSc
- // in every iteration), but works
- PetscScalar m = criteria(0);
-#ifndef PETSC_USE_COMPLEX
- for (unsigned int i=1; i<criteria.size(); ++i)
- m = std::min (m, criteria(i));
-#else
- Assert(false, ExcMessage("The GridRefinement functions should only get real-valued vectors of refinement indicators."
- " Using these functions with complex-valued PETSc vectors does not make sense."))
-#endif
- return m;
- }
-#endif
-
-
#ifdef DEAL_II_WITH_TRILINOS
inline
TrilinosScalar
IF(DEAL_II_WITH_PETSC)
SET(_src
${_src}
- petsc_block_sparse_matrix.cc
petsc_full_matrix.cc
petsc_matrix_base.cc
petsc_matrix_free.cc
petsc_solver.cc
petsc_sparse_matrix.cc
petsc_vector_base.cc
- petsc_vector.cc
)
ENDIF()
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/trilinos_parallel_block_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_block_sparse_matrix.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
#ifdef DEAL_II_WITH_PETSC
MATRIX_FUNCTIONS(PETScWrappers::SparseMatrix);
-BLOCK_MATRIX_FUNCTIONS(PETScWrappers::BlockSparseMatrix);
MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix);
BLOCK_MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix);
-MATRIX_VECTOR_FUNCTIONS(PETScWrappers::SparseMatrix, PETScWrappers::Vector);
-BLOCK_MATRIX_VECTOR_FUNCTIONS(PETScWrappers::BlockSparseMatrix, PETScWrappers::BlockVector);
MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::SparseMatrix, PETScWrappers::MPI::Vector);
BLOCK_MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix ,PETScWrappers::MPI::BlockVector);
#endif
#ifdef DEAL_II_WITH_PETSC
ONLY_MATRIX_FUNCTIONS(PETScWrappers::SparseMatrix);
-ONLY_MATRIX_FUNCTIONS(PETScWrappers::BlockSparseMatrix);
ONLY_MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix);
ONLY_MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix);
#endif
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 2016 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.
-//
-// ---------------------------------------------------------------------
-
-#include <deal.II/lac/petsc_block_sparse_matrix.h>
-
-#ifdef DEAL_II_WITH_PETSC
-
-DEAL_II_NAMESPACE_OPEN
-
-namespace PETScWrappers
-{
- BlockSparseMatrix::BlockSparseMatrix ()
- {}
-
-
-
- BlockSparseMatrix::~BlockSparseMatrix ()
- {}
-
-
-
- BlockSparseMatrix &
- BlockSparseMatrix::operator = (const BlockSparseMatrix &m)
- {
- BaseClass::operator = (m);
-
- return *this;
- }
-
-
- void
- BlockSparseMatrix::
- reinit (const size_type n_block_rows,
- const size_type n_block_columns)
- {
- // first delete previous content of
- // the subobjects array
- clear ();
-
- // then resize. set sizes of blocks to
- // zero. user will later have to call
- // collect_sizes for this
- this->sub_objects.reinit (n_block_rows,
- n_block_columns);
- this->row_block_indices.reinit (n_block_rows, 0);
- this->column_block_indices.reinit (n_block_columns, 0);
-
- // and reinitialize the blocks
- for (size_type r=0; r<this->n_block_rows(); ++r)
- for (size_type c=0; c<this->n_block_cols(); ++c)
- {
- BlockType *p = new BlockType();
- this->sub_objects[r][c] = p;
- }
- }
-
- std::vector<BlockSparseMatrix::size_type >
- BlockSparseMatrix::
- locally_owned_domain_sizes() const
- {
- std::vector< size_type > index_sets;
-
- for ( unsigned int i=0; i<this->n_block_cols(); ++i)
- index_sets.push_back(this->block(0,i).n());
-
- return index_sets;
- }
-
- std::vector<BlockSparseMatrix::size_type >
- BlockSparseMatrix::
- locally_owned_range_sizes() const
- {
- std::vector< size_type > index_sets;
-
- for ( unsigned int i=0; i<this->n_block_rows(); ++i)
- index_sets.push_back(this->block(i,0).m());
-
- return index_sets;
- }
-
- void
- BlockSparseMatrix::collect_sizes ()
- {
- BaseClass::collect_sizes ();
- }
-
-}
-
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif
#ifdef DEAL_II_WITH_PETSC
-# include <deal.II/lac/petsc_block_vector.h>
-
DEAL_II_NAMESPACE_OPEN
namespace PETScWrappers
{
typedef types::global_dof_index size_type;
- BlockVector &
- BlockVector::operator = (const PETScWrappers::BlockVector &v)
- {
- this->block_indices = v.get_block_indices();
-
- if (this->components.size() != this->n_blocks())
- this->components.resize(this->n_blocks());
-
- for (unsigned int i=0; i<this->n_blocks(); ++i)
- this->block(i) = v.block(i);
-
- return *this;
- }
-
-
void
BlockVector::reinit (const unsigned int num_blocks)
{
# include <deal.II/base/mpi.h>
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/petsc_compatibility.h>
-# include <deal.II/lac/petsc_vector.h>
+# include <deal.II/lac/petsc_parallel_vector.h>
# include <deal.II/lac/sparsity_pattern.h>
# include <deal.II/lac/dynamic_sparsity_pattern.h>
#ifdef DEAL_II_WITH_PETSC
-# include <deal.II/lac/petsc_vector.h>
# include <cmath>
# include <algorithm>
}
- Vector &
- Vector::operator = (const PETScWrappers::Vector &v)
- {
- Assert(last_action==VectorOperation::unknown,
- ExcMessage("Call to compress() required before calling operator=."));
- //TODO [TH]: can not access v.last_action here. Implement is_compressed()?
- //Assert(v.last_action==VectorOperation::unknown,
- // ExcMessage("Call to compress() required before calling operator=."));
-
- // get a pointer to the local memory of
- // this vector
- PetscScalar *dest_array;
- PetscErrorCode ierr = VecGetArray (vector, &dest_array);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- // then also a pointer to the source
- // vector
- PetscScalar *src_array;
- ierr = VecGetArray (static_cast<const Vec &>(v), &src_array);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- // then copy:
- const std::pair<size_type, size_type>
- local_elements = local_range ();
- std::copy (src_array + local_elements.first,
- src_array + local_elements.second,
- dest_array);
-
- // finally restore the arrays
- ierr = VecRestoreArray (vector, &dest_array);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- ierr = VecRestoreArray (static_cast<const Vec &>(v), &src_array);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- if (has_ghost_elements())
- {
- ierr = VecGhostUpdateBegin(vector, INSERT_VALUES, SCATTER_FORWARD);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- ierr = VecGhostUpdateEnd(vector, INSERT_VALUES, SCATTER_FORWARD);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- }
- return *this;
- }
-
-
void
Vector::create_vector (const size_type n,
const size_type local_size)
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 2016 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.
-//
-// ---------------------------------------------------------------------
-
-#include <deal.II/lac/petsc_vector.h>
-
-#ifdef DEAL_II_WITH_PETSC
-
-#include <deal.II/lac/exceptions.h>
-
-# include <cmath>
-
-DEAL_II_NAMESPACE_OPEN
-
-namespace PETScWrappers
-{
-
-
- Vector::Vector ()
- {
- Vector::create_vector (0);
- }
-
-
-
- Vector::Vector (const size_type n)
- {
- Vector::create_vector (n);
- }
-
-
-
- Vector::Vector (const Vector &v)
- :
- VectorBase ()
- {
- // first create a dummy vector, then copy
- // over the other one
- Vector::create_vector (1);
- Vector::operator = (v);
- }
-
-
-
- Vector::Vector (const MPI::Vector &v)
- {
- // first create a dummy vector, then copy
- // over the other one
- Vector::create_vector (1);
- Vector::operator = (v);
- }
-
-
-
- void
- Vector::clear ()
- {
- VectorBase::clear ();
- Vector::create_vector (0);
- }
-
-
-
- void
- Vector::reinit (const size_type n,
- const bool omit_zeroing_entries)
- {
- // only do something if the sizes
- // mismatch
- if (size() != n)
- {
- // FIXME: I'd like to use this here,
- // but somehow it leads to odd errors
- // somewhere down the line in some of
- // the tests:
-// const PetscErrorCode ierr = VecSetSizes (vector, n, n);
-// AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- // so let's go the slow way:
- if (attained_ownership)
- {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
- PetscErrorCode ierr = VecDestroy (vector);
-#else
- PetscErrorCode ierr = VecDestroy (&vector);
-#endif
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- }
-
- create_vector (n);
- }
-
- // finally clear the new vector if so
- // desired
- if (omit_zeroing_entries == false)
- *this = 0;
- }
-
-
-
- void
- Vector::reinit (const Vector &v,
- const bool omit_zeroing_entries)
- {
- reinit (v.size(), omit_zeroing_entries);
- }
-
-
-
- void
- Vector::create_vector (const size_type n)
- {
- const PetscErrorCode ierr
- = VecCreateSeq (PETSC_COMM_SELF, n, &vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- attained_ownership = true;
- }
-}
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif // DEAL_II_WITH_PETSC
# include <deal.II/base/memory_consumption.h>
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/petsc_compatibility.h>
-# include <deal.II/lac/petsc_vector.h>
# include <deal.II/lac/petsc_parallel_vector.h>
# include <cmath>
# include <deal.II/base/multithread_info.h>
Assert (index < vector.size(),
ExcIndexRange (index, 0, vector.size()));
- // if the vector is local, then
- // simply access the element we
- // are interested in
- if (dynamic_cast<const PETScWrappers::Vector *>(&vector) != nullptr)
- {
- PetscInt idx = index;
- PetscScalar value;
- PetscErrorCode ierr = VecGetValues(vector.vector, 1, &idx, &value);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
- return value;
- }
-
- // there is the possibility
- // that the vector has
- // ghost elements. in that
- // case, we first need to
- // figure out which
- // elements we own locally,
- // then get a pointer to
- // the elements that are
- // stored here (both the
- // ones we own as well as
- // the ghost elements). in
- // this array, the locally
- // owned elements come
- // first followed by the
- // ghost elements whose
- // position we can get from
- // an index set
+ // The vector may have ghost entries. In that case, we first need to
+ // figure out which elements we own locally, then get a pointer to the
+ // elements that are stored here (both the ones we own as well as the
+ // ghost elements). In this array, the locally owned elements come first
+ // followed by the ghost elements whose position we can get from an
+ // index set.
if (vector.ghosted)
{
PetscInt begin, end;
PetscErrorCode ierr = VecGetOwnershipRange (vector.vector, &begin, &end);
AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-
AssertThrow ((index >= static_cast<size_type>(begin)) &&
(index < static_cast<size_type>(end)),
ExcAccessToNonlocalElement (index, begin, end-1));
- // old version which only work with
- // VecGetArray()...
PetscInt idx = index;
PetscScalar value;
ierr = VecGetValues(vector.vector, 1, &idx, &value);
# include <deal.II/lac/petsc_matrix_base.h>
# include <deal.II/lac/petsc_vector_base.h>
-# include <deal.II/lac/petsc_vector.h>
# include <deal.II/lac/slepc_spectral_transformation.h>
# include <cmath>
# include <deal.II/lac/slepc_solver.h>
# include <deal.II/lac/petsc_matrix_base.h>
-# include <deal.II/lac/petsc_vector_base.h>
-# include <deal.II/lac/petsc_vector.h>
# include <cmath>
# include <vector>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
DEAL_II_NAMESPACE_CLOSE
-
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/multigrid/mg_base.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_epetra_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_epetra_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/vector_element_access.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
# include <deal.II/lac/petsc_parallel_sparse_matrix.h>
# include <deal.II/lac/petsc_sparse_matrix.h>
# include <deal.II/lac/petsc_parallel_vector.h>
-# include <deal.II/lac/petsc_vector.h>
# include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
#endif
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/vector_element_access.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/numerics/solution_transfer.h>