]> https://gitweb.dealii.org/ - dealii.git/commitdiff
merge from mainline
authorTimo Heister <timo.heister@gmail.com>
Wed, 5 Jun 2013 18:27:06 +0000 (18:27 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 5 Jun 2013 18:27:06 +0000 (18:27 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29764 0785d39b-7218-0410-832d-ea1e28bc413d

20 files changed:
1  2 
deal.II/examples/step-32/step-32.cc
deal.II/examples/step-40/step-40.cc
deal.II/examples/step-42/step-42.cc
deal.II/examples/step-6/step-6.cc
deal.II/include/deal.II/grid/grid_generator.h
deal.II/include/deal.II/lac/block_sparsity_pattern.h
deal.II/include/deal.II/lac/compressed_simple_sparsity_pattern.h
deal.II/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_block_vector.h
deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h
deal.II/include/deal.II/lac/petsc_parallel_vector.h
deal.II/include/deal.II/lac/trilinos_vector.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/include/deal.II/lac/vector.templates.h
deal.II/source/lac/compressed_simple_sparsity_pattern.cc
deal.II/source/lac/petsc_parallel_block_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_vector.cc
deal.II/source/lac/trilinos_vector.cc
deal.II/source/lac/trilinos_vector_base.cc

Simple merge
Simple merge
Simple merge
index 049bfcc3cd5e2d6410e5b964b3365259639eb144,75b32ce2e17ed41a2dcebca58e7f94a010df0a28..8217eb3aaac5e2a5f68a6354c1808ef490d64f91
@@@ -409,9 -395,9 +409,9 @@@ void Step6<dim>::assemble_system (
    const unsigned int   n_q_points    = quadrature_formula.size();
  
    FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
 -  Vector<double>       cell_rhs (dofs_per_cell);
 +  LA::Vector       cell_rhs (dofs_per_cell);
  
-   std::vector<unsigned int> local_dof_indices (dofs_per_cell);
+   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
  
    const Coefficient<dim> coefficient;
    std::vector<double>    coefficient_values (n_q_points);
index fe2fcf94d3f35d5af1d1443f4c4c8987c8771970,9062e6cfa9c85c89a297c006d4b7cb7fc75ac3b7..e7d37ac7bf9794d5c5b39db13ac1366a0078c27c
@@@ -136,16 -141,10 +141,16 @@@ public
     * default argument keeps all
     * entries.
     */
-   CompressedSimpleSparsityPattern (const unsigned int m,
-                                    const unsigned int n,
+   CompressedSimpleSparsityPattern (const size_type m,
+                                    const size_type n,
                                     const IndexSet &rowset = IndexSet());
  
 +  /**
 +   * Create a square matrix using
 +   * the index set.
 +   */
 +  CompressedSimpleSparsityPattern (const IndexSet &indexset);
 +
    /**
     * Initialize a square matrix of
     * dimension @p n.
index 1d0e1903b9b5f5ff304c25eea7707cca2e8f5c21,0bf1727ffff1942819b9b0e9082ef370a2fcde56..0c4ec05e75fc0ed35e36ea7e2a4123a25bd09cd1
@@@ -170,34 -169,9 +170,34 @@@ namespace PETScWrapper
         * user call whatever function
         * she desires.
         */
-       void reinit (const unsigned int n_block_rows,
-                    const unsigned int n_block_columns);
+       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
 +       * hand in the same vector for the first two arguments.
 +       */
 +      void reinit(const std::vector<IndexSet> &rows,
 +          const std::vector<IndexSet> &cols,
 +          const BlockCompressedSimpleSparsityPattern &bcsp,
 +          const MPI_Comm &com);
 +
 +
 +      /**
 +       * Same as above but only for a symmetric structure only.
 +       */
 +      void reinit(const std::vector<IndexSet> &sizes,
 +          const BlockCompressedSimpleSparsityPattern &bcsp,
 +          const MPI_Comm &com);
 +
 +
 +
        /**
         * Matrix-vector multiplication:
         * let $dst = M*src$ with $M$
index 93c04f4371853649ec517dc00ce0bf85a2de7af5,2b963cb2aca1f943a469762b77e756099532fb54..0cc526249c64d7a5872859764d59eecbfaa2bc2a
@@@ -368,25 -365,13 +372,25 @@@ namespace PETScWrapper
         * the start.
         */
        template <typename SparsityType>
-       void reinit (const MPI_Comm                  &communicator,
-                    const SparsityType              &sparsity_pattern,
-                    const std::vector<unsigned int> &local_rows_per_process,
-                    const std::vector<unsigned int> &local_columns_per_process,
-                    const unsigned int               this_process,
-                    const bool                       preset_nonzero_locations = true);
+       void reinit (const MPI_Comm               &communicator,
+                    const SparsityType           &sparsity_pattern,
+                    const std::vector<size_type> &local_rows_per_process,
+                    const std::vector<size_type> &local_columns_per_process,
+                    const unsigned int            this_process,
+                    const bool                    preset_nonzero_locations = true);
  
 +      /**
 +       * Create a matrix where the size() of the IndexSets determine the global
 +       * number of rows and columns and the entries of the IndexSet give
 +       * the rows and columns for the calling processor.
 +       * Note that only contiguous IndexSets are supported.
 +       */
 +      template <typename SparsityType>
 +      void reinit (const IndexSet & local_rows,
 +                  const IndexSet & local_columns,
 +                   const SparsityType         &sparsity_pattern,
 +                   const MPI_Comm                  &communicator);
 +
        /**
         * Return a reference to the MPI
         * communicator object in use with
         * Same as previous functions.
         */
        template <typename SparsityType>
-       void do_reinit (const SparsityType              &sparsity_pattern,
-                       const std::vector<unsigned int> &local_rows_per_process,
-                       const std::vector<unsigned int> &local_columns_per_process,
-                       const unsigned int               this_process,
-                       const bool                       preset_nonzero_locations);
+       void do_reinit (const SparsityType           &sparsity_pattern,
+                       const std::vector<size_type> &local_rows_per_process,
+                       const std::vector<size_type> &local_columns_per_process,
+                       const unsigned int            this_process,
+                       const bool                    preset_nonzero_locations);
  
 +      /**
 +       * Same as previous functions.
 +       */
 +      template <typename SparsityType>
 +      void do_reinit (const IndexSet & local_rows,
 +                      const IndexSet & local_columns,
 +                       const SparsityType         &sparsity_pattern);
 +
        /**
         *  To allow calling protected
         *  prepare_add() and
index 6905fe21e12eacaa3ede0b1fb6295875c3350fa0,07206370d975910b9edfb17915c3faae196b7f4e..c7bc7f7d399d338aff99b1d6545026621fbd2340
@@@ -249,17 -249,8 +249,17 @@@ CompressedSimpleSparsityPattern::Compre
  }
  
  
 +CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const IndexSet &rowset_)
 +  :
 +  rows(0),
 +  cols(0),
 +  rowset(0)
 +{
 +  reinit (rowset_.size(), rowset_.size(), rowset_);
 +}
 +
  
- CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const unsigned int n)
+ CompressedSimpleSparsityPattern::CompressedSimpleSparsityPattern (const size_type n)
    :
    rows(0),
    cols(0),
index ecc5dac544c1c3dbd9d6102d6c5fed3adeac1a42,ffefdf851db70232b5655fda9176e704fd1a5ed3..da6b5f19537a0989d610a3d25c9a9e4e57a0d44e
@@@ -99,26 -99,16 +99,26 @@@ namespace PETScWrapper
        return *this;
      }
  
 +    void
 +    SparseMatrix::copy_from (const SparseMatrix &other)
 +    {
 +      if (&other == this)
 +        return;
 +
 +      this->communicator = other.communicator;
  
 +      int ierr = MatCopy(other.matrix, matrix, SAME_NONZERO_PATTERN);
 +      AssertThrow (ierr == 0, ExcPETScError(ierr));
 +    }
  
      void
-     SparseMatrix::reinit (const MPI_Comm    &communicator,
-                           const unsigned int m,
-                           const unsigned int n,
-                           const unsigned int local_rows,
-                           const unsigned int local_columns,
-                           const unsigned int n_nonzero_per_row,
-                           const bool         is_symmetric)
+     SparseMatrix::reinit (const MPI_Comm  &communicator,
+                           const size_type  m,
+                           const size_type  n,
+                           const size_type  local_rows,
+                           const size_type  local_columns,
+                           const size_type  n_nonzero_per_row,
+                           const bool       is_symmetric)
      {
        this->communicator = communicator;
  
                   preset_nonzero_locations);
      }
  
 +    template <typename SparsityType>
 +    void
 +    SparseMatrix::
 +    reinit (const IndexSet & local_rows,
 +        const IndexSet & local_columns,
 +        const SparsityType &sparsity_pattern,
 +        const MPI_Comm &communicator)
 +    {
 +      this->communicator = communicator;
  
 +      // get rid of old matrix and generate a
 +      // new one
 +#if DEAL_II_PETSC_VERSION_LT(3,2,0)
 +      const int ierr = MatDestroy (matrix);
 +#else
 +      const int ierr = MatDestroy (&matrix);
 +#endif
 +      AssertThrow (ierr == 0, ExcPETScError(ierr));
 +
 +      do_reinit (local_rows, local_columns, sparsity_pattern);
 +    }
  
      void
-     SparseMatrix::do_reinit (const unsigned int m,
-                              const unsigned int n,
-                              const unsigned int local_rows,
-                              const unsigned int local_columns,
-                              const unsigned int n_nonzero_per_row,
-                              const bool         is_symmetric)
+     SparseMatrix::do_reinit (const size_type m,
+                              const size_type n,
+                              const size_type local_rows,
+                              const size_type local_columns,
+                              const size_type n_nonzero_per_row,
+                              const bool      is_symmetric)
      {
        Assert (local_rows <= m, ExcLocalRowsTooLarge (local_rows, m));
  
                            const unsigned int,
                            const bool);
  
 +    template void
 +    SparseMatrix::
 +        reinit (const IndexSet &,
 +            const IndexSet &,
 +            const CompressedSimpleSparsityPattern &,
 +            const MPI_Comm                  &);
 +
      template void
      SparseMatrix::do_reinit (const SparsityPattern &,
-                              const std::vector<unsigned int> &,
-                              const std::vector<unsigned int> &,
+                              const std::vector<size_type> &,
+                              const std::vector<size_type> &,
                               const unsigned int ,
                               const bool);
      template void
Simple merge
index 9df5d996513759dfbcb88775632ba89bdb470265,c2695901eea87657787dfa8f1306130244d2f692..17e2b41c0c00481148cd46f04f6e1a7dcf9e9a76
@@@ -422,14 -446,10 +446,15 @@@ namespace TrilinosWrapper
      //one index and the value per local
      //entry.
      return sizeof(*this)
-            + this->local_size()*( sizeof(double)+sizeof(int) );
+            + this->local_size()*( sizeof(double)+
+                sizeof(TrilinosWrappers::types::int_type) );
    }
  
 +  void
 +  VectorBase::update_ghost_values() const
 +  {
 +  }
 +
  } /* end of namespace TrilinosWrappers */
  
  

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.