1. 31 Oct, 2019 1 commit
  2. 26 Apr, 2019 1 commit
  3. 11 Apr, 2019 1 commit
    • Mark Olesen's avatar
      ENH: generalize indirect lists and support new types · 765493b6
      Mark Olesen authored
      - use an IndirectListBase class for various indirect list types.
      
      - new SortList type
      
        In some places the SortList can be used as a lightweight alternative
        to SortableList to have the convenience of bundling data and sort
        indices together, but while operating on existing data lists.
        In other situations, it can be useful as an alternative to
        sortedOrder.  For example,
      
              pointField points = ...;
      
              labelList order;
              sortedOrder(points, order);
      
              forAll(order, i)
              {
                  points[order[i]] = ...;
              }
      
         Can be replaced with the following (with the same memory overhead)
      
              pointField points = ...;
      
              SortList<point> sortedPoints(points);
      
              for (point& pt : sortedPoints)
              {
                  pt = ...;
              }
      
      - new SliceList type (#1220), which can be used for stride-based
        addressing into existing lists
      765493b6
  4. 11 Jan, 2019 1 commit
  5. 01 Aug, 2018 2 commits
    • Mark Olesen's avatar
      ENH: bitSet, PackedList copy construct a subset · 9be9f02a
      Mark Olesen authored
      Eg,
          processorPolyPatch pp = ...;
      
          UOPstream toNbr(pp.neighbProcNo(), pBufs);
          toNbr << PackedList<Width>(faceValues, pp.range());
      9be9f02a
    • Mark Olesen's avatar
      ENH: add PackedList::unpack() method · 35facb82
      Mark Olesen authored
      - allows for simpler unpacking of a full list, or list range into any
        sufficiently large integral type.
      
        For example,
          processorPolyPatch pp = ...;
      
          UOPstream toNbr(pp.neighbProcNo(), pBufs);
          toNbr << faceValues.unpack<char>(pp.range());
      35facb82
  6. 07 Mar, 2018 1 commit
    • Mark Olesen's avatar
      ENH: new bitSet class and improved PackedList class (closes #751) · bac943e6
      Mark Olesen authored
      - The bitSet class replaces the old PackedBoolList class.
        The redesign provides better block-wise access and reduced method
        calls. This helps both in cases where the bitSet may be relatively
        sparse, and in cases where advantage of contiguous operations can be
        made. This makes it easier to work with a bitSet as top-level object.
      
        In addition to the previously available count() method to determine
        if a bitSet is being used, now have simpler queries:
      
          - all()  - true if all bits in the addressable range are empty
          - any()  - true if any bits are set at all.
          - none() - true if no bits are set.
      
        These are faster than count() and allow early termination.
      
        The new test() method tests the value of a single bit position and
        returns a bool without any ambiguity caused by the return type
        (like the get() method), nor the const/non-const access (like
        operator[] has). The name corresponds to what std::bitset uses.
      
        The new find_first(), find_last(), find_next() methods provide a faster
        means of searching for bits that are set.
      
        This can be especially useful when using a bitSet to control an
        conditional:
      
        OLD (with macro):
      
            forAll(selected, celli)
            {
                if (selected[celli])
                {
                    sumVol += mesh_.cellVolumes()[celli];
                }
            }
      
        NEW (with const_iterator):
      
            for (const label celli : selected)
            {
                sumVol += mesh_.cellVolumes()[celli];
            }
      
            or manually
      
            for
            (
                label celli = selected.find_first();
                celli != -1;
                celli = selected.find_next()
            )
            {
                sumVol += mesh_.cellVolumes()[celli];
            }
      
      - When marking up contiguous parts of a bitset, an interval can be
        represented more efficiently as a labelRange of start/size.
        For example,
      
        OLD:
      
            if (isA<processorPolyPatch>(pp))
            {
                forAll(pp, i)
                {
                    ignoreFaces.set(i);
                }
            }
      
        NEW:
      
            if (isA<processorPolyPatch>(pp))
            {
                ignoreFaces.set(pp.range());
            }
      bac943e6