Skip to content
Snippets Groups Projects
Commit 609fb366 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: improve flexibilty of globalIndex

- construct or reset from a list of local sizes. It is generally
  easier and safer to assemble sizes and let globalIndex determine the
  corresponding offsets, when working with raw values.

- Can use reset() from sizes or fine-tune offsets with setLocalSize()
  instead of using the potentially more fragile non-const access to
  the offsets.

- add globalIndex const_iterator to iterate across the access ranges.
  This is makes it simpler to use with the List slice() method to
  access or operate on a sub-section of list.

  For example,
      scalarField allValues = ...;
      globalIndex procAccess = ...;

      for (const labelRange& range : procAccess)
      {
          someOutput(allValues.slice(range));
      }
parent b8a4b7e8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment