1. 31 Oct, 2019 1 commit
  2. 30 Apr, 2019 1 commit
    • Mark Olesen's avatar
      ENH: no string quotes when using OSHA1stream (#1301) · 26a391b1
      Mark Olesen authored
      - previously would have different SHA1 depending on whether the
        string was a C-string, a C++-string or if the SHA1 was calculated
        directly or via the OSHA1stream.
      
          - SHA1("string")
          - OSHA1stream << "string";
          - OSHA1stream << string("string");
      
        By avoiding string quoting on output, they now all deliver the same
        result. This also means that the following will no longer change the SHA1
        content, since it does not add anything:
      
          osha<< string() << string() << string() << string();
      
        This would have previously add a pair of double quotes each time!
      26a391b1
  3. 02 Apr, 2019 1 commit
  4. 14 Feb, 2019 1 commit
    • Mark Olesen's avatar
      ENH: ensure self-assignment and self-swapping are a no-op for string types · 60c31415
      Mark Olesen authored
      - simplifies their use when reordering lists etc.
        (word, fileName, keyType, wordRe)
      
      - "unfriend" IO operators for string types. They require no internal access
      
      - add compile/uncompile methods to keyType for symmetry with wordRe
      
      - when outputting keyType/wordRe, be more explicit about them using
        writeQuoted()
      60c31415
  5. 13 Feb, 2019 1 commit
  6. 06 Feb, 2019 1 commit
  7. 23 Jan, 2019 1 commit
  8. 16 Jan, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add simplified gather methods for globalIndex with default communicator · f498d09d
      Mark Olesen authored
      - when combining lists in processor order this simplifies code and
        reduces memory overhead.
      
        Write this:
          ----
          labelList collected;
      
          const globalIndex sizing(input.size());
          sizing.gather(input, collected);
          ----
      
        OR
      
          ----
          labelList collected;
          globalIndex::gatherOp(input, collected);
          ----
      
        Instead of this:
      
          ----
          labelList collected;
      
          List<labelList> scratch(Pstream::nProcs());
          scratch[Pstream::myProcNo()] = input;
          Pstream::gatherList(scratch);
      
          if (Pstream::master())
          {
              collected = ListListOps::combine<labelList>
              (
                  scratch,
                  accessOp<labelList>()
              );
          }
          scratch.clear();
          ----
      f498d09d
  9. 11 Jan, 2019 1 commit
  10. 08 Jan, 2019 1 commit
  11. 11 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use Zero when zero-initializing types · 1d85fecf
      Mark Olesen authored
      - makes the intent clearer and avoids the need for additional
        constructor casting. Eg,
      
            labelList(10, Zero)    vs.  labelList(10, 0)
            scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
            vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
      1d85fecf
  12. 25 Nov, 2018 1 commit
  13. 11 Nov, 2018 1 commit
  14. 03 Nov, 2018 1 commit
  15. 01 Nov, 2018 1 commit
  16. 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 this class to enumerate
        other things since it internally uses an 'int' for its values.
      
        Changed volumeType accordingly to enumerate on its type (enum),
        not the class itself.
      3b745122
  17. 12 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: additional boolToken token type · 990d00d4
      Mark Olesen authored
      - not used by the ISstream parser, but suitable for other parsing
        methods where true/false concept should be distinguishable from
        integer values.
      
        Only constructed via the token::boolean() static method, not
        directly assignable.
        This avoids any potential ambiguities with label.
      990d00d4
  18. 10 Sep, 2018 1 commit
  19. 24 Jul, 2018 1 commit
  20. 18 Jun, 2018 1 commit
  21. 22 Jun, 2018 1 commit
    • Mark Olesen's avatar
      ENH: suppress Info output for some cases (issue #722, #893) · 6390c183
      Mark Olesen authored
      - add additional control via a Foam::infoDetailLevel flag, which is
        supported by a 'DetailLevel' macro.  Eg,
      
            DetailLevel << "some information" << nl
      
      - When infoDetailLevel is zero, the stdout for all Foam::system() calls
        are also redirected to stderr to prevent child output from
        appearing on the parent.
      
      - close stdin before exec in system call.
      6390c183
  22. 30 May, 2018 1 commit
  23. 20 Dec, 2017 1 commit
  24. 07 May, 2018 1 commit
  25. 02 May, 2018 1 commit
  26. 27 Apr, 2018 1 commit
  27. 25 Apr, 2018 1 commit
  28. 13 Apr, 2018 1 commit
  29. 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
  30. 28 Mar, 2018 1 commit
  31. 03 Apr, 2018 1 commit
  32. 05 Mar, 2018 1 commit
  33. 26 Feb, 2018 1 commit
    • 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
  34. 20 Feb, 2018 1 commit
  35. 08 Feb, 2018 1 commit
  36. 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
  37. 17 Jan, 2018 1 commit
  38. 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
  39. 12 Nov, 2017 2 commits