- a Pstream::master with a Pstream::parRun guard in case Pstream has
not yet been initialised, as will be the case for low-level messages
during startup.
- propagate relativeName handling into IOstreams
- minor simplification of #if/#endif handling
ENH: improve input robustness with negative-prefixed expansions (#2095)
- especially in blockMeshDict it is useful to negate an value directly.
Eg,
```
xmax 100;
xmin -$xmax;
```
However, this fails since the dictionary expansion is a two-step
process of tokenization followed by expansion. After the expansion
the given input would now be the following:
```
xmax 100;
xmin - 100;
```
and retrieving a scalar value for 'xmin' fails.
Counteract this by being more generous on tokenized input when
attempting to retrieve a label or scalar value.
If a '-' is found where a number is expected, use it to negate the
subsequent value.
The previous solution was to invoke an 'eval':
```
xmax 100;
xmin #eval{-$xmax};
```
which adds additional clutter.
- the readList<T>(Istream&) function was introduced to handle command
-options with either a single or a list value, but was also used for
the #remove dictionary directive. However, the parsing was fragile
if the list did not start with a '('.
Now handle command-line arg/option list directly (via ITstream)
and #remove with special-purpose reading of a string or word list.
This removes ambiguity and reduces potential future problems.
STYLE: use ITstream instead of IStringStream for command-line lookups
- parses directly to a tokenList without a string copy.
- provides support for manipulating polyMesh/boundary
- changed behaviour of disableFunctionEntries option to preserve
#include
- dictionary: added reading of lists of dictionaries.
+ each list element may be accessed using the 'entryDDD' keyword
according to their list index.
Patch contributed by Mattijs Janssens
- #inputMode error
now issues a FatalError on duplicate entries
- #inputMode warn
issues a warning on duplicate entries, corresponds to the
old behaviour of 'error'
- #inputMode protect
prevents overwriting existing entries
The 'protect' mode provides a simple mechanism for supplying default values.
eg,
in file1:
#inputMode protect
intensity 0.1;
mixingLength 0.005;
#inputMode merge
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity $intensity;
}
which is included from file2:
intensity 0.05;
#include "file1"
- partial revert for commit d21869b580
* only add extra newlines for a top-level dictionary that is output as such
- make "#inputMode merge" the default instead of "#inputMode error"
* this corresponds to a very common usage case
* added '#remove' function
* changed insert() method name to more general execute()
* using #inputMode or #remove within a primitiveEntry now provokes an error
* adjusted the dictionaryTest accordingly