- allows some internal handling for reading dissimilar storage types.
Eg, scalars written as float (WM_SP), but read as double (WM_DP)
- reading binary parcel coordinates with dissimilar storage types is
still pending
- change contiguous from a series of global functions to separate
templated traits classes:
- is_contiguous
- is_contiguous_label
- is_contiguous_scalar
The static constexpr 'value' and a constexpr conversion operator
allow use in template expressions. The change also makes it much
easier to define general traits and to inherit from them.
The is_contiguous_label and is_contiguous_scalar are special traits
for handling data of homogeneous components of the respective types.
- in addition to m() and n(), provide Matrix mRows()/nRows(), nCols()
methods. These provide unambiguous access names.
'mRows()' == for internal consistency with MatrixSpace.
'nRows()' == a commonly used naming.
- with 1906, OpenFOAM is purely C++ code and the last toolchain bits C
code have been avoided. Thus relax the wmake C rule for including
WM_COMPILE_OPTION. This makes it much easier to add different
compiler options with fewer files.
For example, for Broadwell-specific options:
cd wmake/rules/linux64Gcc
cp c++Opt c++OptBdw
edit this file and then use WM_COMPILE_OPTION=OptBdw
- ensure that WM_COMPILE_OPTION is always non-empty
- a top-level cloud::nParcels() virtual, which is overloaded by the
first level of Cloud inheritance. This permits quick determination of
cloud sizes, even when retrieved from registry with the base level.
Eg,
cloud* cldPtr = mesh.cfindObject<cloud>("myCloud");
label nParcels = (cldPtr ? cldPtr->nParcels() : 0);
- make writeLagrangianPositions on by default unless explicitly
disabled in the InfoSwitches.
Flag output errors (where neither coordinates nor positions are
written) with Fatal.
- additional IOField helper functions in cloud
STYLE: simplify iterator inheritance
- can now specify literal matches for sub-dictionary methods:
isDict(key, keyType::REGEX)
optionalSubDict(key, keyType::REGEX)
subDict(key, keyType::REGEX)
subOrEmptyDict(key, keyType::REGEX, mandatory)
There is no change in behaviour of the methods, just the search option
is now exposed as an optional parameter.
NOTE: minor breaking change for subOrEmptyDict()
old: subOrEmptyDict(key, bool=false)
new: subOrEmptyDict(key, keyType::option=keyType::REGEX, bool=false)
This affects code that previously explicitly set the bool parameter.
Within OpenFOAM itself, this only affected a single file:
KinematicCloud.C
- this is principally for cases where reduced indentation is desired,
such as when streaming to a memory location. If the indentation size
is zero or one, only a single space will be used to separate the
key/value.
This change does not affect the stream allocation size, since the
extra data falls within the padding.
ENH: relocate label/scalar sizes from Istream to IOstream.
- could allow future use for output streams as well?
Due to padding, reorganization has no effect on allocated size
of output streams.
STYLE: add read/write name qualifier to beginRaw, endRaw
- removes ambiguity for bi-directional streams
STYLE: fix inconsistent 'const' qualifier on std::streamsize
- base Ostream was without const, some derived streams with const
- allows full recovery of allocated space, not just addressable range.
This can be particularly useful for code patterns that repeatedly
reuse the same buffer space. For example,
DynamicList<char> buf(1024);
// some loop
{
OListStream os(std::move(buf));
os << ...
os.swap(buf);
}
Can read back from this buffer as a second operation:
{
UIListStream is(buf);
is >> ...
}
- When building OpenFOAM for different platform combinations
(single/double, int32/int64) the build information that is compiled
into the OpenFOAM lib can become out of sync.
This is because the update trigger (wmakeBuildInfo -check) is
independent of the targetted platform. The added file
'src/OpenFOAM/Alltouch' provides a direct means of forcing a rebuild
of the version information. Eg,
src/OpenFOAM/Alltouch
wmake src/OpenFOAM
Also provide an additional 'wmakeBuildInfo -remove' to forcibly
remove META-INFO/build-info, if that is desired.
- symmetric with writeRaw() etc for the output stream. These are
methods that are not required by normal users, but which provide
a finer granularity for reading.
- additional information about the current stream position when
endList fails. This may help when tracing errors.
STYLE: change return type of beginRaw()/endRaw() to bool
- was of type Ostream& for output, but return value was unused.
Having bool may be better for encapsulating logic
STYLE: remove unused Istream::readEndBegin() function
- in InterfaceCompositionPhaseChangePhaseSystem, the mass transfer
rates are updated as a side-effect of the massTransfer() method,
which makes these fields non-const.