- This can be used as a convenient alternative to comparing against end().
Eg,
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodType);
if (cstrIter.found())
{
...
}
vs.
if (cstrIter != dictionaryConstructorTablePtr_->end())
{
...
}
- just check WM_PROJECT_DIR instead.
- provide a fallback value when FOAM_EXT_LIBBIN might actually be needed.
Only strictly need FOAM_EXT_LIBBIN for scotch/metis decomposition, and
when these are actually supplied by ThirdParty.
All other ThirdParty dependencies are referenced by BOOST_ARCH_PATH etc.
Can therefore drop the FOAM_EXT_LIBBIN dependency for VTK-related
things, which do not use scotch/metis anyhow.
- this implies that jobControl is a user-resource for OpenFOAM.
It was previously located under $WM_PROJECT_INST_DIR/jobControl,
but few users will have write access there.
- an unset FOAM_JOB_DIR variable is treated as "~/.OpenFOAM/jobControl",
which can partially reduce environment clutter.
- provide argList::noJobInfo() to conveniently suppress job-info on an
individual basis for short-running utilities (eg, foamListTimes) to
avoid unneeded clutter.
- ensure proper and sensible handling of empty names.
Eg, isDir(""), isFile("") are no-ops, and avoid file-stat
- rmDir:
* optional 'silent' option to suppress messages.
* removes all possible sub-entries, instead of just giving up on
the first problem encountered.
- reduced code duplication in etcFiles
ENH: provide WM_USER_RESOURCE_DIRNAME define (in foamVersion.H)
- this is still a hard-coded value, but at least centrally available
- the purpose is more explicit, without needing to check documentation
about what the bool parameter means.
STYLE: improve formatting of fileName documentation
- these are suitable for use with lambda functions.
- Deprecate the unused 3-parameter version of subset/inplaceSubset.
- Deprecate initList and initListList in favour of initializer_list
STYLE: adjust some comments, remove dead code in regionSizeDistribution.C
- Introduce writeList(Ostream&, label) method in various List classes to
provide more flexibility and avoid hard-coded limits when deciding if a
list is too long and should be broken up into multiple lines (ASCII only).
- The old hard-code limit (10) is retained in the operator<< versions
- This functionality is wrapped in the FlatOutput output adapter class
and directly accessible via the 'flatOutput()' function.
Eg,
#include "ListOps.H"
Info<< "methods: " << flatOutput(myLongList) << endl;
// OR
Info<< "methods: ";
myLongList.writeList(os) << endl;
- Constructs a validated word, in which all invalid characters have
been stripped out and any leading digit is '_'-prefixed.
Words with leading digits cause parse issues when read back later.
- Replaces previous functionally identical code from src/conversion
--
COMP: test against nullObject instead of checking address for null pointer.
- The code create a box with a (0,0,0) point.
The new definition is more logical and makes it very easy to grow
the bounding box to include new points. It also simplifies much of
the logic in the constructors.
- Use ROOTVGREAT instead of VGREAT for sizing greatBox and invertedBox.
Avoids some overflow issues reported by Mattijs (thus GREAT has been
used in treeBoundBox), but might still need further revision.
- Constructor for bounding box of a single point.
- add(boundBox), add(point) ...
-> Extend box to enclose the second box or point(s).
Eg,
bb.add(pt);
vs.
bb.min() = Foam::min(bb.min(), pt);
bb.max() = Foam::max(bb.max(), pt);
Also works with other bounding boxes.
Eg,
bb.add(bb2);
// OR
bb += bb2;
vs.
bb.min() = Foam::min(bb.min(), bb2.min());
bb.max() = Foam::max(bb.max(), bb2.max());
'+=' operator allows the reduction to be used in parallel
gather/scatter operations.
A global '+' operator is not currently needed.
Note: may be useful in the future to have a 'clear()' method
that resets to a zero-sized (inverted) box.
STYLE: make many bounding box constructors explicit
reduce()
- parallel reduction of min/max values.
Reduces coding for the callers.
Eg,
bb.reduce();
instead of the previous method:
reduce(bb.min(), minOp<point>());
reduce(bb.max(), maxOp<point>());
STYLE:
- use initializer list for creating static content
- use point::min/point::max when defining standard boxes
- to the referenced object via a method name, which may be clearer
than deferencing the iterator
[key, value] => iter.key(), *iter
[key, value] => iter.key(), iter()
[key, value] => iter.key(), iter.object()