1. 13 Apr, 2018 1 commit
  2. 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
  3. 28 Mar, 2018 1 commit
  4. 11 Apr, 2018 1 commit
  5. 09 Apr, 2018 1 commit
  6. 12 Apr, 2018 1 commit
  7. 03 Apr, 2018 1 commit
  8. 28 Mar, 2018 1 commit
  9. 26 Mar, 2018 2 commits
    • Mark Olesen's avatar
      ENH: reduce profiling overhead (issue #764) · d901b4f4
      Mark Olesen authored
      - avoid clockTime in favour of clockValue.
      
      - avoid allocations when profiling is not active.
      
      - replace hashing with manual pointer lists
      d901b4f4
    • 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
  10. 21 Mar, 2018 1 commit
  11. 14 Mar, 2018 1 commit
  12. 05 Mar, 2018 1 commit
  13. 27 Feb, 2018 1 commit
  14. 26 Feb, 2018 2 commits
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      ENH: cleanup autoPtr class (issue #639) · 660f3e54
      Mark Olesen authored
      Improve alignment of its behaviour with std::unique_ptr
      
        - element_type typedef
        - release() method - identical to ptr() method
        - get() method to get the pointer without checking and without releasing it.
        - operator*() for dereferencing
      
      Method name changes
      
        - renamed rawPtr() to get()
        - renamed rawRef() to ref(), removed unused const version.
      
      Removed methods/operators
      
        - assignment from a raw pointer was deleted (was rarely used).
          Can be convenient, but uncontrolled and potentially unsafe.
          Do allow assignment from a literal nullptr though, since this
          can never leak (and also corresponds to the unique_ptr API).
      
      Additional methods
      
        - clone() method: forwards to the clone() method of the underlying
          data object with argument forwarding.
      
        - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)
      
      STYLE: avoid implicit conversion from autoPtr to object type in many places
      
      - existing implementation has the following:
      
           operator const T&() const { return operator*(); }
      
        which means that the following code works:
      
             autoPtr<mapPolyMesh> map = ...;
             updateMesh(*map);    // OK: explicit dereferencing
             updateMesh(map());   // OK: explicit dereferencing
             updateMesh(map);     // OK: implicit dereferencing
      
        for clarity it may preferable to avoid the implicit dereferencing
      
      - prefer operator* to operator() when deferenced a return value
        so it is clearer that a pointer is involve and not a function call
        etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
      660f3e54
  15. 22 Feb, 2018 1 commit
  16. 21 Feb, 2018 1 commit
  17. 20 Feb, 2018 1 commit
  18. 19 Feb, 2018 1 commit
  19. 08 Feb, 2018 2 commits
    • Mark Olesen's avatar
      STYLE: two-parameter Foam::name replaced by word::printf (issue #724) · 806b6684
      Mark Olesen authored
      - reduces some ambiguity and clarifies the expected output and
        behaviour.
      
      STYLE: reduce some automatic conversions of char to string
      806b6684
    • Mark Olesen's avatar
      ENH: cleanup List constructors (issue #725) · e42c2281
      Mark Olesen authored
      - add copy construct from UList
      
      - remove copy construct from dissimilar types.
      
        This templated constructor was too generous in what it accepted.
        For the special cases where a copy constructor is required with
        a change in the data type, now use the createList factory method,
        which accepts a unary operator. Eg,
      
            auto scalars = scalarList::createList
            (
                labels,
                [](const label& val){ return 1.5*val; }
            );
      e42c2281
  20. 24 Jan, 2018 1 commit
  21. 22 Jan, 2018 1 commit
    • Mark Olesen's avatar
      ENH: coding cleanup for memory streams · 23c9dd71
      Mark Olesen authored
      - simplify structure.
      - protect against nullptr when resetting memory streams
      - make UIListStream swappable
      - add uiliststream as an example of using a plain std::istream
      23c9dd71
  22. 17 Jan, 2018 1 commit
  23. 15 Jan, 2018 1 commit
    • Mark Olesen's avatar
      ENH: support silent compat versions. · 2d51d4b3
      Mark Olesen authored
      - can tag the version compatibility with a negative number to suppress
        the warnings but retain some information about which version was
        supported.
      2d51d4b3
  24. 08 Jan, 2018 3 commits
    • Mark Olesen's avatar
      ENH: simplify method names for reading argList options and arguments · 345a2a42
      Mark Olesen authored
      - use succincter method names that more closely resemble dictionary
        and HashTable method names. This improves method name consistency
        between classes and also requires less typing effort:
      
          args.found(optName)        vs.  args.optionFound(optName)
          args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
          ...
          args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
          args.read<scalar>(index)   vs.  args.argRead<scalar>(index)
      
      - the older method names forms have been retained for code compatibility,
        but are now deprecated
      345a2a42
    • Mark Olesen's avatar
      STYLE: avoid unnecessary use of optionLookup · 9dc361da
      Mark Olesen authored
      - direct parsing of -funcs to ITstream.
      - use direct lookup when the option is a word/string
      9dc361da
    • Mark Olesen's avatar
      ENH: improve robustness of scalarRanges from string (fixes #673) · f55a42a8
      Mark Olesen authored
      - now avoid Istream and token mechanism in favour of a simpler string
        parser. This makes the code clearer, smaller, robuster.
      
      - provide convenience ge/gt/le/lt static constructors for scalarRange
        for using bounds directly with specifying via a string parameter.
      
      - scalarRange, scalarRanges now follow the unary predicate pattern
        (using an operator() for testing). This allows their reuse in
        other contexts. Eg, for filtering operations:
      
            myHash.filterValues(scalarRange::ge(100));
      
      - remove unused scalarRanges methods that were specific to handling
        lists of time values. These were superseded by timeSelector methods
        several versions ago.
      f55a42a8
  25. 20 Dec, 2017 1 commit
  26. 14 Dec, 2017 1 commit
  27. 13 Dec, 2017 1 commit
  28. 11 Dec, 2017 1 commit
  29. 28 Nov, 2017 1 commit
    • Mark Olesen's avatar
      ENH: added functionObject::execute(int) method · 610c2909
      Mark Olesen authored
      - this is a provision for defining execute actions that can be called
        largely independently of the normal time-loop constraints. This can
        be useful to provide hooks for sub-cycling, or to define an action
        that can be triggered manually or on some other event.
      610c2909
  30. 13 Nov, 2017 1 commit
    • Mark Olesen's avatar
      ENH: support change of Pstream buffer format via flag modifier · 8f444b71
      Mark Olesen authored
      - allows changing the format of the sending OPstream at an arbitrary
        point in the transmission. The information is passed through the
        buffer and the receiving IPstream changes its format accordingly.
        This allows a temporary toggling of ASCII/BINARY mid-stream.
      8f444b71
  31. 12 Nov, 2017 2 commits
  32. 09 Nov, 2017 2 commits
  33. 08 Nov, 2017 1 commit
    • Mark Olesen's avatar
      ENH: additional dictionary compatibility/migration methods · c7392f7f
      Mark Olesen authored
      - when dictionary keywords change between versions, the programmer
        can use these compatibility methods to help with migration.
      
          * csearchCompat, foundCompat, lookupEntryPtrCompat, lookupEntryCompat,
            lookupCompat, lookupOrDefaultCompat, readIfPresentCompat, ...
      
        They behave like their similarly named base versions, but accept an
        additional list of older keyword names augmented by a version number.
        For example,
      
            dict.readIfPresentCompat
            (
                "key", {{"olderName", 1612}, {"veryOld", 240}},
                myscalar
            );
      
         where 1612=OpenFOAM-v1612, 240=OpenFOAM-v2.4.x, etc.
      c7392f7f