]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Assert that locally_owned_elements are always linear for initializing PETSc objects
authorDaniel Arndt <d.arndt@math.uni-goettingen.de>
Sun, 11 Sep 2016 18:48:44 +0000 (20:48 +0200)
committerDaniel Arndt <d.arndt@math.uni-goettingen.de>
Mon, 12 Sep 2016 10:56:33 +0000 (12:56 +0200)
include/deal.II/lac/petsc_parallel_block_sparse_matrix.h
include/deal.II/lac/petsc_parallel_sparse_matrix.h
include/deal.II/lac/petsc_parallel_vector.h
source/lac/petsc_parallel_sparse_matrix.cc
source/lac/petsc_parallel_vector.cc

index fb5fb17786bf8c56004d536cb8edbf174f0de5ce..7113685268b022ad0486df4eb4d53335538d4171 100644 (file)
@@ -149,8 +149,8 @@ namespace PETScWrappers
        * 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 be contiguous. For a
-       * symmetric structure hand in the same vector for the first two
+       * each block. Note that the IndexSets needs to be ascending and 1:1.
+       * For a symmetric structure hand in the same vector for the first two
        * arguments.
        */
       void reinit(const std::vector<IndexSet> &rows,
index ba8574f01cabce5ab90d6fb1568d06844cc92ebf..73c7bd8e8162293f3ae9c3d59ad2f96a93212cd7 100644 (file)
@@ -317,7 +317,7 @@ namespace PETScWrappers
        * 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.
+       * ascending, 1:1 IndexSets are supported.
        */
       template <typename SparsityPatternType>
       void reinit (const IndexSet            &local_rows,
index a69df027fbb662cb4171e0bad7f2b74172ab0b0a..c8ca0e62803beb57ba57ce1c46bf014949769fff 100644 (file)
@@ -230,10 +230,11 @@ namespace PETScWrappers
                        const size_type     local_size);
 
       /**
-       * Construct 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.
+       * Construct a new parallel ghosted PETSc vector from an IndexSet.
+       * Note that @p local must be ascending and 1:1.
+       * 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
index aaf27a8ddb699ffb748a3bfef9dcf69b9f4d203e..438d7a4c3cad99c5b3aa7574055cb78ae7fd27c6 100644 (file)
@@ -354,6 +354,7 @@ namespace PETScWrappers
              ExcMessage("SparsityPattern and IndexSet have different number of columns"));
       Assert(local_rows.is_contiguous() && local_columns.is_contiguous(),
              ExcMessage("PETSc only supports contiguous row/column ranges"));
+      Assert(local_rows.is_ascending_and_one_to_one(communicator), ExcNotImplemented());
 
 #ifdef DEBUG
       {
index 0f146f59c1e4b7509cf6d23b7a0cc969c5d6ee84..c1364370f39fe7752935e137c9d6636bf0595380 100644 (file)
@@ -72,7 +72,7 @@ namespace PETScWrappers
       :
       communicator (communicator)
     {
-      Assert(local.is_contiguous(), ExcNotImplemented());
+      Assert(local.is_ascending_and_one_to_one(communicator), ExcNotImplemented());
 
       IndexSet ghost_set = ghost;
       ghost_set.subtract_set(local);
@@ -87,7 +87,7 @@ namespace PETScWrappers
       :
       communicator (communicator)
     {
-      Assert(local.is_contiguous(), ExcNotImplemented());
+      Assert(local.is_ascending_and_one_to_one(communicator), ExcNotImplemented());
       Vector::create_vector(local.size(), local.n_elements());
     }
 
@@ -189,7 +189,7 @@ namespace PETScWrappers
 
       communicator = comm;
 
-      Assert(local.is_contiguous(), ExcNotImplemented());
+      Assert(local.is_ascending_and_one_to_one(comm), ExcNotImplemented());
 
       IndexSet ghost_set = ghost;
       ghost_set.subtract_set(local);
@@ -211,7 +211,7 @@ namespace PETScWrappers
 
       communicator = comm;
 
-      Assert(local.is_contiguous(), ExcNotImplemented());
+      Assert(local.is_ascending_and_one_to_one(comm), ExcNotImplemented());
       Assert(local.size()>0, ExcMessage("can not create vector of size 0."));
       create_vector(local.size(), local.n_elements());
     }

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.