Skip to content
Snippets Groups Projects
  1. Sep 05, 2023
    • Mark OLESEN's avatar
      CONFIG: increment API level to 2307 · 2e8e2592
      Mark OLESEN authored
      2e8e2592
    • Mark OLESEN's avatar
      ENH: support List sub-slice searching, use std::find() · 0250a1b0
      Mark OLESEN authored
      - support UList shallowCopy with pointer/size
        (eg, for slicing into or from span)
      
      ENH: add SubList::reset() functionality
      
      - allows modification of a SubList after construction.
        Previously a SubList had an immutable location after construction
        and there was no way to shift or change its location.
      
      BUG: missed special handling for DynamicList<char>::readList (fixes #2974)
      
      - equivalent to List<char>::readList, in which the stream is
        temporarily toggled from ASCII to BINARY when reading in a List of
        char data.
        This specialization was missed when DynamicList<T>::readList() was
        fully implemented.
      0250a1b0
  2. Sep 04, 2023
  3. Sep 01, 2023
    • Andrew Heather's avatar
      Merge branch 'update-memory-streams' into 'develop' · f800ccc3
      Andrew Heather authored
      update and enhancements for memory-based streams
      
      See merge request !624
      f800ccc3
    • Mark OLESEN's avatar
      ENH: improve robustness of raw reading, file size checks · 459aaad0
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - use ignore instead of seekg/tellg to swallow input (robuster)
      
      - check for bad gcount() values
      
      - wrap Foam::fileSize() compressed/uncompressed handling into IFstream.
      
      - improve handling of compressed files in masterUncollatedFileOperation.
        Previously read into a string via stream iterators.
        Now read chunk-wise into a List of char for fewer reallocations.
      459aaad0
    • Mark OLESEN's avatar
      ENH: update and enhancement of memory-streams · a341d09a
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - soft renames (ie, old names still available via typedefs) for more
        reasonable names and more coverage with std stream variants.
      
        The old names could be a bit cryptic.
        For example, uiliststream (== an unallocated/external list storage),
        which is written as std::ispanstream for C++23.
      
        Could similarly argue that IListStream is better named as
        ICharStream, since it is an input stream of characters and the
        internal storage mechanism (List or something else) is mostly
        irrelevant.
      
        Extending the coverage to include all std stream variants, and
        simply rewrap them for OpenFOAM IOstream types. This simplifies the
        inheritance patterns and allows reuse of icharstream/ocharstream as
        a drop-in replace for istringstream/ostringstream in other wrappers.
      
        Classes:
          * icharstream / ICharStream   [old: none / IListStream]
          * ocharstream / OCharStream   [old: none / OListStream]
          * ispanstream / ISpanStream   [old: uiliststream / UIListStream]
          * ospanstream / OSpanStream   [old: none / UOListStream]
      
        Possible new uses : read file contents into a buffer, broadcast
        buffer contents to other ranks and then transfer into an icharstream
        to be read from. This avoid the multiple intermediate copies that
        would be associated when using an istringstream.
      
      - Use size doubling instead of block-wise incremental for ocharstream
        (OCharStream). This corresponds to the sizing behaviour as per
        std::stringstream (according to gcc-11 includes)
      
      STYLE: drop Foam_IOstream_extras constructors for memory streams
      
      - transitional/legacy constructors but not used in any code
      a341d09a
  4. Aug 31, 2023
  5. Aug 30, 2023
  6. Aug 29, 2023
  7. Aug 28, 2023
  8. Aug 24, 2023
  9. Aug 21, 2023
  10. Aug 18, 2023
    • Mark OLESEN's avatar
      CONFIG: enable xcrun with cc/c++ based on WM_COMPILE_CONTROL (#2965) · 224c3199
      Mark OLESEN authored
      - adding in +xcrun into WM_COMPILE_CONTROL changes the compiler
        settings as follows (for MacOS)
      
            cc         := xcrun cc
            CC         := xcrun c++ -std=c++14
      224c3199
    • Alexey Matveichev's avatar
      COMP: add rpath information to MacOS compilation rules (#2948) · e4f2efec
      Alexey Matveichev authored and Mark OLESEN's avatar Mark OLESEN committed
      - since the Apple SIP (System Integrity Protection) clears environment
        variables such as DYLD_LIBRARY_PATH, a number of workarounds have
        been used to provide shadow values. However, for a more robust
        installation using -rpath at compilation time appears to be the
        better solution.
      
        In addition to the usual -rpath specification with absolute file
        paths, MacOS supports (@loader_path, @executable_path) as well.
        Now default to link with rpath information for MacOS, which can be
        disabled by adding `~rpath` in WM_COMPILE_CONTROL
      
        Explicit library paths handled:
          - FOAM_FOAM_EXT_LIBBIN, FOAM_EXT_LIBBIN/FOAM_MPI
      
        The executable rpaths are handled assuming a structure of
           install-path/bin
           install-path/lib/$(FOAM_MPI)
           install-path/lib
      
        Absolute compile-time paths for FOAM_USER_LIBBIN, FOAM_SITE_LIBBIN
        and FOAM_LIBBIN are not handled since these are either too fragile
        (FOAM_USER_LIBBIN and FOAM_SITE_LIBBIN values) or covered via
        @loader_path anyhow (FOAM_LIBBIN).
      
        Since the value of FOAM_MPI is a compile-time value, this rpath
        treatment makes the installation less suitable for runtime changes
        to the MPI vendor/version.
      
        Note: no rpath added for c-only compilations since there are
        currently no c-only libraries or executables with dynamic loading
      e4f2efec
    • Guanyang Xue's avatar
      ENH: improve FPE handling for Apple and ARM64 (#2956) · 36303335
      Guanyang Xue authored and Mark OLESEN's avatar Mark OLESEN committed
      36303335
    • Mark OLESEN's avatar
      STYLE: update noexcept and default construct for signals · 97668eab
      Mark OLESEN authored
      - eliminate ClassName in favour of simple debug
      
      - include Apple-specific FPE handling after local definition
        to allow for more redefinitions
      
      COMP: remove stray <csignal> includes
      97668eab
    • Mark OLESEN's avatar
      ENH: add UPstream::msgType() setter method and UPstream::incrMsgType() · b6201521
      Mark OLESEN authored
      - like UPstream::parRun() etc, returns old value
      b6201521
    • Mark OLESEN's avatar
      ENH: PtrList, PtrDynList, HashPtrTable try_emplace() method · 03ca52b0
      Mark OLESEN authored
      - naming like std::map::try_emplace(), it behaves like emplace_set()
        if there is no element at the given location otherwise a no-op
      
      ENH: reuse existing HashPtrTable 'slot' when setting pointers
      
      - avoids extra HashTable operations
      03ca52b0
  11. Aug 17, 2023
  12. Aug 16, 2023
    • Mark OLESEN's avatar
      ENH: provision for delayed reading of compound tokens (#2953) · 268de43a
      Mark OLESEN authored
      - the construction of compound tokens is now split into two stages:
          - default construct
          - read contents
        This permits a larger variety of handling.
      
      - the new token::readCompoundToken(..) method allows for simpler
        more failsafe invocations.
      
      - forward resize(), read() methods for compound tokens to support
        separate read and population.
        Top-level refCompoundToken() method for modify access.
      
      ENH: split off a private readCompoundToken() method within ISstream
      
      - this allows overloading and alternative tokenisation handling for
        derived classes
      268de43a
    • Mark OLESEN's avatar
      ENH: additional ITstream access/manipulate methods · 43f8b477
      Mark OLESEN authored
      - simplifies iteration of ITstream using nRemainingTokens() and skip()
        methods or directly as a list of tokens.
      
        The currentToken() method returns const or non-const access to
        the token at the current tokenIndex.
      
        The peekToken(label) method provides failsafe read access to tokens
        at given locations.
      
      ENH: add primitiveEntry construct with moving a single token
      43f8b477
    • Andrew Heather's avatar
      Merge branch 'feature-container-algorithms' into 'develop' · bbbab8a9
      Andrew Heather authored
      Increase usage of std algoritms within the OpenFOAM List classes. Remove reliance on linked-list during reading
      
      See merge request !620
      bbbab8a9
    • Mark OLESEN's avatar
      ENH: use std algorithms for copy/move/compare within List containers · 2422e6f0
      Mark OLESEN authored
      ENH: add List resize_fill variant. Fuses resize_nocopy + uniform fill
      
      COMP: avoid cast ambiguity when assigning Foam::zero to UList<char>
      2422e6f0
    • Mark OLESEN's avatar
      STYLE: qualify Swap with Foam:: prefix (visibility) · eeb9d144
      Mark OLESEN authored
      - drop unnecessary Foam::Swap specializations when MoveConstructible
        and MoveAssignable already apply. The explicit redirect to swap
        member functions was needed before proper move semantics where
        added.
      
        Removed specializations: autoPtr, refPtr, tmp, UList.
        Retained specialization: DynamicList, FixedList.
      
           Special handling for DynamicList is only to accommodate dissimilar
           sizing template parameters (which probably doesn't occur in
           practice).
           Special handling for FixedList to apply element-wise swapping.
      
      - use std::swap for primitives. No need to mask with Foam::Swap wrapper
      eeb9d144