]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Slight improvements to #9529 9551/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 19 Feb 2020 16:40:08 +0000 (11:40 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 19 Feb 2020 16:40:08 +0000 (11:40 -0500)
doc/news/changes/minor/20200214KatrinMang
include/deal.II/base/index_set.h
source/base/index_set.cc

index 4966c6c58a34c901e6185410894b775c31e1a9a0..b9180df43f270ac939a2cb088b8336e23850779e 100644 (file)
@@ -1,4 +1,4 @@
-New: An IndexSet::split_by_block() function is added which partitions the set indices for example based on a block structure into blocks.
-IndexSet should be defined with respect to the global block structure. In particular, dofs_per_block should be defined consistently across MPI ranks.
+New: An IndexSet::split_by_block() function is added which partitions the set
+indices, for example based on a block structure, into blocks.
 <br>
 (Katrin Mang, 2020/02/14)
index ca00bf328876aca4f16fc3b0b5c75afbdb5773b1..d4af23963fd3effd3adf2efb9c22e770bf81326e 100644 (file)
@@ -345,12 +345,14 @@ public:
   get_view(const size_type begin, const size_type end) const;
 
   /**
-   * Split the set indices represented by this object into blocks
-   * given by the @p dofs_per_block structure.
+   * Split the set indices represented by this object into blocks given by the
+   * @p n_indices_per_block structure. The sum of its entries must match the
+   * global size of the current object.
+   *
    */
   std::vector<IndexSet>
   split_by_block(
-    const std::vector<types::global_dof_index> &dofs_per_block) const;
+    const std::vector<types::global_dof_index> &n_indices_per_block) const;
 
   /**
    * Remove all elements contained in @p other from this set. In other words,
index 67892e64827b7ee2df8d3dfbae3e70bb4d44e47b..089fd80b7f6702ae8d104e3dfb9130c89db59073 100644 (file)
@@ -234,18 +234,18 @@ IndexSet::get_view(const size_type begin, const size_type end) const
 
 std::vector<IndexSet>
 IndexSet::split_by_block(
-  const std::vector<types::global_dof_index> &dofs_per_block) const
+  const std::vector<types::global_dof_index> &n_indices_per_block) const
 {
   std::vector<IndexSet> partitioned;
-  const unsigned int    n_block_dofs = dofs_per_block.size();
+  const unsigned int    n_blocks = n_indices_per_block.size();
 
-  partitioned.reserve(n_block_dofs);
+  partitioned.reserve(n_blocks);
   types::global_dof_index start = 0;
   types::global_dof_index sum   = 0;
-  for (const auto n_block_dofs : dofs_per_block)
+  for (const auto n_block_indices : n_indices_per_block)
     {
-      partitioned.push_back(this->get_view(start, start + n_block_dofs));
-      start += n_block_dofs;
+      partitioned.push_back(this->get_view(start, start + n_block_indices));
+      start += n_block_indices;
       sum += partitioned.back().size();
     }
   AssertDimension(sum, this->size());

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.