- The logic for switching input-mode was previously completely
encapsulated within the #inputMode directive, but without any
programming equivalent. Furthermore, the encapsulation in inputMode
made the logic less clear in other places.
Exposing the inputMode as an enum with direct access from entry
simplifies things a fair bit.
- eliminate one level of else/if nesting in entryIO.C for clearer logic
- for dictionary function entries, simply use
addNamedToMemberFunctionSelectionTable() and avoid defining a type()
as a static. For most function entries the information is only used
to get a name for the selection table lookup anyhow.
- similar to the #include directive, but does not generate an error if the
file does not exist.
Note: opted for an explicit naming #includeIfPresent rather than #cinclude
- #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