1. 26 Jun, 2019 1 commit
  2. 01 May, 2019 2 commits
    • Mark Olesen's avatar
      ENH: ensure that content changes in coded objects are noticed (#1293) · a85c55bb
      Mark Olesen authored
      - for codedFunctionObject and CodedSource the main code snippets
        were not included in the SHA1 calculation, which meant that many
        changes would not be noticed and no new library would be compiled.
      
        As a workaround, a dummy 'code' entry could be used solely for the
        purposes of generating a SHA1, but this is easily forgotten.
      
        We now allow tracking of the dynamicCodeContext for the coded
        objects and append to the SHA1 hasher with specific entries.
        This should solve the previous misbehaviour.
      
        We additionally add information about the ordering of the code
        sections. Suppose we have a coded function object (all code
        segments are optional) with the following:
      
            codeExecute "";
            codeWrite   #{ Info<< "Called\n"; #};
      
        which we subsequently change to this:
      
            codeExecute #{ Info<< "Called\n"; #};
            codeWrite   "";
      
        If the code strings are simply concatenated together, the SHA1 hashes
        will be identical. We thus 'salt' with their semantic locations,
        choosing tags that are unlikely to occur within the code strings
        themselves.
      
      - simplify the coded templates with constexpr for the SHA1sum
        information.
      
      - Correct the CodedSource to use 'codeConstrain' instead of
        'codeSetValue' for consistency with the underlying functions.
      a85c55bb
    • Mark Olesen's avatar
      ENH: replace processorFvPatchField specialization with 'if...' (#1304) · 83d26d19
      Mark Olesen authored
      - only apply component-wise transformCoupleField for non-scalar types
      83d26d19
  3. 26 Apr, 2019 1 commit
  4. 25 Mar, 2019 1 commit
  5. 19 Mar, 2019 1 commit
  6. 14 Mar, 2019 1 commit
  7. 26 Mar, 2019 2 commits
  8. 18 Feb, 2019 1 commit
    • Kutalmis Bercin's avatar
      ENH: Digital-Filter Based Synthetic Turbulence Generation Method for LES/DES Inflows · 33ef139a
      Kutalmis Bercin authored
          Velocity boundary condition generating synthetic turbulence-alike
          time-series for LES and DES turbulent flow computations.
      
          To this end, two synthetic turbulence generators can be chosen:
          - Digital-filter method-based generator (DFM)
      
          \verbatim
          Klein, M., Sadiki, A., and Janicka, J.
              A digital filter based generation of inflow data for spatially
              developing direct numerical or large eddy simulations,
              Journal of Computational Physics (2003) 186(2):652-665.
              doi:10.1016/S0021-9991(03)00090-1
          \endverbatim
      
          - Forward-stepwise method-based generator (FSM)
      
          \verbatim
          Xie, Z.-T., and Castro, I.
              Efficient generation of inflow conditions for large eddy simulation of
              street-scale flows, Flow, Turbulence and Combustion (2008) 81(3):449-470
              doi:10.1007/s10494-008-9151-5
          \endverbatim
      
          In DFM or FSM, a random number set (mostly white noise), and a group
          of target statistics (mostly mean flow, Reynolds stress tensor profiles and
          length-scale sets) are fused into a new number set (stochastic time-series,
          yet consisting of the statistics) by a chain of mathematical operations
          whose characteristics are designated by the target statistics, so that the
          realised statistics of the new sets could match the target.
      
          Random number sets ---->-|
                                   |
                               DFM or FSM ---> New stochastic time-series consisting
                                   |           turbulence statistics
          Turbulence statistics ->-|
      
          The main difference between DFM and FSM is that the latter replaces the
          streamwise convolution summation in DFM by a simpler and a quantitatively
          justified equivalent procedure in order to reduce computational costs.
          Accordingly, the latter potentially brings resource advantages for
          computations involving relatively large length-scale sets and small
          time-steps.
      33ef139a
  9. 10 Feb, 2019 1 commit
  10. 13 Feb, 2019 1 commit
  11. 11 Feb, 2019 1 commit
  12. 08 Feb, 2019 1 commit
  13. 07 Feb, 2019 1 commit
    • Mark Olesen's avatar
      ENH: code adjustments for updated NullObject · 078e3474
      Mark Olesen authored
      - can now safely use labelList::null() instead of emptyLabelList for
        return values. No special treatment required for lists.
      
        Possible replacements:
      
            if (notNull(list) && list.size())  ->  if (list.size())
            if (isNull(list) || list.empty())  ->  if (list.empty())
      
        The receiver may still wish to handle differently to distinguish
        between a null list and an empty list, but no additional special
        protection is required when obtaining sizes, traversing, outputting
        etc.
      078e3474
  14. 06 Feb, 2019 1 commit
  15. 05 Feb, 2019 1 commit
  16. 25 Jan, 2019 1 commit
  17. 11 Jan, 2019 2 commits
  18. 20 Dec, 2018 1 commit
  19. 17 Dec, 2018 1 commit
  20. 11 Dec, 2018 1 commit
    • Mark Olesen's avatar
      ENH: use Zero when zero-initializing types · 1d85fecf
      Mark Olesen authored
      - makes the intent clearer and avoids the need for additional
        constructor casting. Eg,
      
            labelList(10, Zero)    vs.  labelList(10, 0)
            scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
            vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
      1d85fecf
  21. 03 Dec, 2018 1 commit
    • Andrew Heather's avatar
      ENH: freestream BC: allow inlet value to be specified by another patch · 31a439dc
      Andrew Heather authored
      The freestreamFvPatchField previously employed a fixed value when supplying
      the inlet values.  This commit extends the BC so that users can use another
      patch to supply the values via the new freestreamBC entry, e.g. to set the
      velocity to an atmospheric boundary layer profile:
      
          inlet
          {
              type            freestream;
              freestreamBC
              {
                  type            atmBoundaryLayerInletVelocity;
                  flowDir         (1 0 0);
                  zDir            (0 0 1);
                  Uref            20;
                  Zref            20;
                  z0              uniform 0.1;
                  zGround         uniform 935;
              }
          }
      
      The earlier specification is also maintained for backwards compatibility, e.g.
      
          inlet
          {
              type            freestream;
              freestreamValue uniform (300 0 0);
          }
      31a439dc
  22. 14 Nov, 2018 1 commit
  23. 20 Nov, 2018 2 commits
    • Mark Olesen's avatar
      ENH: add read guard for dimensionedType constructors (#762) · dd87c983
      Mark Olesen authored
      - deprecate dimensionedType constructors using an Istream in favour of
        versions accepting a keyword and a dictionary.
      
        Dictionary entries are almost the exclusive means of read
        constructing a dimensionedType. By construct from the dictionary
        entry instead of doing a lookup() first, we can detect possible
        input errors such as too many tokens as a result of a input syntax
        error.
      
        Constructing a dimensionedType from a dictionary entry now has
        two forms.
      
        1.  dimensionedType(key, dims, dict);
      
            This is the constructor that will normally be used.
      
            It accepts entries with optional leading names and/or
            dimensions. If the entry contains dimensions, they are
            verified against the expected dimensions and an IOError is
            raised if they do not correspond. On conclusion, checks the
            token stream for any trailing rubbish.
      
        2.  dimensionedType(key, dict);
      
            This constructor is used less frequently.
      
            ...
      dd87c983
    • Mark Olesen's avatar
      ENH: use dictionary::get<> instead of pTraits (#762) · efdbeae2
      Mark Olesen authored
      - check Istream in readBool in operator>> variant (#1033)
      efdbeae2
  24. 12 Nov, 2018 3 commits
  25. 06 Nov, 2018 2 commits
  26. 05 Nov, 2018 1 commit
  27. 31 Oct, 2018 1 commit
  28. 29 Oct, 2018 2 commits
  29. 19 Oct, 2018 1 commit
  30. 18 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: cleanup of Enum class · 3b745122
      Mark Olesen authored
      - more dictionary-like methods, enforce keyType::LITERAL for all
        lookups to avoid any spurious keyword matching.
      
      - new readEntry, readIfPresent methods
      
      - The get() method replaces the now deprecate lookup() method.
      
      - Deprecate lookupOrFailsafe()
        Failsafe behaviour is now an optional parameter for lookupOrDefault,
        which makes it easier to tailor behaviour at runtime.
      
      - output of the names is now always flatted without line-breaks.
        Thus,
      
           os << flatOutput(someEnumNames.names()) << nl;
           os << someEnumNames << nl;
      
        both generate the same output.
      
      - Constructor now uses C-string (const char*) directly instead of
        Foam::word in its initializer_list.
      
      - Remove special enum + initializer_list constructor form since
        it can create unbounded lookup indices.
      
      - Removd old hasEnum, hasName forms that were provided during initial
        transition from NamedEnum.
      
      - Added static_assert on Enum contents to restrict to enum or
        integral values.  Should not likely be using this class to enumerate
        other things since it internally uses an 'int' for its values.
      
        Changed volumeType accordingly to enumerate on its type (enum),
        not the class itself.
      3b745122
  31. 17 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: simplify objectRegistry access names (issue #322) · 8fabc325
      Mark Olesen authored
        New name:  findObject(), cfindObject()
        Old name:  lookupObjectPtr()
      
            Return a const pointer or nullptr on failure.
      
        New name:  findObject()
        Old name:  --
      
            Return a non-const pointer or nullptr on failure.
      
        New name:  getObjectPtr()
        Old name:  lookupObjectRefPtr()
      
            Return a non-const pointer or nullptr on failure.
            Can be called on a const object and it will perform a
            const_cast.
      
      - use these updated names and functionality in more places
      
      NB: The older methods names are deprecated, but continue to be defined.
      8fabc325
  32. 12 Oct, 2018 1 commit
    • Mark Olesen's avatar
      ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033) · 8eddcc07
      Mark Olesen authored
      - use the dictionary 'get' methods instead of readScalar for
        additional checking
      
           Unchecked:  readScalar(dict.lookup("key"));
           Checked:    dict.get<scalar>("key");
      
      - In templated classes that also inherit from a dictionary, an additional
        'template' keyword will be required. Eg,
      
           this->coeffsDict().template get<scalar>("key");
      
        For this common use case, the predefined getXXX shortcuts may be
        useful. Eg,
      
           this->coeffsDict().getScalar("key");
      8eddcc07