1. 18 Feb, 2020 15 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
      e3f681fa
    • 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
      f3106ec1
    • Mark Olesen's avatar
      ENH: support IOstreamOption in abstract stream types · 3135dcf2
      Mark Olesen authored
      - expose the write IOstreamOption in Time
      3135dcf2
    • 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.
      
              IOstream::formatEnum
              (
                  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
      
            IOstream::formatEnum
            (
                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.
      
             is.format("binar");
      
          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().
      
          Now:
      
              is.version(headerDict.get<token>("version"));
      
          or failsafe constructor method
      
              is.version
              (
                  IOstreamOption::versionNumber("version", headerDict)
              );
      
          Before (controlled input):
      
              is.version
              (
                  IOstreamOption::versionNumber
                  (
                      headerDict.get<float>("version")
                  )
              );
      
          Old, uncontrolled input - has been removed:
      
              is.version(headerDict.lookup("version"));
      
      * 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
      33f9ae50
    • 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:
      
        OLD
      
           Switch sw(some_string, true); // NB: true = allowBad
      
           if (sw.valid()) ...
      
        NOW
      
           Switch sw = Switch::find(some_string);
      
           if (sw.good()) ...
      
        or
      
           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.
      bb53e8ad
    • Mark Olesen's avatar
      STYLE: provide return value for IOstream::fatalCheck() · ed4bd548
      Mark Olesen authored
      - allows reuse as base implementation for IOstream::check()
      ed4bd548
    • Mark Olesen's avatar
      STYLE: FatalError instead of warning for handling deprecated field format · ac709da3
      Mark Olesen authored
      - The warning in Field.C has been emitted since 2005.
      - The warning in mappedPatchBase.C has been emitted since 2012.
      ac709da3
    • 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.
      2834193c
    • Mark Olesen's avatar
      ENH: provide narrowFloat, narrowInt32 definitions · fedcbff6
      Mark Olesen authored
      - underflow/overflow handling for type narrowing.
        Eg, double -> float, int64 -> int32
      fedcbff6
    • Mark Olesen's avatar
      4e1bc2d2
    • Mark Olesen's avatar
      d7969b1b
    • Kutalmis Bercin's avatar
      ENH: improve analytical eigendecompositions · 55e7da67
      Kutalmis Bercin authored
        - `tensor` and `tensor2D` returns complex eigenvalues/vectors
        - `symmTensor` and `symmTensor2D` returns real eigenvalues/vectors
        - adds new test routines for eigendecompositions
        - improves numerical stability by:
          - using new robust algorithms,
          - reordering the conditional branches in root-type selection
      55e7da67
    • Kutalmis Bercin's avatar
      STYLE: reorder global funcs and opers in Tensor types · 6a53794e
      Kutalmis Bercin authored
        - In the course of time, global funcs/opers of Tensor types expanded
          leaving funcs/opers unordered.
      
        - Therefore, by following the order designated in Matrix class, the order
          of global funcs and global opers are reordered:
          - oper+ oper- oper* oper/ inner-product double-inner-product outer-product
      6a53794e
    • Kutalmis Bercin's avatar
      ENH: improve funcs and opers in Tensor types · 66b02ca5
      Kutalmis Bercin authored
        - ensures each Tensor-container operates for the following base types:
          - floatScalar
          - doubleScalar
          - complex
      
        - adds/improves test applications for each container and base type:
          - constructors
          - member functions
          - global functions
          - global operators
      
        - misc:
          - silently removes `invariantIII()` for `tensor2D` and `symmTensor2D`
            since the 3rd invariant does not exist for 2x2 matrices
          - fixes `invariantII()` algorithm for `tensor2D` and `symmTensor2D`
          - adds `Cmpt` multiplication to `Vector2D` and `Vector`
          - adds missing access funcs for symmetric containers
          - improves func/header documentations
      66b02ca5
    • Kutalmis Bercin's avatar
      ENH: improve stability in polynomialEqns · 8ca724ff
      Kutalmis Bercin authored
        - replaces floating-point equal comparisons in
          `linearEqn`, `quadraticEqn`, and `cubicEqn`,
        - ensures `quadraticEqn` and `cubicEqn` can return `complex` roots,
        - reorders if-branches in `quadraticEqn` and `cubicEqn` to avoid
          zero-equal comparison,
        - adds Kahan's cancellation-avoiding algorithm into `quadraticEqn` and
          `cubicEqn` for the numerically-sensitive discriminant computation,
      
        - adds/improves `polynomialEqns` tests:
          * adds Test-linearEqn.C
          * adds Test-quadraticEqn.C
          * improves Test-cubicEqn.C
      8ca724ff
  2. 12 Feb, 2020 2 commits
  3. 11 Feb, 2020 1 commit
  4. 06 Feb, 2020 2 commits
  5. 03 Feb, 2020 2 commits
  6. 31 Jan, 2020 3 commits
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      8629755f
    • Mark Olesen's avatar
      ENH: added IndirectSubList · 822d052e
      Mark Olesen authored
      - provides an indirect access to a sub-section of a list that is
        somewhat less efficient than a Foam::SubList, but supports the
        following:
          * adjustment of its addressing range after construction
          * recovery of the original, underlying list at any time
      
        This can be more convenient for some coding cases.
        For example,
      
            template<class Addr>
            void renumberFaces(IndirectListBase<face, Addr>& faces, ...);
      
        which can be called for
      
            * Specific faces:
              UIndirectList<face>(mesh.faces(), facesToChange)
      
            * A sub-range of faces:
              IndirectSubList<face>(mesh.faces(), pp.range())
      
            * All faces:
              IndirectSubList<face>(mesh.faces())
      
      CONFIG: added IndirectListsFwd.H with some common forwarding
      822d052e
  7. 30 Jan, 2020 3 commits
  8. 28 Jan, 2020 2 commits
  9. 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)
      0ff02713
  10. 22 Jan, 2020 1 commit
  11. 21 Jan, 2020 2 commits
  12. 20 Jan, 2020 2 commits
  13. 17 Jan, 2020 1 commit
  14. 16 Jan, 2020 2 commits
    • Mark Olesen's avatar
      ENH: provide defaultName() static method for patches, zones · f0be8679
      Mark Olesen authored
      - consistent way of writing "patch" + Foam::name(id) etc.
      f0be8679
    • Mark Olesen's avatar
      ENH: consistency improvements for surface patch handling (fixes #483) · 2a98c4e6
      Mark Olesen authored
      - remove (unused) Istream constructors, prune some unused methods,
        rationalize write() vs writeDict().
        Deprecate inconsistent construction order.
      
      - handle empty names for ".ftr" surface patches (for plain triSurface
        format) with double-quoted strings for more reliable streaming.
        Written on a single line.
      
        This is _backward_ compatible, but if users have been parsing these
        files manually, they will need to adjust their code.
      
      Previously:
      ```
        (
        frt-fairing:001%1
        empty
      
        windshield:002%2
        empty
        ...
        )
      ```
      
      Updated (with example handling of empty name):
      ```
        (
        frt-fairing:001%1 empty
      
        windshield:002%2 ""
        ...
        )
      ```
      2a98c4e6
  15. 15 Jan, 2020 1 commit