- for OpenFOAM-v2212 and earlier cellPoints() were constructed
from pointCells(), but this is slower than constructing
pointCells() from cellPoints().
Some of the slowness is due to allocations associated with
cells::labels(), but a large amount of slowness is the duplicate
point avoidance. Since this is being done for many points/cells
at once, using a bitSet for managing the duplicates amortizes
quickly
- now construct cellPoints() from cached pointCells(), otherwise
construct manually (using bitSet/DynamicList for bookkeeping)
- construct pointCells() from cached cellPoints(), or cached
pointFaces(), otherwise manually.
Code Contribution: Alon Zameret
Co-authored-by: Mark Olesen
- interpret as '-decomposeParDict xyz' for simpler scripting:
A empty value ("") as well as "none" or "false" values are ignored.
Eg,
unset decompDict
if some_condition; then decompDict=decomposeParDict-12; fi
runParallel -decompose-dict=$decompDict ...
ENH: more generous when scanning decomposeParDict for numberOfSubdomains
- assume file is in system/ directory if not otherwise found
- useful when regular contents are to be read via an IOobject and
returned.
Eg, dictionary propsDict(IOdictionary::readContents(dictIO));
vs. dictionary propsDict(static_cast<dictionary&&>(IOdictionary(dictIO)));
Commonly these would have simply been constructed directly as the
IO container:
eg, IOdictionary propsDict(dictIO);
However, that style may not ensure proper move semantics for return
types.
Now,
=====
labelList decomp(labelIOList::readContents(io));
... something
return decomp;
=====
Previously,
=====
labelIOList decomp(io);
// Hope for the best...
return decomp;
// Or be explicit and ensure elision occurs...
return labelList(std::move(static_cast<labelList&>(decomp)));
=====
Note:
labelList list(labelIOList(io));
looks like a good idea, but generally fails to compile
- the iterator/const_iterator now skip any nullptr entries,
which enables the following code to work even if the PtrList
contains nullptr:
for (const auto& intf : interfaces)
{
// Do something
...
}
- this is a change in behaviour compared to OpenFOAM-v2212 and earlier,
but is non-breaking:
* Lists without null entries will traverse exactly as before.
* Lists with null entries will now traverse correctly without
provoking a FatalError.
- allows unambiguous of count() for other classes.
Naming as per std::shared_ptr.
STYLE: qualify use_count() and unique() methods with the refCount base
- clearer/consistent meaning
- the null output adapter was previously used for the HashTables API
when HashSet actually stored key/value. Now that the node only
contains the key, having suppressed output is redundant, as is the
zero::null class (reduces clutter)
STYLE: replace one::minus dispatch in extendedEdgeMesh
GIT: remove Foam::nil typedef (deprecated since May-2017)
ENH: add pTraits and IO for std::int8_t
STYLE: cull some implicitly available includes
- pTraits.H is included by label/scalar etc
- zero.H is included by UList
STYLE: cull redundant forward declarations for Istream/Ostream
- in earlier versions: used 'fixed' notation
to force floating point numbers to be printed with at least
some decimal digits. However, in the meantime we are more
flexible with handling float/int input so remove this constraint.
- use ITstream::toString, which makes the string expansion of ${var}
and the expression expansion of $[var] consistent.
- other systems (eg, ARM64 linux with clang) do not have a separate
mpfr library configured so also check for mpfr (gmp is assumed to be
the same) and return corresponding cgal flavour (eg, header-no-mpfr)
Note:
in some borderline cases (eg, PDRFoam) the multiplication order
and rounding imposed by the lerp function may affect the
results slightly.
eg, (valueFraction_ * this->patch().deltaCoeffs()*refValue_)
vs. (valueFraction_ * (this->patch().deltaCoeffs()*refValue_))
- defined for lerp between two fields,
either with a constant or a field of interpolation factors.
* plain Field, DimensionedField, FieldField, GeometricFields
- using a field to lerp between two constants is not currently
supported
- clearer, more consistent parameter naming, which helps when
maintaining different field function types (eg, DimensionedFields,
GeometricFields)
- provide reuseTmpGeometricField::New taking a reference (not a tmp),
with forwarding. This helps centralise naming and acquisition etc
- split binary function macros into transform/interface
for easier support of different transform loops.
- initial field macros for looping over ternaries
- newer naming allows for less confusing code.
Eg,
max(lower) -> clamp_min(lower)
min(upper) -> clamp_max(upper)
- prefer combined method, for few operations.
Eg,
max(lower) + min(upper) -> clamp_range(lower, upper)
The updated naming also helps avoid some obvious coding errors.
Eg,
Re.min(1200.0);
Re.max(18800.0);
instead of
Re.clamp_range(1200.0, 18800.0);
- can also use implicit conversion of zero_one to MinMax<Type> for
this type of code:
lambda_.clamp_range(zero_one{});
- this is slightly longer to write (but consistent with clamp_min
etc). The main reason is that this allows easier use of the clamp()
free function.
STYLE: skip checks for bad/invalid clamping ranges
- ranges are either already validated before calling, the caller logic
has already made the branching decision.
- run-time warning about deprecated features. For example,
DeprecatedInFunction(2212)
<< "Prefer using xyz boundary condition. "
<< "This boundary condition will be removed in the future." << endl;
CONFIG: mark exprFixedValue as deprecated
- same functionality is possible with uniformFixedValue and an
expression PatchFunction1, which can also be easily changed to any
other PatchFunction1