Commit Graph

10 Commits

Author SHA1 Message Date
mattijs
bc5a55f7e6 ENH: regIOobject: factory method from IO.
- compiles
- deepClone (not needed at the moment)
- objectRegistry::subRegistry with fileName
- Time::null object so IOobject can be constructed
  without objectRegistry
2024-01-11 15:15:34 +01:00
Andrew Heather
373d88a4c4 ENH: Function1 - added some missing time conversions 2020-12-15 21:46:57 +00:00
Mark Olesen
2f2dcdcf6f ENH: Function1 and PatchFunction1 improvements (#1917)
- easier support for non-mandatory functions.

  In some boundary conditions it can be desirable to support
  additional functions, but not necessarily require them. Make this
  easier to support with a Function1, PatchFunction1 NewIfPresent()
  selector.

- support for compatibility lookups

- harmonize branching logic and error handling between Function1 and
  PatchFunction1.

ENH: refactor a base class for Function1, PatchFunction1

- includes base characteristics, patch or scalar information

ENH: additional creation macros

- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
  non-templated function into the correct templated selection table.
  makeScalarPatchFunction1 for similarity with makeScalarFunction1
2020-11-19 16:57:45 +01:00
Mark Olesen
51c2329f97 ENH: additional step function, cleanup autoPtr use in Function1 2020-05-23 18:42:41 +02:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
8eddcc072a ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)
- 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");
2018-10-12 08:14:47 +02:00
Mark Olesen
511b35629d ENH: improve infrastructure for detecting excess tokens (issue #762)
- Always used for optional dictionary entries, since these are individual
  values, and not meant to be embedded in a larger stream of tokens.

  Methods:
     - lookupOrDefault, lookupOrAddDefault, lookupOrDefaultCompat
     - readIfPresent, readIfPresentCompat

- Handling mandatory dictionary entries is slightly more complex,
  since these may be part of larger stream of tokens, and are often
  used in a constructor context. For example,

      word modelType(dict.lookup("type"));

  Or they are used without a definite context. For example,

      dict.lookup("format") >> outputFormat;

  Newly introduced methods for mandatory dictionary entries:
     - get, getCompat
     - read, readCompat

  In a constructor or assignment context:

      word modelType(dict.get<word>("type"));
      outputFormat = dict.lookup("format");

  without copy/move (similar to readIfPresent):

      dict.read("format", outputFormat);
2018-06-01 11:55:57 +02:00
Mark Olesen
c0ba7bf05a STYLE: use Ostream writeEntry when writing key/value entries
- makes for clearer code

ENH: make writeIfDifferent part of Ostream
2017-11-06 00:49:24 +01:00
Henry Weller
1e592a128a Function1::ramp: New set of scalar ramp functions
Description
    Ramp function base class for the set of scalar functions starting from 0 and
    increasing monotonically to 1 from \c start over the \c duration and
    remaining at 1 thereafter.

    Usage:
    \verbatim
        <entryName> <rampFunction>;
        <entryName>Coeffs
        {
            start     10;
            duration  20;
        }
    \endverbatim
    or
    \verbatim
        <entryName>
        {
            type      <rampFunction>;
            start     10;
            duration  20;
        }
    \endverbatim

    Where:
    \table
        Property | Description  | Required | Default value
        start    | Start time   | no       | 0
        duration | Duration     | yes      |
    \endtable

The following common ramp functions are provided: linear, quadratic, halfCosine,
quarterCosine and quaterSine, others can easily be added and registered to the run-time
selection system.
2017-03-16 20:56:57 +00:00