Skip to content
Snippets Groups Projects
  1. May 23, 2024
    • Mark OLESEN's avatar
      ENH: add dictionary::findStream() - symmetric with findDict() · 3b917666
      Mark OLESEN authored
      - can be used with this type of code:
      
        ITstream* streamPtr = dict.findStream(name);
        if (streamPtr)
        {
            auto& is = *streamPtr;
            ...
        }
      
        versus:
      
        const entry* eptr = dict.findEntry(name);
        if (eptr && eptr->isStream())
        {
            auto& is = eptr->stream();
            ...
        }
      
      ENH: add findStream(), streamPtr(), isStream() to dictionary search
      
      - symmetric with findDict(), dictPtr(), isDict() methods
      
      STYLE: use findDict() instead of found() + subDict() pairing
      
      COMP: define is_globalIOobject trait at top of IOobject header
      
      - more visibility, permits reuse for specializations etc.
      3b917666
  2. Apr 16, 2024
    • Mark OLESEN's avatar
      ENH: reduce reliance on stringListOps functions · 16dd92b3
      Mark OLESEN authored
      - findStrings, findMatchingStrings now mostly covered by matching
        intrinsics in wordRe and wordRes.
      
        Add static wordRes match() and matching() variants
      
      COMP: remove stringListOps include from objectRegistry.H
      
      - was already noted for removal (NOV-2018)
      16dd92b3
  3. Mar 07, 2024
    • Mark OLESEN's avatar
      STYLE: use spanstream instead of stringstream in more places · 5680ce1e
      Mark OLESEN authored
      - particularly useful in these combinations:
      
        1.
            OCharStream buf;
            // populate
      
            ISpanStream is(buf.view());
            // parse
      
        2.
            // read from file
            ifile.getLine(str);
      
            ISpanStream is(str);
            // parse
      
        These avoid making a copy of the character content, compared to
        versions with stringstream:
      
            OStringStream buf;
            IStringStream is(buf.str());
      5680ce1e
  4. Mar 06, 2024
    • Mark OLESEN's avatar
      ENH: make ITstream positioning methods noexcept · b98f53ce
      Mark OLESEN authored
      ENH: add rank() method for compound tokens
      
      ENH: add IOstream::minPrecision(unsigned)
      
      - reduced typing, more expressive, no namespace ambiguity with max()
      
          new: IOstream::minPrecision(10);
          old: IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
      
      STYLE: namespace qualify min/max for some buffer sizing [clang/hipp]
      b98f53ce
  5. Feb 07, 2024
  6. Dec 07, 2023
  7. Nov 21, 2023
  8. Nov 18, 2023
  9. Oct 16, 2023
    • Mark OLESEN's avatar
      ENH: improve consistency of adding tokens to ITstream · c1e2fd67
      Mark OLESEN authored
      - use add_tokens() instead of the old multi-parameter
        append(.., bool) method which was misleading since it added tokens
        at the current tokenIndex, not at the end.
      
      - stringify ITstream contents with CharStream instead of StringStream.
        Allows string_view for copying out the content.
      
      ENH: set namedDictionary dictionary name from Istream
      
      - provides context for error messages etc (#2990)
      c1e2fd67
    • Mark OLESEN's avatar
      STYLE: use getOrDefault instead of lookupOrDefault · fb26fced
      Mark OLESEN authored
      - now mark methods with strict deprecation, to make it easier to find
        their use but without adding extra compilation noise for others
      
      ENH: minor update for Enum methods and iterator
      
      - add warnOnly (failsafe) option for readEntry and getOrDefault
      
      - add good() method to Enum iterator (simliar to HashTable)
      
      - replace unused/fragile Enum find() methods with iterator return
        that can be used more generally
      fb26fced
  10. Aug 21, 2023
    • Mark OLESEN's avatar
      ENH: change internal dictionary separator to '/' (#1073) · 886ba89d
      Mark OLESEN authored
      - simplifies internal handling (like a fileName) and allows the
        dictionary name to be used with unambiguous addressing.
        The previous dot (.) separator is ambiguous (ie, as dictionary
        separator or as part of a keyword).
      
      ENH: foamDictionary report -add/-set to stderr
      886ba89d
  11. Aug 16, 2023
    • 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
  12. Jul 27, 2023
  13. Jul 04, 2023
    • Mark OLESEN's avatar
      ENH: add ITstream::emptyStream() · f8987e64
      Mark OLESEN authored
      - returns readable reference to an empty ITstream for functions
        needing to return an ITstream reference but which
        don't have anything to return.
      f8987e64
  14. May 22, 2023
  15. May 18, 2023
  16. Feb 28, 2023
  17. Feb 27, 2023
  18. Feb 21, 2023
    • Mark OLESEN's avatar
      ENH: remove restricted precision for calc/eval (#2635) · d006339c
      Mark OLESEN authored
      - in earlier versions: used 'fixed' notation
        to force floating point numbers to be printed with at least
        some decimal digits. However, in the meantime we are more
        flexible with handling float/int input so remove this constraint.
      
      - use ITstream::toString, which makes the string expansion of ${var}
        and the expression expansion of $[var] consistent.
      d006339c
  19. Dec 01, 2022
  20. Nov 24, 2022
  21. Nov 08, 2022
  22. Oct 11, 2022
  23. Oct 04, 2022
    • Mark OLESEN's avatar
      ENH: use readOption to fine-tune dictionary reading · 7eda6de6
      Mark OLESEN authored
      - previously had 'mandatory' (bool) for advanced control of reading
        dictionary entries but its meaning was unclear in the calling code
        without extra code comments.
      
        Now use IOobjectOption::readOption instead, which allows further
        options (ie, NO_READ) and is more transparent as to its purpose in
        the code than a true/false bool flag was.
      
        This is a minor breaking change (infrequent, advanced usage only)
      
      - minor code cleanup in dictionary lookup methods
      7eda6de6
    • Mark OLESEN's avatar
      ENH: use dictionary findDict() instead of isDict() + subDict() · 55f5f877
      Mark OLESEN authored
      - avoids redundant dictionary searching
      
      STYLE: remove dictionary lookupOrDefaultCompat wrapper
      
      - deprecated and replaced by getOrDefaultCompat (2019-05).
        The function is usually specific to internal keyword upgrading
        (version compatibility) and unlikely to exist in any user code.
      55f5f877
    • Mark OLESEN's avatar
      ENH: simplify dictionary search for value/refValue in BCs · 3a6e4274
      Mark OLESEN authored
      - in expressions BCs in particular, there is various logic handling
        for if value/refValue/refGradient etc are found or not.
      
        Handle the lookups as findEntry and branch to use Field assign
        or other handling, depending on its existence.
      
      STYLE: use wordList instead of wordRes for copy/filter dictionary
      3a6e4274
  24. Jun 13, 2022
  25. Mar 12, 2022
  26. Jan 31, 2022
    • Mark OLESEN's avatar
      BUG: avoid memory slicing in LList (#2300) · ab065cd5
      Mark OLESEN authored
      ENH: reduce code effort for clearing linked-lists
      
      ENH: adjust linked-list method name
      
      - complement linked-list append() method with prepend() method
        instead of 'insert', which is not very descriptive
      ab065cd5
  27. Dec 03, 2021
    • Mark OLESEN's avatar
      BUG: dangling dictionary reference for expression BCs · 27e57c29
      Mark OLESEN authored
      - exposed by the new embedded function handling.
      
        Requires local copies of dictionary content instead
        (similar to coded BCs handling)
      
      BUG: incorrect formatting for expression function output
      
      ENH: simpler copyDict version taking wordList instead of wordRes
      
      - corresponds to the most common use case at the moment
      
      ENH: expression string writeEntry method
      
      - write as verbatim for better readability
      27e57c29
  28. Nov 25, 2021
    • Mark OLESEN's avatar
      ENH: additional #word and #message dictionary directives (#2276) · 1804d3fe
      Mark OLESEN authored
      - use `#word` to concatenate, expand content with the resulting string
        being treated as a word token. Can be used in dictionary or
        primitive context.
      
        In dictionary context, it fills the gap for constructing dictionary
        names on-the-fly. For example,
      
        ```
        #word "some_prefix_solverInfo_${application}"
        {
            type    solverInfo;
            libs    (utilityFunctionObjects);
            ...
        }
        ```
      
        The '#word' directive will automatically squeeze out non-word
        characters. In the block content form, it will also strip out
        comments. This means that this type of content should also work:
      
        ```
        #word {
           some_prefix_solverInfo
           /* Appended with application name (if defined) */
           ${application:+_}  // Use '_' separator
           ${application}     // The application
        }
        {
            type    solverInfo;
            libs    (utilityFunctionObjects);
            ...
        }
        ```
        This is admittedly quite ugly, but illustrates its capabilities.
      
      - use `#message` to report expanded string content to stderr.
        For example,
      
        ```
        T
        {
           solver          PBiCG;
           preconditioner  DILU;
           tolerance       1e-10;
           relTol          0;
           #message "using solver: $solver"
        }
        ```
        Only reports on the master node.
      1804d3fe
  29. Nov 17, 2021
  30. Nov 09, 2021
  31. Nov 05, 2021
  32. Nov 03, 2021
  33. Jul 15, 2021