]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Merge from mainline.
authorturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 21:58:09 +0000 (21:58 +0000)
committerturcksin <turcksin@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 21:58:09 +0000 (21:58 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29091 0785d39b-7218-0410-832d-ea1e28bc413d

30 files changed:
1  2 
deal.II/examples/step-17/step-17.cc
deal.II/examples/step-18/step-18.cc
deal.II/examples/step-36/step-36.cc
deal.II/examples/step-40/step-40.cc
deal.II/include/deal.II/base/mpi.h
deal.II/include/deal.II/lac/trilinos_precondition.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/source/lac/petsc_vector_base.cc
tests/distributed_grids/2d_dofhandler_01.cc
tests/distributed_grids/count_dofs_per_block_01.cc
tests/distributed_grids/count_dofs_per_component_01.cc
tests/distributed_grids/dof_handler_number_cache.cc
tests/mpi/count_dofs_per_block_01.cc
tests/mpi/count_dofs_per_block_02.cc
tests/mpi/count_dofs_per_component_01.cc
tests/mpi/map_dofs_to_support_points.cc
tests/mpi/mg_03.cc
tests/mpi/p4est_2d_dofhandler_01.cc
tests/mpi/p4est_2d_dofhandler_03.cc
tests/mpi/p4est_2d_dofhandler_04.cc
tests/mpi/p4est_2d_renumber_01.cc
tests/mpi/p4est_2d_renumber_02.cc
tests/mpi/petsc_02.cc
tests/mpi/renumber_z_order_01.cc
tests/mpi/renumber_z_order_02.cc
tests/petsc/52.cc
tests/petsc/67.cc
tests/petsc/69.cc
tests/petsc/block_vector_iterator_03.cc
tests/petsc/parallel_sparse_matrix_01.cc

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 5414e00d1f47e3c9c2a4bd15bb2c7862b25dbe95,134bc47064ad90670160120b6f3be424cf97b5ac..51d06b880a50c674cd8c98e79ddff1cbcd417268
@@@ -192,11 -187,15 +192,15 @@@ namespace TrilinosWrapper
         * Exception
         */
        DeclException3 (ExcAccessToNonLocalElement,
 -                      int, int, int,
 +                      size_type, size_type, size_type,
                        << "You tried to access element " << arg1
-                       << " of a distributed vector, but only elements "
+                       << " of a distributed vector, but it is not stored on "
+                       << "the current processor. Note: the elements stored "
+                       << "on the current processor are within the range "
                        << arg2 << " through " << arg3
-                       << " are stored locally and can be accessed.");
+                       << " but Trilinos vectors need not store contiguous "
+                       << "ranges on each processor, and not every element in "
+                       << "this range may in fact be stored locally.");
  
      private:
        /**
       * that is stored locally. If
       * this is a sequential vector,
       * then the result will be the
-      * pair (0,N), otherwise it will
-      * be a pair (i,i+n), where
-      * <tt>n=local_size()</tt>.
+      * pair <code>(0,N)</code>, otherwise it will
+      * be a pair <code>(i,i+n)</code>, where
+      * <code>n=local_size()</code> and <code>i</code> is the first
+      * element of the vector stored on this processor, corresponding
+      * to the half open interval $[i,i+n)$
+      *
+      * @note The description above is true most of the time, but
+      * not always. In particular, Trilinos vectors need not store
+      * contiguous ranges of elements such as $[i,i+n)$. Rather, it
+      * can store vectors where the elements are distributed in
+      * an arbitrary way across all processors and each processor
+      * simply stores a particular subset, not necessarily contiguous.
+      * In this case, this function clearly makes no sense since it
+      * could, at best, return a range that includes all elements
+      * that are stored locally. Thus, the function only succeeds
+      * if the locally stored range is indeed contiguous. It will
+      * trigger an assertion if the local portion of the vector
+      * is not contiguous.
       */
 -    std::pair<unsigned int, unsigned int> local_range () const;
 +    std::pair<size_type, size_type> local_range () const;
  
      /**
       * Return whether @p index is in
       * the local range or not, see
       * also local_range().
+      *
+      * @note The same limitation for the applicability of this
+      * function applies as listed in the documentation of local_range().
       */
 -    bool in_local_range (const unsigned int index) const;
 +    bool in_local_range (const size_type index) const;
  
      /**
       * Return if the vector contains ghost
  
  
    inline
 -  std::pair<unsigned int, unsigned int>
 +  std::pair<VectorBase::size_type, VectorBase::size_type>
    VectorBase::local_range () const
    {
 -    int begin, end;
 +    TrilinosWrappers::types::int_type begin, end;
 +#ifndef DEAL_II_USE_LARGE_INDEX_TYPE
      begin = vector->Map().MinMyGID();
      end = vector->Map().MaxMyGID()+1;
++<<<<<<< .working
 +#else
 +    begin = vector->Map().MinMyGID64();
 +    end = vector->Map().MaxMyGID64()+1;
 +#endif
++=======
+     Assert (end-begin == vector->Map().NumMyElements(),
+             ExcMessage ("This function only makes sense if the elements that this "
+                         "vector stores on the current processor form a contiguous range. "
+                         "This does not appear to be the case for the current vector."));
++>>>>>>> .merge-right.r29088
      return std::make_pair (begin, end);
    }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index f305e6bcea435e48494ce5de39aff694bd48943d,d307922191088b929bc0346bf0a0b5d7d5e655a4..71cebb290803d4cc3014a219144103292703fd03
@@@ -60,11 -60,9 +60,11 @@@ int main (int argc,char **argv
  
    try
      {
-       PetscInitialize(&argc,&argv,0,0);
+       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
        {
 -        std::vector<unsigned int> row_lengths (5, 3U);
 +      typedef PETScWrappers::SparseMatrix::size_type size_type;
 +      
 +        std::vector<size_type> row_lengths (5, 3U);
          row_lengths.back() = 2;
          PETScWrappers::SparseMatrix m (5,5,row_lengths);
          test (m);
Simple merge
Simple merge

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.