Skip to content
Snippets Groups Projects
  1. Dec 06, 2021
  2. Dec 03, 2021
  3. Dec 02, 2021
  4. Nov 29, 2021
  5. Nov 26, 2021
    • Andrew Heather's avatar
      Merge branch 'feature-expr-improvements' into 'develop' · 2880a543
      Andrew Heather authored
      Updates for expressions to improve robustness and support functions, external context etc.
      
      See merge request !501
      2880a543
    • Mark OLESEN's avatar
      ENH: generalize volField lookups to include 'context' objects · c0adccf8
      Mark OLESEN authored
      - allows an additional HashTable of pointers to reference external
        content which not otherwise directly available via an
        objectRegistry.
      
        This could typically be used to provide a function-local "rho"
        to the expression evaluation.
      c0adccf8
    • Mark OLESEN's avatar
      ENH: add cell/face set/zone support for patch expressions · 643763d2
      Mark OLESEN authored
      - for cell quantities, these evaluate on the faceCells associated with
        that patch to produce a field of true/false values
      
      - for face quantities, these simply correspond to the mesh faces
        associated with that patch to produce a field of true/false values
      643763d2
    • Mark OLESEN's avatar
      ENH: add expression support for scalar/vector expression lookups · fc6239d9
      Mark OLESEN authored
      - similar idea to swak timelines/lookuptables but combined together
        and based on Function1 for more flexibility.
      
        Specified as 'functions<scalar>' or 'functions<vector>'.
        For example,
      
        functions<scalar>
        {
            intakeType table ((0 0) (10 1.2));
      
            p_inlet
            {
                type        sine;
                frequency   3000;
                scale       50;
                level       101325;
            }
        }
      
        These can be referenced in the expressions as a nullary function or a
        unary function.
      
        Within the parser, the names are prefixed with "fn:" (function).
        It is thus possible to define "fn:sin()" that is different than
        the builtin "sin()" function.
      
           * A nullary call uses time value
             - Eg, fn:p_inlet()
      
           * A unary call acts as a remapper function.
             - Eg, fn:intakeType(6.25)
      fc6239d9
    • Mark OLESEN's avatar
      ENH: robuster lemon parsing · e6697edb
      Mark OLESEN authored
      - previously simply reused the scan token, which works fine for
        non-nested tokenizations but becomes too fragile with nesting.
      
        Now changed to use tagged unions that can be copied about
        and still retain some rudimentary knowledge of their types,
        which can be manually triggered with a destroy() call.
      
      - provide an 'identifier' non-terminal as an additional catch
        to avoid potential leakage on parsing failure.
      
      - adjust lemon rules and infrastructure:
      
        - use %token to predefine standard tokens.
          Will reduce some noise on the generated headers by retaining the
          order on the initial token names.
      
        - Define BIT_NOT, internal token rename NOT -> LNOT
      
      - handle non-terminal vector values.
        Support vector::x, vector::y and vector::z constants
      
      - permit fieldExpr access to time().
        Probably not usable or useful for an '#eval' expression,
        but useful for a Function1.
      
      - provisioning for hooks into function calls. Establishes token
        names for next commit(s).
      e6697edb
    • Mark OLESEN's avatar
      Merge branch 'feature-functionObject-Function1' into 'develop' · adbcd3a1
      Mark OLESEN authored
      Function1 objectRegistry access
      
      See merge request !499
      adbcd3a1
    • Mark OLESEN's avatar
      ENH: add Function1 wrapping for functionObject trigger · adcf41bd
      Mark OLESEN authored and Mark OLESEN's avatar Mark OLESEN committed
          Returns a 0/1 value corresponding to function object trigger levels.
      
          Usage:
          \verbatim
              <entryName> functionObjectTrigger;
              <entryName>Coeffs
              {
                  triggers        (1 3 5);
                  defaultValue    false;  // Default when no triggers activated
              }
          \endverbatim
      
      ENH: add reset() method for Constant Function1
      
      ENH: allow forced change of trigger index
      
      - the triggers are normally increase only,
        but can now override this optionally
      adcf41bd
    • Mark OLESEN's avatar
      BUG: dsmcFields fails with scoped field names · 30a2fa4b
      Mark OLESEN authored and Mark OLESEN's avatar Mark OLESEN committed
      30a2fa4b
    • Andrew Heather's avatar
      ENH: LimitRange Function1 - extended and renamed · 89ddc271
      Andrew Heather authored and Mark OLESEN's avatar Mark OLESEN committed
      Description
          Function1 wrapper that maps the input value prior to it being used by
          another Function1.
      
          Example usage for limiting a polynomial:
          \verbatim
              <entryName>
              {
                  type            inputValueMapper;
                  mode            minMax;
      
                  min             0.4;
                  max             1.4;
      
                  value polynomial
                  (
                      (5 1)
                      (-2 2)
                      (-2 3)
                      (1 4)
                  );
              }
          \endverbatim
      
          Here the return value will be:
          - poly(0.4) for x <= 0.4;
          - poly(1.4) for x >= 1.4; and
          - poly(x) for 0.4 < x < 1.4.
      
          Example usage for supplying a patch mass flux for a table lookup:
          \verbatim
              <entryName>
              {
                  type            inputValueMapper;
                  mode            function;
      
                  function
                  {
                      type            functionObjectValue;
                      functionOb...
      89ddc271
    • Andrew Heather's avatar
      ENH: Function1 - updated time-based Function1 usage · ba45fb2c
      Andrew Heather authored and Mark OLESEN's avatar Mark OLESEN committed
      ba45fb2c
    • Andrew Heather's avatar
      STYLE: renamed convertTimeBase to more descriptive userTimeToTime · f6ee1811
      Andrew Heather authored and Mark OLESEN's avatar Mark OLESEN committed
      f6ee1811
    • Andrew Heather's avatar
      ENH: Function1's - added objectRegistry access · 098aec49
      Andrew Heather authored and Mark OLESEN's avatar Mark OLESEN committed
      098aec49
    • Andrew Heather's avatar
      889bc171