Skip to content
Snippets Groups Projects
  1. May 29, 2018
  2. May 28, 2018
  3. Dec 13, 2017
  4. Dec 11, 2017
  5. May 16, 2018
  6. May 17, 2018
    • Mark OLESEN's avatar
      ENH: avoid memory leaks for HashPtrTable, PtrMap insertion (issue #749) · 48d654cf
      Mark OLESEN authored
      - disallow insert() of raw pointers, since a failed insertion
        (ie, entry already existed) results in an unmanaged pointer.
      
        Either insert using an autoPtr, or set() with raw pointers or autoPtr.
      
      - IOobjectList::add() now takes an autoPtr instead of an object reference
      
      - IOobjectList::remove() now returns an autoPtr instead of a raw pointer
      48d654cf
  7. May 02, 2018
  8. Mar 07, 2018
  9. Mar 05, 2018
    • Mark OLESEN's avatar
      STYLE: use direct iteration for HashSet · 4fe8ed82
      Mark OLESEN authored
      - The iterator for a HashSet dereferences directly to its key.
      
      - Eg,
      
            for (const label patchi : patchSet)
            {
                ...
            }
        vs.
            forAllConstIter(labelHashSet, patchSet, iter)
            {
                const label patchi = iter.key();
                ...
            }
      4fe8ed82
  10. Apr 27, 2018
    • Mark OLESEN's avatar
      ENH: make format of ExecutionTime = ... output configurable (issue #788) · dd8341f6
      Mark OLESEN authored
      - controlled by the the 'printExecutionFormat' InfoSwitch in
        etc/controlDict
      
            // Style for "ExecutionTime = " output
            // - 0 = seconds (with trailing 's')
            // - 1 = day-hh:mm:ss
      
         ExecutionTime = 112135.2 s  ClockTime = 113017 s
      
         ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37
      
      - Callable via the new Time::printExecutionTime() method,
        which also helps to reduce clutter in the applications.
        Eg,
      
           runTime.printExecutionTime(Info);
      
        vs
      
           Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
               << "  ClockTime = " << runTime.elapsedClockTime() << " s"
               << nl << endl;
      
      --
      
      ENH: return elapsedClockTime() and clockTimeIncrement as double
      
      - previously returned as time_t, which is less portable.
      dd8341f6
    • Mark OLESEN's avatar
      ENH: ListOp::inplaceMapValue using a Map<label> for the mapping. · 10b69fa2
      Mark OLESEN authored
      For example, with some HashTable or Map container of models
      
          { model0 => 1, model1 => 4, model2 => 5, model3 => 12, model4 => 15, }
      
      specify the remapping
      
          Map<label> mapper({{1, 3}, {2, 6}, {3, 12}, {5, 8}});
      
      inplaceMapValue(mapper, models) then yields
      
          { model0 => 3, model1 => 4, model2 => 8, model3 => 12, model4 => 15, }
      
      --
      
      ENH: extend bitSet::count() to optionally count unset bits instead.
      
      --
      
      ENH: BitOps compatibility methods for boolList.
      
      - These ease coding that uses a boolList instead of bitSet and use
        short-circuit logic when possible.
      
        Eg, when 'bitset' and 'bools' contain the same information
      
            bitset.count()  <->  BitOps::count(bools)
            bitset.all()    <->  BitOps::all(bools)
            bitset.any()    <->  BitOps::any(bools)
            bitset.none()   <->  BitOps::none(bools)
      
        These methods can then be used directly in parameters or in logic.
        Eg,
      
            returnReduce(bitset.any(), orOp<bool>());
            returnReduce(BitOps::any(bools), orOp<bool>());
      
            if (BitOps::any(bools)) ...
      10b69fa2
    • Mark OLESEN's avatar
      c0766ce8
  11. Apr 25, 2018
    • Mark OLESEN's avatar
      STYLE: improve wmkdepend parse error message · ebfe4650
      Mark OLESEN authored
      - parsing error state only arises from a missing final newline
        in the file (which the dnl macro does not capture).
        Report with a warning instead of modifying the dnl macro since
        we generally wish to know about this anyhow.
      
      - add missing newline to YEqn.H file.
      ebfe4650
    • Mark OLESEN's avatar
      ENH: improve handling of mismatched brackets, forgotten ';' (issue #762) · 2fde6c3a
      Mark OLESEN authored
      - flags the following type of problems:
      
        * mismatches:
      
              keyword  mismatch ( set of { brackets ) in the } entry;
      
        * underflow (too many closing brackets:
      
              keyword  too many ( set of ) brackets ) in ) entry;
      
      - a missing semi-colon
      
              dict
              {
                 keyword  entry with missing semi-colon
              }
      
        will be flagged as 'underflow', since it parses through the '}' but
        did not open with it.
      
      Max monitoring depth is 60 levels of nesting, to avoid incurring any
      memory allocation.
      2fde6c3a
  12. Apr 24, 2018
    • Mark OLESEN's avatar
      CONFIG: adjust make scripts for darwin · 76cb38fb
      Mark OLESEN authored
      - handling of dead links (find -L -delete unsupported)
      
      - remove ignore case flag on 's/../../i' used in have_scotch script.
        It is unneeded and not tolerated by Darwin's sed.
      
      - avoid embedded comments in EXE_INC (Make/options files), which do
        not work well with the OSX LLVM cpp.
        It strips out the comments but also removes the continuation char.
      
      STYLE: adjust notes about paraview library locations
      76cb38fb
    • Mark OLESEN's avatar
      ENH: improve handling of ThirdParty packages · b4d38ab4
      Mark OLESEN authored
      - generalize some of the library extensions (.so vs .dylib).
        Provide as wmake 'sysFunctions'
      
      - added note about unsupported/incomplete system support
      
      - centralize detection of ThirdParty packages into wmake/ subdirectory
        by providing a series of scripts in the spirit of GNU autoconfig.
        For example,
      
            have_boost, have_readline, have_scotch, ...
      
        Each of the `have_<package>` scripts will generally provide the
        following type of functions:
      
            have_<package>          # detection
            no_<package>            # reset
            echo_<package>          # echoing
      
        and the following type of variables:
      
            HAVE_<package>          # unset or 'true'
            <package>_ARCH_PATH     # root for <package>
            <package>_INC_DIR       # include directory for <package>
            <package>_LIB_DIR       # library directory for <package>
      
        This simplifies the calling scripts:
      
            if have_metis
            then
                wmake metisDecomp
            fi
      
        As well as reducing clutter in the corresponding Make/options:
      
            EXE_INC = \
                -I$(METIS_INC_DIR) \
                -I../decompositionMethods/lnInclude
      
            LIB_LIBS = \
                -L$(METIS_LIB_DIR) -lmetis
      
        Any additional modifications (platform-specific or for an external build
        system) can now be made centrally.
      b4d38ab4
    • Mark OLESEN's avatar
      672f0574
  13. Apr 19, 2018
    • Mark OLESEN's avatar
      DEFEATURE: remove foamToTecplot360 · b5c7e43c
      Mark OLESEN authored
      - the API-versioned calls (eg, tecini142, teczne142, tecpoly142, tecend142),
        the limited availability of the SDK and lack of adequate testing make
        proper maintenance very difficult.
      b5c7e43c
  14. Apr 18, 2018
  15. Apr 12, 2018
    • 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
  16. Mar 28, 2018
  17. Apr 16, 2018
    • Mark OLESEN's avatar
      ENH: add alternative STL ASCII parsers · ea71484e
      Mark OLESEN authored
      - In addition to the traditional Flex-based parser, added a Ragel-based
        parser and a handwritten one.
      
        Some representative timings for reading 5874387 points (1958129 tris):
      
            Flex   Ragel   Manual
            5.2s   4.8s    6.7s         total reading time
            3.8s   3.4s    5.3s         without point merging
      ea71484e
  18. Apr 13, 2018
  19. Apr 12, 2018
  20. Apr 11, 2018
  21. Apr 12, 2018
  22. Apr 10, 2018
    • Mark OLESEN's avatar
      ENH: additional text expansion shortcuts (issue #792) · a9741cea
      Mark OLESEN authored
      Support the following expansions when they occur at the start of a
      string:
      
          Short-form       Equivalent
          =========       ===========
            <etc>/          ~OpenFOAM/   (as per foamEtcFile)
            <case>/         $FOAM_CASE/
            <constant>/     $FOAM_CASE/constant/
            <system>/       $FOAM_CASE/system/
      
      These can be used in fileName expansions to improve clarity and reduce
      some typing
      
           "<constant>/reactions"   vs  "$FOAM_CASE/constant/reactions"
      a9741cea
  23. Apr 09, 2018
    • Mark OLESEN's avatar
      ENH: provide Rand48 as generator in the expected C++11 form · b85d0b5c
      Mark OLESEN authored
      - this removes an OS-specific dependency (eg, drand48_r is not POSIX)
        and allows easier use of other random number generators.
      
        The Rand48 generator has identical behaviour and period as the
        lrand48() library routine, but holds its own seed and state
        (which makes it re-entrant) and can be combined with other
        random distributions.
      
        However, when using the modified form to obtain scalar values
        they will not be identical to what drand48() yields.
      
        This is because drand48() uses the raw 48-bit values to directly
        set the mantissa of an IEEE double where as the newer distribution
        normalizes based on the 32-bit value.
      
      STYLE: simplify code in Random::shuffle and use Swap
      b85d0b5c
  24. Apr 03, 2018
  25. Mar 26, 2018
    • Mark OLESEN's avatar
      STYLE: consistent lookupOrDefault template parameters · 36719bf5
      Mark OLESEN authored
      - in many cases can just use lookupOrDefault("key", bool) instead of
        lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
        bool from an Istream uses the Switch(Istream&) anyhow
      
      STYLE: relocated Switch string names into file-local scope
      36719bf5
  26. Mar 22, 2018
  27. Mar 21, 2018
  28. Mar 16, 2018
    • Mark OLESEN's avatar
      STYLE: more consistent use of dimensioned Zero · 2f86cdc7
      Mark OLESEN authored
      - when constructing dimensioned fields that are to be zero-initialized,
        it is preferrable to use a form such as
      
            dimensionedScalar(dims, Zero)
            dimensionedVector(dims, Zero)
      
        rather than
      
            dimensionedScalar("0", dims, 0)
            dimensionedVector("zero", dims, vector::zero)
      
        This reduces clutter and also avoids any suggestion that the name of
        the dimensioned quantity has any influence on the field's name.
      
        An even shorter version is possible. Eg,
      
            dimensionedScalar(dims)
      
        but reduces the clarity of meaning.
      
      - NB: UniformDimensionedField is an exception to these style changes
        since it does use the name of the dimensioned type (instead of the
        regIOobject).
      2f86cdc7
  29. Mar 15, 2018
  30. Mar 14, 2018