- handles basic operations, references to other dictionary entries
(with '$name' syntax) and assorted mathematical functions:
pi(), degToRad, radToDeg, asin, acos, atan, sin, cos, tan, log,
log10, mag, atan2, pow
The basic syntax: #calc{ ... };
NOTE the trailing ';' is required for the primitiveEntry to be
properly defined.
- Previously had just 'Warning' instead of '::Foam::Warning', which
meant that an identically named class method would inadvertently be
used - resulting in a compile failure.
- forgot to use readList in removeEntry, which caused the test failure.
- remaining problem:
it doesn't work as might be expected
This is the problem:
dict
{
foo xxx;
bar yyy;
}
dict
{
baz zzz;
#remove foo
}
This only removes 'foo' from the current scope (the second dict), since
it occurs before the dictionary merge does.
To remove from the final, merged dictionary, we'd need a new
deleteEntry type that would do the right thing on the merge before
self-destructing (ie, removing itself too).
- 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
- added constructor dictionary(const dictionary*) that also handles NULL
pointers and makes it convenient to construct from a possibly nonexistent
sub-dictionary:
eg,
dictionary dict2(dict1.subDictPtr("someDict"));
- make some of the turbulence Coeffs sub-dictionary optional.
Their contents are all 'lookupOrAddDefault' anyhow.
- in turbulentMixingLength BCs, skip namespace qualifier in template
(eg, <RASModel> vs. <compressible::RASModel>)
- change comments from 'turbulenceProperties' to RASProperties/LESProperties
- consistency between compressible/incompressible - no separate file for
'New' selector etc
- consistency in accessing the model coefficients.
Use method coeffDict() for const access.
Use protected data member coeffDict_ for read/write access.
- document model coefficients in etc/constant/RASProperties.
Need the same for LESProperties before we can prune these from the
tutorials.
- #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"
- The capitalization is consistent with most other template classes, but
more importantly frees up xfer() for use as method name without needing
special treatment to avoid ambiguities.
It seems reasonable to have different names for transfer(...) and xfer()
methods, since the transfer is occuring in different directions.
The xfer() method can thus replace the recently introduced zero-parameter
transfer() methods.
Other name candidates (eg, yield, release, etc.) were deemed too abstract.
* 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