ENH: support "one-shot" changes to the dictionary inputMode (issue #429)

- Instead of relying on #inputMode to effect a global change it is now
  possible (and recommended) to a temporary change in the inputMode
  for the following entry.

     #default   : provide default value if entry is not already defined
     #overwrite : silently remove a previously existing entry
     #warn      : warn about duplicate entries
     #error     : error if any duplicate entries occur
     #merge     : merge sub-dictionaries when possible (the default mode)

  This is generally less cumbersome than the switching the global
  inputMode. For example to provide a set of fallback values.

      #includeIfPresent "user-files"
      ...
      #default value uniform 10;

  vs.

      #includeIfPresent "user-files"
      #inputMode protect
      ...
      value uniform 10;
      #inputMode merge    // _Assuming_ we actually had this before

  These directives can also be used to suppress the normal dictionary
  merge semantics:

     #overwrite dict { entry val; ... }
This commit is contained in:
Mark Olesen
2017-07-29 17:44:22 +02:00
parent 2fdc6b161a
commit 4e48beffd4
12 changed files with 185 additions and 25 deletions

View File

@ -12,6 +12,4 @@ maxCo 12;
maxDeltaT 1;
#inputMode merge
// ************************************************************************* //

View File

@ -12,6 +12,4 @@ maxCo 2.5;
maxDeltaT 0.3;
#inputMode merge
// ************************************************************************* //

View File

@ -12,6 +12,4 @@ maxCo 8;
maxDeltaT 1;
#inputMode merge
// ************************************************************************* //

View File

@ -12,6 +12,4 @@ maxCo 5;
maxDeltaT 1;
#inputMode merge
// ************************************************************************* //

View File

@ -12,6 +12,4 @@ maxCo 12;
maxDeltaT 1;
#inputMode merge
// ************************************************************************* //

View File

@ -12,6 +12,4 @@ turbulentKE 37;
turbulentOmega 32;
turbulentEpsilon 30;
#inputMode merge
// ************************************************************************* //

View File

@ -10,6 +10,5 @@ flowVelocity (10 0 0);
pressure 0;
turbulentKE 1.5;
turbulentEpsilon 0.88;
#inputMode merge
// ************************************************************************* //

View File

@ -11,6 +11,5 @@ pressure 0;
turbulentKE 0.375;
turbulentOmega 3.6;
turbulentEpsilon 0.12;
#inputMode merge
// ************************************************************************* //