Skip to content
Snippets Groups Projects
  1. Nov 20, 2017
  2. Nov 18, 2017
    • Mark OLESEN's avatar
      ENH: improved zone constructors · 7a5e7bd4
      Mark OLESEN authored
      - constructor for empty cell/face/point Zones, with contents to be
        transferred in later.
      
      - ZoneMesh::operator(const word&) to return existing zone or a new empty one.
      7a5e7bd4
    • Mark OLESEN's avatar
      ENH: enumerations for known cell models in cellModel, ptr/ref lookups · e4b6387a
      Mark OLESEN authored
      - this provides a better typesafe means of locating predefined cell
        models than relying on strings. The lookup is now ptr() or ref()
        directly. The lookup functions behave like on-demand singletons when
        loading "etc/cellModels".
      
        Functionality is now located entirely in cellModel but a forwarding
        version of cellModeller is provided for API (but not ABI) compatibility
        with older existing user code.
      
      STYLE: use constexpr for cellMatcher constants
      e4b6387a
  3. Nov 13, 2017
  4. Nov 09, 2017
  5. Nov 08, 2017
    • Mark OLESEN's avatar
      ENH: additional dictionary compatibility/migration methods · 78caeb61
      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.
      78caeb61
    • Mark OLESEN's avatar
      ENH: dictionary add/set methods now return a pointer to the entry · 4daa5752
      Mark OLESEN authored
      - If the entry could be directly inserted: a pointer to the inserted entry.
      - If a dictionary merge was required: a pointer to the dictionary that
        received the entry.
      - Return nullptr on any type of insertion failure.
      
      This change is code compatible with existing code since it only alters
      a bool return value to be a pointer return value.
      4daa5752
    • Mark OLESEN's avatar
    • Andrew Heather's avatar
      STYLE: Header clean-up · 8e65dd2d
      Andrew Heather authored
      8e65dd2d
  6. Nov 07, 2017
  7. Nov 04, 2017
  8. Nov 03, 2017
  9. Oct 29, 2017
    • Mark OLESEN's avatar
      ENH: consistent reverse iterator definitions for UList and FixedList · 6d32d95d
      Mark OLESEN authored
      - consistent with C++ STL conventions, the reverse iterators should
        use operator++ to transit the list from rbegin() to rend().
      
        The previous implementation used raw pointers, which meant that they
        had the opposite behaviour: operator-- to transit from rbegin() to
        rend().
      
        The updated version only has operator++ defined, thus the compiler
        should catch any possible instances where people were using the old
        (incorrect) versions.
      
      - updated forAllReverseIters() and forAllConstReverseIters() macros to
        be consistent with new implementation and with C++ STL conventions.
      6d32d95d
    • Mark OLESEN's avatar
      ENH: add reverse iteration macros · d09303ec
      Mark OLESEN authored
      - forAllReverseIters and forAllReverseConstIters macros
      - stdFoam::rbegin(), stdFoam::rend()
        stdFoam::crbegin(), stdFoam::crend()
      d09303ec
    • Mark OLESEN's avatar
      ENH: support "one-shot" changes to the dictionary inputMode (issue #429) · d06b5ea8
      Mark OLESEN authored
      - Instead of relying on #inputMode to effect a global change it is now
        possible (and recommended) to a temporary change in the inputMode
        for the following entry.
      
           #default   : provide default value if entry is not already defined
           #overwrite : silently remove a previously existing entry
           #warn      : warn about duplicate entries
           #error     : error if any duplicate entries occur
           #merge     : merge sub-dictionaries when possible (the default mode)
      
        This is generally less cumbersome than the switching the global
        inputMode. For example to provide a set of fallback values.
      
            #includeIfPresent "user-files"
            ...
            #default value uniform 10;
      
        vs.
      
            #includeIfPresent "user-files"
            #inputMode protect
            ...
            value uniform 10;
            #inputMode merge    // _Assuming_ we actually had this before
      
        These directives can also be used to suppress the normal dictionary
        merge semantics:
      
           #overwrite dict { entry val; ... }
      d06b5ea8
    • Mark OLESEN's avatar
      ENH: support full-scoping for keywords as lvalue (issue #429) · 320d573a
      Mark OLESEN authored
      - patterns only supported for the final element.
      
        To create an element as a pattern instead of a word, an embedded
        string quote (single or double) is used for that element.
        Any of the following examples:
      
            "/top/sub/dict/'(p|U).*"     100;
            "/top/sub/dict/'(p|U).*'"    100;
            "/top/sub/dict/\"(p|U).*"    100;
            "/top/sub/dict/\"(p|U).*\""  100;
      
        are equivalent to the longer form:
      
            top
            {
                sub
                {
                    dict
                    {
                        "(p|U).*"     100;
                    }
                }
            }
      
        It is not currently possible to auto-vivify intermediate
        dictionaries with patterns.
      
          NOK   "/nonexistent.*/value"   100;
          OK    "/existing.*/value"      100;
      
      - full scoping also works for the #remove directive
      
              #remove "/dict1/subdict2/entry1"
      320d573a
    • Mark OLESEN's avatar
      ENH: support '/' separators in foamDictionary · 736eea7f
      Mark OLESEN authored
      - convenience -diffEtc option that behaves like -diff, but invokes
        foamEtcFile searching
      
      STYLE: modernize code.
      736eea7f
  10. Oct 28, 2017
    • Mark OLESEN's avatar
    • Mark OLESEN's avatar
      ENH: allow passing of comparator to sortToc methods · c3fa2d55
      Mark OLESEN authored
      - this increases the flexibility of the interface
      
      - Add stringOps 'natural' string sorting comparison.
        Digits are sorted in their natural order, which means that
            (file10.txt file05.txt file2.txt)
        are sorted as
            (file2.txt file05.txt file10.txt)
      
      STYLE: consistent naming of template parameters for comparators
      
        - Compare for normal binary predicates
        - ListComparePredicate for list compare binary predicates
      c3fa2d55
    • Mark OLESEN's avatar
      STYLE: compilation of some unit tests · aa66d3a5
      Mark OLESEN authored
      aa66d3a5
    • Mark OLESEN's avatar
      ENH: add fileName::validate static method (issue #628) · 92a22882
      Mark OLESEN authored
      - similar to word::validate to allow stripping of invalid characters
        without triggering a FatalError.
      
      - use this validated fileName in Foam::readDir to avoid problems when
        a directory contains files with invalid characters in their names
      
      - adjust rmDir to handle filenames with invalid characters
      
      - fileName::equals() static method to compare strings while ignoring
        any differences that are solely due to duplicate slashes
      92a22882
    • Mark OLESEN's avatar
      ENH: cleanup and rationalize memory-backed streams · 03532891
      Mark OLESEN authored
      - more consistent naming:
        * Versions that hold and manage their own memory:
            IListStream, OListStream
      
        * Versions that reference a fixed size external memory:
            UIListStream, UOListStream
      
      - use List storage instead of DynamicList within OListStream.
        Avoids duplicate bookkeeping, more direct handling of resizing.
      03532891
  11. Oct 26, 2017
  12. Oct 25, 2017
    • Mark OLESEN's avatar
      ENH: handle underflow (rounding) of float/double as zero (issue #625) · ec92e198
      Mark OLESEN authored
      - The problem occurs when using atof to parse values such as "1e-39"
        since this is out of range for a float and _can_ set errno to
        ERANGE.
      
        Similar to parsing of integers, now parse with the longest floating
        point representation "long double" via strtold (guaranteed to be
        part of C++11) and verify against the respective VGREAT values for
        overflow. Treat anything smaller than VSMALL to be zero.
      ec92e198