- 31 Oct, 2019 1 commit
-
-
OpenFOAM bot authored
-
- 26 Apr, 2019 1 commit
-
-
Mark Olesen authored
- also available as equal() member function
-
- 11 Apr, 2019 1 commit
-
-
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
-
- 11 Jan, 2019 1 commit
-
-
Mark Olesen authored
- this protected method was previously used directly for the list output and had the check for 2 or more elements in it. Now simply test the List content and handle the output preference separately.
-
- 01 Aug, 2018 2 commits
-
-
Mark Olesen authored
Eg, processorPolyPatch pp = ...; UOPstream toNbr(pp.neighbProcNo(), pBufs); toNbr << PackedList<Width>(faceValues, pp.range());
-
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());
-
- 07 Mar, 2018 1 commit
-
-
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()); }
-