1. 18 Dec, 2020 1 commit
  2. 09 Dec, 2020 1 commit
  3. 25 Nov, 2020 1 commit
  4. 16 Jul, 2020 2 commits
    • Mark OLESEN's avatar
      STYLE: check autoPtr as plain bool instead of valid() · 12c91b94
      Mark OLESEN authored
      - cleaner code, more similarity with unique_ptr
      
        Now
            if (ptr)
            if (!ptr)
      
        instead
            if (ptr.valid())
            if (!ptr.valid())
      12c91b94
    • Mark OLESEN's avatar
      STYLE: simplify short-circuit involving autoPtr (#1775) · 9af3f85c
      Mark OLESEN authored
      - with '&&' conditions, often better to check for non-null autoPtr
        first (it is cheap)
      
      - check as bool instead of valid() method for cleaner code, especially
        when the wrapped item itself has a valid/empty or good.
        Also when handling multiple checks.
      
        Now
            if (ptr && ptr->valid())
            if (ptr1 || ptr2)
      
        instead
            if (ptr.valid() && ptr->valid())
            if (ptr1.valid() || ptr2.valid())
      9af3f85c
  5. 24 Jun, 2020 2 commits
  6. 02 Jun, 2020 1 commit
    • Mark OLESEN's avatar
      ENH: unify use of dictionary method names · 3e43edf0
      Mark OLESEN authored
      - previously introduced `getOrDefault` as a dictionary _get_ method,
        now complete the transition and use it everywhere instead of
        `lookupOrDefault`. This avoids mixed usage of the two methods that
        are identical in behaviour, makes for shorter names, and promotes
        the distinction between "lookup" access (ie, return a token stream,
        locate and return an entry) and "get" access (ie, the above with
        conversion to concrete types such as scalar, label etc).
      3e43edf0
  7. 24 Feb, 2020 1 commit
  8. 18 Feb, 2020 1 commit
  9. 28 Jan, 2020 1 commit
  10. 31 Oct, 2019 1 commit
  11. 06 Feb, 2019 1 commit
  12. 06 Nov, 2018 1 commit
  13. 30 Oct, 2018 1 commit
  14. 18 Oct, 2018 1 commit
    • Mark OLESEN's avatar
      ENH: cleanup of Enum class · 3b745122
      Mark OLESEN authored
      - more dictionary-like methods, enforce keyType::LITERAL for all
        lookups to avoid any spurious keyword matching.
      
      - new readEntry, readIfPresent methods
      
      - The get() method replaces the now deprecate lookup() method.
      
      - Deprecate lookupOrFailsafe()
        Failsafe behaviour is now an optional parameter for lookupOrDefault,
        which makes it easier to tailor behaviour at runtime.
      
      - output of the names is now always flatted without line-breaks.
        Thus,
      
           os << flatOutput(someEnumNames.names()) << nl;
           os << someEnumNames << nl;
      
        both generate the same output.
      
      - Constructor now uses C-string (const char*) directly instead of
        Foam::word in its initializer_list.
      
      - Remove special enum + initializer_list constructor form since
        it can create unbounded lookup indices.
      
      - Removd old hasEnum, hasName forms that were provided during initial
        transition from NamedEnum.
      
      - Added static_assert on Enum contents to restrict to enum or
        integral values.  Should not likely be using ...
      3b745122
  15. 05 Oct, 2018 1 commit
    • Mark OLESEN's avatar
      ENH: use dictionary::readEntry for detection of input errors (#762, #1033) · 13778f76
      Mark OLESEN authored
      - instead of   dict.lookup(name) >> val;
        can use      dict.readEntry(name, val);
      
        for checking of input token sizes.
        This helps catch certain types of input errors:
      
        {
      
            key1 ;                // <- Missing value
            key2 1234             // <- Missing ';' terminator
            key3 val;
        }
      
      STYLE: readIfPresent() instead of 'if found ...' in a few more places.
      13778f76
  16. 12 Apr, 2018 1 commit
    • Mark OLESEN's avatar
      STYLE: reorder/refactor stream format options · 4cf932b2
      Mark OLESEN authored
      - IOstreamOption class to encapsulate format, compression, version.
        This is ordered to avoid internal padding in the structure, which
        reduces several bytes of memory overhead for stream objects
        and other things using this combination of data.
      
        Byte-sizes:
            old  IOstream:48  PstreamBuffers:88  Time:928
            new  IOstream:24  PstreamBuffers:72  Time:904
      
      ====
      
      STYLE: remove support for deprecated uncompressed/compressed selectors
      
      In older versions, the system/controlDict used these types of
      specifications:
      
          writeCompression uncompressed;
          writeCompression compressed;
      
      As of DEC-2009, these were deprecated in favour of using normal switch
      names:
      
          writeCompression true;
          writeCompression false;
          writeCompression on;
          writeCompression off;
      
      Now removed these deprecated names and treat like any other unknown
      input and issue a warning. Eg,
      
         Unknown compression specifier 'compressed', assuming no compression
      
      ====
      
      STYLE: provide Enum of stream format names (ascii, binary)
      
      ====
      
      COMP: fixed incorrect IFstream construct in FIREMeshReader
      
      - spurious bool argument (presumably meant as uncompressed) was being
        implicitly converted to a versionNumber. Now caught by making
        IOstreamOption::versionNumber constructor explicit.
      
      - bad version specifier in changeDictionary
      4cf932b2
  17. 26 Mar, 2018 1 commit
    • Mark OLESEN's avatar
      STYLE: consistent lookupOrDefault template parameters · 36719bf5
      Mark OLESEN authored
      - in many cases can just use lookupOrDefault("key", bool) instead of
        lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
        bool from an Istream uses the Switch(Istream&) anyhow
      
      STYLE: relocated Switch string names into file-local scope
      36719bf5
  18. 13 Mar, 2018 1 commit
    • Mark OLESEN's avatar
      ENH: code reduction in PackedList, PackedBoolList (issue #751) · 5d1fb235
      Mark OLESEN authored
      - eliminate iterators from PackedList since they were unused, had
        lower performance than direct access and added unneeded complexity.
      
      - eliminate auto-vivify for the PackedList '[] operator.
        The set() method provides any required auto-vivification and
        removing this ability from the '[]' operator allows for a lower
        when accessing the values. Replaced the previous cascade of iterators
        with simpler reference class.
      
      PackedBoolList:
      
      - (temporarily) eliminate logic and addition operators since
        these contained partially unclear semantics.
      
      - 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.
      
      - more consistent use of PackedBoolList test(), set(), unset() methods
        for fewer operation and clearer code. Eg,
      
            if (list.test(index)) ...    |  if (list[index]) ...
            if (!list.test(index)) ...   |  if (list[index] == 0u) ...
            list.set(index);             |  list[index] = 1u;
            list.unset(index);           |  list[index] = 0u;
      
      - deleted the operator=(const labelUList&) and replaced with a setMany()
        method for more clarity about the intended operation and to avoid any
        potential inadvertent behaviour.
      5d1fb235
  19. 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
  20. 21 Feb, 2018 1 commit
    • Mark OLESEN's avatar
      ENH: improve consistency of ListOps and stringListOps · f9599279
      Mark OLESEN authored
      - subsetList, inplaceSubsetList with optional inverted logic.
      
      - use moveable elements where possible.
      
      - allow optional starting offset for the identity global function.
        Eg,  'identity(10, start)' vs 'identity(10) + start'
      f9599279
  21. 05 Nov, 2017 1 commit
  22. 19 Nov, 2017 1 commit
  23. 03 Jul, 2017 1 commit
  24. 29 May, 2017 1 commit
    • Mark OLESEN's avatar
      ENH: cleanup of NamedEnum · fb497164
      Mark OLESEN authored
      - Remove the unused enums() method since it delivers wholly unreliable
        results. It is not guaranteed to cover the full enumeration range,
        but only the listed names.
      
      - Remove the unused strings() method.
        Duplicated functionality of the words(), but was never used.
      
      - Change access of words() method from static to object.
        Better code isolation. Permits the constructor to take over
        as the single point of failure for bad input.
      
      - Add values() method
      
      - do not expose internal (HashTable) lookup since it makes it more
        difficult to enforce constness and the implementation detail should
        not be exposed. However leave toc() and sortedToc() for the interface.
      
      STYLE: relocated NamedEnum under primitives (was containers)
      
      - internal typedef as 'value_type' for some consistency with STL conventions
      fb497164
  25. 05 Aug, 2016 1 commit
  26. 25 Apr, 2016 2 commits
  27. 16 Apr, 2016 1 commit
  28. 26 Feb, 2016 1 commit
  29. 20 Jan, 2016 1 commit
  30. 17 Nov, 2015 2 commits
    • mattijs's avatar
      ENH: parallel: overhaul of parallel mapping · 916dcb86
      mattijs authored
      - redistributePar to have almost (complete) functionality of decomposePar+reconstructPar
      - low-level distributed Field mapping
      - support for mapping surfaceFields (including flipping faces)
      - support for decomposing/reconstructing refinement data
      916dcb86
    • mattijs's avatar
      ENH: parallel: overhaul of parallel mapping · 436902f5
      mattijs authored
      - redistributePar to have almost (complete) functionality of decomposePar+reconstructPar
      - low-level distributed Field mapping
      - support for mapping surfaceFields (including flipping faces)
      - support for decomposing/reconstructing refinement data
      436902f5
  31. 11 Nov, 2015 1 commit
  32. 25 Feb, 2015 1 commit
  33. 30 Sep, 2014 1 commit
  34. 20 Mar, 2014 1 commit
  35. 15 Jan, 2014 1 commit
  36. 21 Nov, 2013 1 commit