1. 19 Feb, 2020 1 commit
  2. 18 Feb, 2020 6 commits
    • 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.
                  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
                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.
          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().
          or failsafe constructor method
                  IOstreamOption::versionNumber("version", headerDict)
          Before (controlled input):
          Old, uncontrolled input - has been removed:
      * 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
    • Mark Olesen's avatar
    • Mark Olesen's avatar
      STYLE: adjust names, locations for fileFormats · 4307e171
      Mark Olesen authored
      - renamed 'core/' -> 'base/' to avoid gitignore masking when re-adding
      - rename 'nas/' to 'nastran/' for more clarity
      - relocated OBJstream from surfMesh to fileFormats
      STYLE: remove unused parseNASCoord. Was deprecated 2017-09
    • Kutalmis Bercin's avatar
      ENH: improve analytical eigendecompositions · 55e7da67
      Kutalmis Bercin authored and Andrew Heather's avatar Andrew Heather committed
        - `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
    • Kutalmis Bercin's avatar
      ENH: improve funcs and opers in Tensor types · 66b02ca5
      Kutalmis Bercin authored and Andrew Heather's avatar Andrew Heather committed
        - 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
    • Kutalmis Bercin's avatar
      ENH: improve stability in polynomialEqns · 8ca724ff
      Kutalmis Bercin authored and Andrew Heather's avatar Andrew Heather committed
        - 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
  3. 06 Feb, 2020 1 commit
  4. 31 Jan, 2020 1 commit
    • 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
          * 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:
      CONFIG: added IndirectListsFwd.H with some common forwarding
  5. 22 Jan, 2020 1 commit
  6. 23 Dec, 2019 1 commit
  7. 19 Dec, 2019 1 commit
  8. 17 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: use exprString expansions for #eval · 1cf795a4
      Mark Olesen authored
      - follows the principle of least surprise if the expansion behaviour
        for #eval and expressions (eg, exprFixedValue) are the same.  This
        is possible now that we harness the regular stringOps::expand()
        within exprString::expand()
  9. 16 Dec, 2019 1 commit
  10. 13 Dec, 2019 4 commits
    • Mark Olesen's avatar
      ENH: improve expression string expansions · 33e0c4ba
      Mark Olesen authored
      - reuse more of stringOps expansions to reduce code and improve the
        syntax flexiblity.
        We can now embed "pre-calculated" values into an expression.
        For example,
             angle       35;
             valueExpr   "vector(${{cos(degToRad($angle))}}, 2, 3)";
        and the ${{..}} will be evaluated with the regular string evaluation
        and used to build the entire expression for boundary condition
        Could also use for fairly wild indirect referencing:
             axis1   (1 0 0);
             axis2   (0 1 0);
             axis3   (0 0 1);
             index   100;
             expr   "$[(vector) axis${{ ($index % 3) +1 }}] / ${{max(1,$index)}}";
    • Mark Olesen's avatar
      STYLE: header format · 7aa2bf83
      Mark Olesen authored
    • Mark Olesen's avatar
      ENH: stringOps::findTrim helper · 17d9969a
      Mark Olesen authored
      - finds beg/end indices of string trimmed of leading/trailing whitespace
    • Mark Olesen's avatar
      string trim · 677e3142
      Mark Olesen authored
  11. 12 Dec, 2019 2 commits
    • Kutalmis Bercin's avatar
      BUG: fix QRMatrix (#1261, #1240) · af0e454c
      Kutalmis Bercin authored
          QRMatrix (i.e. QR decomposition, QR factorisation or orthogonal-triangular
          decomposition) decomposes a scalar/complex matrix \c A into the following
          matrix product:
              A = Q*R,
           \c Q is a unitary similarity matrix,
           \c R is an upper triangular matrix.
          Input types:
           - \c A can be a \c SquareMatrix<Type> or \c RectangularMatrix<Type>
          Output types:
           - \c Q is always of the type of the matrix \c A
           - \c R is always of the type of the matrix \c A
          Options for the output forms of \c QRMatrix (for an (m-by-n) input matrix
          \c A with k = min(m, n)):
           - outputTypes::FULL_R:     computes only \c R                   (m-by-n)
           - outputTypes::FULL_QR:    computes both \c R and \c Q          (m-by-m)
           - outputTypes::REDUCED_R:  computes only reduced \c R           (k-by-n)
          Options where to store \c R:
           - storeMethods::IN_PLACE:        replaces input matrix content with \c R
           - storeMethods::OUT_OF_PLACE:    creates new object of \c R
          Options for the computation of column pivoting:
           - colPivoting::FALSE:            switches off column pivoting
           - colPivoting::TRUE:             switches on column pivoting
          Direct solution of linear systems A x = b is possible by solve() alongside
          the following limitations:
           - \c A         = a scalar square matrix
           - output type  = outputTypes::FULL_QR
           - store method = storeMethods::IN_PLACE
          - QR decomposition is not unique if \c R is not positive diagonal \c R.
          - The option combination:
            - outputTypes::REDUCED_R
            - storeMethods::IN_PLACE
            will not modify the rows of input matrix \c A after its nth row.
          - Both FULL_R and REDUCED_R QR decompositions execute the same number of
            operations. Yet REDUCED_R QR decomposition returns only the first n rows
            of \c R if m > n for an input m-by-n matrix \c A.
          - For m <= n, FULL_R and REDUCED_R will produce the same matrices
    • Kutalmis Bercin's avatar
      ENH: add new funcs into `SquareMatrix` · 64614cfc
      Kutalmis Bercin authored
          - query func `symmetric()`
          - query func `tridiagonal()`
          - `resize()`
          - `labelpair` identity constructor
          STYLE: add `#if(0 | RUNALL)` to improve test control in Test-Matrix
  12. 11 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: unified some common parser static methods · eb4fec37
      Mark Olesen authored
      COMP: delay evaluation of fieldToken enumeration types
      - lazy evaluation at runTime instead of compile-time to make the code
        independent of initialization order.
        Otherwise triggers problems on gcc-4.8.5 on some systems where
        glibc is the same age, or older.
  13. 09 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: generalize string expression evaluation · c2123452
      Mark Olesen authored
      - replace stringOps::toScalar with a more generic stringOps::evaluate
        method that handles scalars, vectors etc.
      - improve #eval to handle various mathematical operations.
        Previously only handled scalars. Now produce vectors, tensors etc
        for the entries. These tokens are streamed directly into the entry.
  14. 06 Dec, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add ITstream append and seek methods. · 9fd696e1
      Mark Olesen authored
      - ITstream append() would previously have used the append from the
        underlying tokenList, which leaves the tokenIndex untouched and
        renders the freshly appended tokens effectively invisible if
        interspersed with primitiveEntry::read() that itself uses tokenIndex
        when building the list.
        The new append() method makes this hidden ITstream bi-directionality
        easier to manage. For efficiency, we only append lists
        (not individual tokens) and support a 'lazy' resizing that allows
        the final resizing to occur later when all tokens have been appended.
      - The new ITstream seek() method provides a conveniently means to move
        to the end of the list or reposition to the middle.
        Using rewind() and using seek(0) are identical.
      ENH: added OTstream to output directly to a list of tokens
      BUG: List::newElem resized incorrectly
      - had a simple doubling of the List size without checking that this
        would indeed be sufficient for the requested index.
        Bug was not triggered since primitiveEntry was the only class using
        this call, and it added the tokens sequentially.
  15. 07 Dec, 2019 1 commit
  16. 26 Nov, 2019 1 commit
  17. 25 Nov, 2019 1 commit
    • Mark Olesen's avatar
      ENH: add clear/append method to Enum and std::ostream output · 6dd3cd0e
      Mark Olesen authored
      - allows use of Enum in more situations where a tiny Map/HashTable
        replacement is desirable. The new methods can be combined with
        null constructed for to have a simple low-weight caching system
        for words/integers instead of fitting in a HashTable.
  18. 21 Nov, 2019 1 commit
  19. 19 Nov, 2019 2 commits
    • Mark Olesen's avatar
      ENH: add conditionals to #eval (string to scalar) · 9e6683f7
      Mark Olesen authored
           ($radius > 10) ? sin(degToRad(45)) : cos(degToRad(30))
      - protect division and modulo against zero-divide.
      - add scanner/parser debugging switches in the namespace,
        selectable as "stringToScalar". For example,
          debug parser:  foamDictionary -debug-switch stringToScalar=2
          debug scanner: foamDictionary -debug-switch stringToScalar=4
          debug both:    foamDictionary -debug-switch stringToScalar=6
    • Mattijs Janssens's avatar
      Feature single precision solve type · 2d080ff3
      Mattijs Janssens authored
  20. 18 Nov, 2019 1 commit
  21. 15 Nov, 2019 4 commits
  22. 13 Nov, 2019 2 commits
  23. 11 Nov, 2019 1 commit
    • Mark Olesen's avatar
      ENH: rationalize some string methods. · 7c1190f0
      Mark Olesen authored
      - silently deprecate 'startsWith', 'endsWith' methods
        (added in 2016: 2b143606), in favour of
        'starts_with', 'ends_with' methods, corresponding to C++20 and
        allowing us to cull then in a few years.
      - handle single character versions of starts_with, ends_with.
      - add single character version of removeEnd and silently deprecate
        removeTrailing which did the same thing.
      - drop the const versions of removeRepeated, removeTrailing.
        Unused and with potential confusion.
      STYLE: use shrink_to_fit(), erase()
  24. 31 Oct, 2019 1 commit
  25. 10 Nov, 2019 1 commit
  26. 06 Nov, 2019 1 commit