- identical to found(), which should be used for more consistency.
The contains() is a remnant from when hashedWordList was generalized
from a speciesTable (OCT 2010)
- provide a lookupOrDefault constructor form, since this is a fairly
commonly used requirement and simplifies the calling sequence.
Before
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
(
"rhoMax",
pimple.dict(),
dimDensity,
GREAT
)
);
After
dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict());
- read, readIfPresent methods with alternative lookup names.
- Mark the Istream related constructors with compile-time deprecated
warnings.
BUG: read, readIfPresent methods not handling optional dimensions (#1148)
- this scripts are largely pre-git era and not used much anymore.
Relocate to a legacy/ sub-directory while we see if there are
actually any still being used.
- the utility had automatic triangulation removed some time ago, but
never changed its name.
- catch old uses with a surfaceMeshTriangulate deprecated script
- can be used as a more natural test on the iterator.
For example, with
HashTable<..> table;
auto iter = table.find(...);
Following are now all equivalent:
1. if (iter != table.end()) ...
2. if (iter.found()) ...
3. if (iter) ...
- similar to autoPtr and unique_ptr. Returns the pointer value without
any checks. This provides a simple way for use to use either
an autoPtr or a tmp for local memory management without accidentally
stealing the pointer.
Eg,
volVectorField* ptr;
tmp<volVectorField> tempField;
if (someField.valid())
{
ptr = someField.get();
}
else
{
tempField.reset(new volVectorField(....));
ptr = tmpField.get();
}
const volVectorField& withField = *ptr;
STYLE: make more tmp methods noexcept
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
Averages columns of cells for layered meshes.
For each patch face, calculates the average value of all cells attached in
the patch face normal direction, and then pushes the average value back
to all cells in the column.
Useful for channel-like cases where we want to average fields in the
spanwise direction.
Example of function object specification:
columnAverage1
{
type columnAverage;
libs ("libfieldFunctionObjects.so");
...
patches (front side);
fields (U p);
}
Where the entries comprise:
\table
Property | Description | Required | Default value
type | type name: fieldMinMax | yes |
patches | list of patches to collapse onto | yes |
fields | list of fields to process | yes |
\endtable