Commit Graph

9 Commits

Author SHA1 Message Date
Mark Olesen
0339e5ee0d BUG: expression field functionObject 'store' keyword ignored 2023-01-26 21:49:59 +01:00
Mark Olesen
4b94ac97c2 ENH: dimensioned/dimensionedSet handle optional read as per dictionary 2022-12-13 10:09:46 +01:00
Mark Olesen
ee9119f436 ENH: rationalize expression string reading
- read construct from dictionary.
  Calling syntax similar to dimensionedType, dimensionedSet,...

  Replaces the older getEntry(), getOptional() static methods

- support readIfPresent
2022-10-04 15:51:26 +02:00
Mark Olesen
b712e7289e ENH: use typed lookup versions instead of xyz::typeName literals 2022-05-17 17:35:51 +02:00
Mark Olesen
95e2a2e887 ENH: add sorted() to objectRegistry and IOobjectList
- returns UPtrList view (read-only or read/write) of the objects

- shorter names for IOobject checks: hasHeaderClass(), isHeaderClass()

- remove unused IOobject::isHeaderClassName(const word&) method.
  The typed versions are preferable/recommended, but can still check
  directly if needed:

     (io.headerClassName() == "foo")
2022-05-17 17:35:51 +02:00
Mark Olesen
c1eb5413d5 ENH: IOobject hasHeaderClassName() method
- simple wrapper for (!headerClassName().empty()) when checking if
  reading was successful.
2022-03-12 21:16:29 +01:00
Mark Olesen
0867816490 ENH: additional protection against zero-sized graph offset lists
- for metis-like graphs there is no guarantee that a zero-sized graph
  has an offsets list with size 1 or size 0, so always use

     numCells = max(0, xadj.size()-1)

  this was already done in most places, but missed in the
  decomposeGeneral method

STYLE: use sumOp<label>() instead of plusOp<label>()
2022-03-04 17:49:23 +00:00
Mark Olesen
2a25b356b9 ENH: use GeometricField type aliases in sampling and expressions 2022-02-21 19:53:21 +01:00
Mark Olesen
8d4ad0438d ENH: add exprField function object
- provides a simple means of defining/modifying fields. For example,

  ```
  <name1>
  {
      type    exprField;
      libs    (fieldFunctionObjects);
      field   pTotal;

      expression  "p + 0.5*(rho*magSqr(U))";
      dimensions  [ Pa ];
  }
  ```
  It is is also possible to modify an existing field.
  For example, to modify the previous one.
  ```
  <name2>
  {
      type    exprField;
      libs    (fieldFunctionObjects);
      field   pTotal;
      action  modify;

      // Static pressure only in these regions
      fieldMask
      #{
          (mag(pos()) < 0.05) && (pos().y() > 0)
       || cellZone(inlet)
      #};
      expression  "p";
  }
  ```

  To use as a simple post-process calculator, simply avoid storing the
  result and only generate on write:
  ```
  <name2>
  {
      store            false;
      executionControl none;
      writeControl     writeTime;
      ...
  }
  ```
2021-12-10 14:46:21 +00:00