1. 18 Feb, 2020 9 commits
    • Mark Olesen's avatar
      ENH: support use of IOstreamOption for IFstream/OFstream · e3f681fa
      Mark Olesen authored
      - can be convenient to bundle IO options as a single parameter
    • Mark Olesen's avatar
      STYLE: use unique_ptr for Fstream resource management · f3106ec1
      Mark Olesen authored
      STYLE: change return type of NewOFstream from Ostream to OSstream
    • Mark Olesen's avatar
      ENH: support IOstreamOption in abstract stream types · 3135dcf2
      Mark Olesen authored
      - expose the write IOstreamOption in Time
    • Mark Olesen's avatar
      ENH: improvements to IOstreamOption · 33f9ae50
      Mark Olesen authored
      * Support default values for format/compress enum lookups.
        - Avoids situations where the preferred default format is not ASCII.
          For example, with dictionary input:
              format binar;
          The typing mistake would previously have caused formatEnum to
          default to ASCII. We can now properly control its behaviour.
                  dict.get<word>("format"), IOstream::BINARY
          Allowing us to switch ascii/binary, using BINARY by default even in
          the case of spelling mistakes. The mistakes are flagged, but the
          return value can be non-ASCII.
      * The format/compression lookup behave as pass-through if the lookup
        string is empty.
        - Allows the following to work without complaint
                dict.getOrDefault("format", word::null), IOstream::BINARY
        - Or use constructor-like failsafe method
            IOstream::formatEnum("format", dict, IOstream::BINARY);
        - Apply the same behaviour with setting stream format/compression
          from a word.
          will emit a warning, but leave the stream format UNCHANGED
      * Rationalize versionNumber construction
        - constexpr constructors where possible.
          Default construct is the "currentVersion"
        - Construct from token to shift the burden to versionNumber.
          Support token as argument to version().
          or failsafe constructor method
                  IOstreamOption::versionNumber("version", headerDict)
          Before (controlled input):
          Old, uncontrolled input - has been removed:
      * improve consistency, default behaviour for IOstreamOption construct
        - constexpr constructors where possible
        - add copy construct with change of format.
        - construct IOstreamOption from streamFormat is now non-explicit.
          This is a commonly expected result with no ill-effects
    • Mark Olesen's avatar
      ENH: adjustments to Switch · bb53e8ad
      Mark Olesen authored
      - align Switch more with Enum.
        Now have find(), found() static methods.
        Constructors with failsafe option.
        The find() method makes for clearer coding:
           Switch sw(some_string, true); // NB: true = allowBad
           if (sw.valid()) ...
           Switch sw = Switch::find(some_string);
           if (sw.good()) ...
           if (Switch::found(some_string)) ...
      - improve construct from dictionary to handle all valid token types.
        Previously just read in a word.
      - Remove asText() method - replaced by c_str() and str() several
        versions ago.
    • Mark Olesen's avatar
      STYLE: provide return value for IOstream::fatalCheck() · ed4bd548
      Mark Olesen authored
      - allows reuse as base implementation for IOstream::check()
    • Mark Olesen's avatar
      STYLE: remove "originalVersion" face handling · 2834193c
      Mark Olesen authored
      - an old pre-OpenFOAM transitional feature (prior to 2004)
        for named faces.
    • Mark Olesen's avatar
    • Mark Olesen's avatar
  2. 06 Feb, 2020 1 commit
  3. 03 Feb, 2020 1 commit
  4. 31 Jan, 2020 1 commit
  5. 28 Jan, 2020 1 commit
  6. 23 Jan, 2020 1 commit
    • Mark Olesen's avatar
      ENH: stream adjustments · 0ff02713
      Mark Olesen authored
      - make stream constructors explicit
      - remove "using std::ifstream", "using std::iofstream" statements
        for a cleaner namespace.
      * copy/move assignments for ITstream
      * IStringStream: default construct and construct from std::string
        instead of Foam::string
      - reduce some overhead in masterOFstream
      - simplify Pstream handling of string variants (#1525)
  7. 20 Jan, 2020 2 commits
  8. 09 Jan, 2020 1 commit
  9. 13 Jan, 2020 3 commits
    • Mark Olesen's avatar
      ENH: regIOobject store() now also registers the object · b0072bfa
      Mark Olesen authored
      - previously the store() method just set the ownedByRegistry flag.
        Now ensure that it is indeed registered first.
      - support register/store of tmp<> items.
        The tmp parameter is not cleared, but changed from PTR to CREF
        to allow further use.
        The implicit registration allows code simplification using the
        GeometricField::New factory method, for example.
        Old Code
            volScalarField* ptr = new volScalarField
                    true  // Register
        New Code
            auto tptr = volScalarField::New
        or even
    • mattijs's avatar
    • mattijs's avatar
      BUG: collated: correctly handle ascii writing. See #1545. · b1a866c3
      mattijs authored
      The collated container ('decomposedBlockData') is always binary
      but the 'payload' might be ascii so use that header information
      instead of the decomposeBlockData header.
  10. 09 Jan, 2020 1 commit
  11. 17 Dec, 2019 2 commits
  12. 16 Dec, 2019 2 commits
  13. 15 Dec, 2019 2 commits
  14. 13 Dec, 2019 3 commits
  15. 12 Dec, 2019 2 commits
    • Andrew Heather's avatar
    • Mark Olesen's avatar
      ENH: update handling of "writeTime" in timeControl class · 280be631
      Mark Olesen authored
      - handle zero or negative values as being identical to 1.
        As per timeStep control and what the comments suggested.
      - drop old outputTime enumeration, since this is covered by the
        writeTime enumeration and a corresponding Enum name.
      - support construction of a "pass-through" control object that always
        executes and add some method to test for these conditions and be able
        to output some meaning full information.
           if (ctrl.execute())
               if (!ctrl.always())
                   Info<< "Sampling executed based on " << ctrl.type() << nl;
           To produce "Sampling executed based on runTime"
  16. 11 Dec, 2019 1 commit
  17. 10 Dec, 2019 1 commit
  18. 09 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: generalize string expression evaluation · c2123452
      Mark Olesen authored
      - replace stringOps::toScalar with a more generic stringOps::evaluate
        method that handles scalars, vectors etc.
      - improve #eval to handle various mathematical operations.
        Previously only handled scalars. Now produce vectors, tensors etc
        for the entries. These tokens are streamed directly into the entry.
  19. 06 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add ITstream append and seek methods. · 9fd696e1
      Mark Olesen authored
      - ITstream append() would previously have used the append from the
        underlying tokenList, which leaves the tokenIndex untouched and
        renders the freshly appended tokens effectively invisible if
        interspersed with primitiveEntry::read() that itself uses tokenIndex
        when building the list.
        The new append() method makes this hidden ITstream bi-directionality
        easier to manage. For efficiency, we only append lists
        (not individual tokens) and support a 'lazy' resizing that allows
        the final resizing to occur later when all tokens have been appended.
      - The new ITstream seek() method provides a conveniently means to move
        to the end of the list or reposition to the middle.
        Using rewind() and using seek(0) are identical.
      ENH: added OTstream to output directly to a list of tokens
      BUG: List::newElem resized incorrectly
      - had a simple doubling of the List size without checking that this
        would indeed be sufficient for the requested index.
        Bug was ...
  20. 07 Dec, 2019 1 commit
  21. 27 Nov, 2019 1 commit
  22. 26 Nov, 2019 1 commit
  23. 20 Nov, 2019 1 commit