From: heister Date: Mon, 15 Jul 2013 23:31:59 +0000 (+0000) Subject: merge unified linear algebra branch back into mainline X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2be62d74f13f21429f309bebf0a6ffd2319f112;p=dealii-svn.git merge unified linear algebra branch back into mainline git-svn-id: https://svn.dealii.org/trunk@30002 0785d39b-7218-0410-832d-ea1e28bc413d --- c2be62d74f13f21429f309bebf0a6ffd2319f112 diff --cc deal.II/include/deal.II/lac/compressed_simple_sparsity_pattern.h index 9062e6cfa9,e7d37ac7bf..0d99a56085 --- a/deal.II/include/deal.II/lac/compressed_simple_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/compressed_simple_sparsity_pattern.h @@@ -145,6 -145,12 +145,12 @@@ public const size_type n, const IndexSet &rowset = IndexSet()); + /** - * Create a square matrix using ++ * Create a square SparsityPattern using + * the index set. + */ + CompressedSimpleSparsityPattern (const IndexSet &indexset); + /** * Initialize a square matrix of * dimension @p n. diff --cc deal.II/include/deal.II/lac/petsc_matrix_base.h index 500b40d778,f2c059a978..abd0f546fd --- a/deal.II/include/deal.II/lac/petsc_matrix_base.h +++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h @@@ -1172,6 -1172,13 +1172,13 @@@ namespace PETScWrapper */ void write_ascii (const PetscViewerFormat format = PETSC_VIEWER_DEFAULT); + /** - * print command, similar to write_ascii, but the same format than ++ * print command, similar to write_ascii, but the same format as + * produced by Trilinos + */ + void print (std::ostream &out, + const bool alternative_output = false) const; + /** * Returns the number bytes consumed * by this matrix on this CPU. diff --cc deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h index 0bf1727fff,0c4ec05e75..9a1b19c951 --- a/deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h @@@ -172,6 -173,31 +173,31 @@@ namespace PETScWrapper void reinit (const size_type n_block_rows, const size_type n_block_columns); + + /** + * Efficiently reinit the block matrix for a parallel computation. + * Only the BlockSparsityPattern of the Simple type can efficiently + * store large sparsity patterns in parallel, so this is the only + * supported argument. + * The IndexSets describe the locally owned range of DoFs for each block. - * Note that each IndexSet needs to contiguous. For a symmetric structure ++ * Note that each IndexSet needs to be contiguous. For a symmetric structure + * hand in the same vector for the first two arguments. + */ + void reinit(const std::vector &rows, + const std::vector &cols, + const BlockCompressedSimpleSparsityPattern &bcsp, + const MPI_Comm &com); + + + /** - * Same as above but only for a symmetric structure only. ++ * Same as above but for a symmetric structure only. + */ + void reinit(const std::vector &sizes, + const BlockCompressedSimpleSparsityPattern &bcsp, + const MPI_Comm &com); + + + /** * Matrix-vector multiplication: * let $dst = M*src$ with $M$ diff --cc deal.II/include/deal.II/lac/petsc_parallel_vector.h index 1ee6f87ae4,c8444c379f..22706dd70f --- a/deal.II/include/deal.II/lac/petsc_parallel_vector.h +++ b/deal.II/include/deal.II/lac/petsc_parallel_vector.h @@@ -269,15 -269,47 +269,47 @@@ namespace PETScWrapper */ explicit Vector (const MPI_Comm &communicator, const IndexSet &local, - const IndexSet &ghost); + const IndexSet &ghost) DEAL_II_DEPRECATED; + + /** + * Constructs a new parallel ghosted PETSc + * vector from an Indexset. Note that + * @p local must be contiguous and + * the global size of the vector is + * determined by local.size(). The + * global indices in @p ghost are + * supplied as ghost indices that can + * also be read locally. + * + * Note that the @p ghost IndexSet + * may be empty and that any indices + * already contained in @p local are + * ignored during construction. That + * way, the ghost parameter can equal + * the set of locally relevant + * degrees of freedom, see step-32. + * + * @note This operation always creates a ghosted + * vector. + */ - explicit Vector (const IndexSet &local, ++ Vector (const IndexSet &local, + const IndexSet &ghost, - const MPI_Comm &communicator = MPI_COMM_WORLD); ++ const MPI_Comm &communicator); /** * Constructs a new parallel PETSc * vector from an Indexset. This creates a non * ghosted vector. */ - explicit Vector (const MPI_Comm &communicator, - const IndexSet &local); + explicit Vector (const MPI_Comm &communicator, + const IndexSet &local) DEAL_II_DEPRECATED; + /** + * Constructs a new parallel PETSc + * vector from an Indexset. This creates a non + * ghosted vector. + */ + explicit Vector (const IndexSet &local, - const MPI_Comm &communicator = MPI_COMM_WORLD); ++ const MPI_Comm &communicator); /** * Copy the given vector. Resize the @@@ -409,7 -441,15 +441,15 @@@ */ void reinit (const MPI_Comm &communicator, const IndexSet &local, - const IndexSet &ghost); + const IndexSet &ghost) DEAL_II_DEPRECATED; + /** + * Reinit as a vector without ghost elements. See + * constructor with same signature + * for more detais. + */ + void reinit (const IndexSet &local, + const IndexSet &ghost, - const MPI_Comm &communicator = MPI_COMM_WORLD); ++ const MPI_Comm &communicator); /** * Reinit as a vector without ghost elements. See @@@ -417,7 -457,14 +457,14 @@@ * for more detais. */ void reinit (const MPI_Comm &communicator, - const IndexSet &local); + const IndexSet &local) DEAL_II_DEPRECATED; + /** + * Reinit as a vector without ghost elements. See + * constructor with same signature + * for more detais. + */ + void reinit (const IndexSet &local, - const MPI_Comm &communicator = MPI_COMM_WORLD); ++ const MPI_Comm &communicator); /** * Return a reference to the MPI