- return internalEdges() and boundaryEdges() sub lists directly
- calculate and return boundaryFaces() to identify faces attached to
boundary edges.
- minor code cleanup, and add PrimitivePatchBase class for
non-templated code.
STYLE: mark unused parameter in globalMeshData mergePoints
- additional dummy template parameter to assist with supporting
derived classes. Currently just used for string types, but can be
extended.
- provide hash specialization for various integer types.
Removes the need for any forwarding.
- change default hasher for HashSet/HashTable from 'string::hash'
to `Hash<Key>`. This avoids questionable hashing calls and/or
avoids compiler resolution problems.
For example,
HashSet<label>::hasher and labelHashSet::hasher now both properly
map to Hash<label> whereas previously HashSet<label> would have
persistently mapped to string::hash, which was incorrect.
- standardize internal hashing functors.
Functor name is 'hasher', as per STL set/map and the OpenFOAM
HashSet/HashTable definitions.
Older code had a local templated name, which added unnecessary
clutter and the template parameter was always defaulted.
For example,
Old: `FixedList<label, 3>::Hash<>()`
New: `FixedList<label, 3>::hasher()`
Unchanged: `labelHashSet::hasher()`
Existing `Hash<>` functor namings are still supported,
but deprecated.
- define hasher and Hash specialization for bitSet and PackedList
- add symmetric hasher for 'face'.
Starts with lowest vertex value and walks in the direction
of the next lowest value. This ensures that the hash code is
independent of face orientation and face rotation.
NB:
- some of keys for multiphase handling (eg, phasePairKey)
still use yet another function naming: `hash` and `symmHash`.
This will be targeted for alignment in the future.
- currently add to mesh zones to provide a table of contents
of the zone names that allows downstream consumers quick access to
the information without needing to parse the entire file.
- support selective enable/disable of the file banner.
ENH: improve code isolation for decomposedBlockData
- use readBlockEntry/writeBlockEntry to encapsulate the IO handling,
which ensures more consistency
- new decomposedBlockData::readHeader for chaining into the
block header information.
- remove unused constructors for decomposedBlockData
ENH: minor cleanup of collated fileOperations
- read/write lists of character data in binary only.
This is the only means of preserving data.
If character data are written as an ASCII list, there is no means of
determining if spaces or newlines are content or separators.
- centralises existing functions (erfInv, incGamma*, invIncGamma*).
Provides a location for additional functions in the future.
- adjusted existing models to use these functions
(e.g. distributionModels::normal)
- easier support for non-mandatory functions.
In some boundary conditions it can be desirable to support
additional functions, but not necessarily require them. Make this
easier to support with a Function1, PatchFunction1 NewIfPresent()
selector.
- support for compatibility lookups
- harmonize branching logic and error handling between Function1 and
PatchFunction1.
ENH: refactor a base class for Function1, PatchFunction1
- includes base characteristics, patch or scalar information
ENH: additional creation macros
- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
non-templated function into the correct templated selection table.
makeScalarPatchFunction1 for similarity with makeScalarFunction1
- add reverse iterators and replace std::iterator
(deprecated in C++17) with full definitions
- simplify construction of iterators
- construct labelRange from a single single parameter.
This creates a (0,len) range.
- make basic constructors forms constexpr.
Remove unused size checks.
- Derive labelRange from new IntRange template class.
Allows reuse of base functionality with different integral sizes.
Deprecations:
- deprecate labelRange::valid() in favour of using
labelRange::empty() or the bool operator.
For example,
if (range) ... vs older if (range.valid()) ...
DEFEATURE: drop labelRange::null, scalarRange::null static variables
- turned out to be not particularly useful.
Can simply use constexpr contructor forms
DEFEATURE: drop labelRange::identity static method
- simply use the single-parameter constructor
- previously hidden as Detail::[IO]FstreamAllocator, now exposed
directly as [io]fstreamPointer, which allows reuse for
std::ifstream, std::ofstream wrapping, without the additional
ISstream, OSstream layers.
These stream pointers have some characteristics similar to a
unique_ptr.
- restrict direct gzstream usage to two files (fstreamPointers.C,
gzstream.C) which improves localization and makes it simpler to
enable/disable with the `HAVE_LIBZ` define.
The HAVE_LIBZ define is currently simply hard-coded in the
Make/options.
If compiled WITHOUT libz support:
- reading gz files : FatalError
- writing gz files : emit warning and downgrade to uncompressed
- warn if compression is specified in the case controlDict
and downgrade to uncompressed
ENH: minor updates to gzstream interface for C++11
- support construct/open with std::string for the file names.
CONFIG: provisioning for have_libz detection as wmake/script
- mostly wraps std::chrono so can inline much of it, which is potentially
helpful when used for inner timings.
- add elapsedTime() method for direct cast to double and for
naming similarity with wall-clock method.
Potential breaking change (minor):
- clockValue construct with a bool parameter is now simply tagged
dispatch (value is ignored) and always queries the current clock
value. This avoids needless branching.
Since this constructor form has primarily been used internally (eg,
clockTime), breakages in user code are not expected.
- was in surfMesh/triSurface/patches/
now in OpenFOAM/meshes/Identifiers/surface/
This places the code closer to other identifier classes,
which aids in maintaining consistency
- replace stringOps::toScalar with a more generic stringOps::evaluate
method that handles scalars, vectors etc.
- improve #eval to handle various mathematical operations.
Previously only handled scalars. Now produce vectors, tensors etc
for the entries. These tokens are streamed directly into the entry.
- ITstream append() would previously have used the append from the
underlying tokenList, which leaves the tokenIndex untouched and
renders the freshly appended tokens effectively invisible if
interspersed with primitiveEntry::read() that itself uses tokenIndex
when building the list.
The new append() method makes this hidden ITstream bi-directionality
easier to manage. For efficiency, we only append lists
(not individual tokens) and support a 'lazy' resizing that allows
the final resizing to occur later when all tokens have been appended.
- The new ITstream seek() method provides a conveniently means to move
to the end of the list or reposition to the middle.
Using rewind() and using seek(0) are identical.
ENH: added OTstream to output directly to a list of tokens
---
BUG: List::newElem resized incorrectly
- had a simple doubling of the List size without checking that this
would indeed be sufficient for the requested index.
Bug was not triggered since primitiveEntry was the only class using
this call, and it added the tokens sequentially.
For example,
$ someSolver -info-switch writeOptionalEntries
- note that values changed via the command-line are changed after the
etc/controlDict entries, but *before* any case-local
system/controlDict entries.
However, in many testing cases the command-line options eliminate
the need for such local file modifications.
ENH: cleanup handling of local debug switches in Time
- add as methods directly on simpleObjectRegistry to avoid code
duplication
STYLE: adjust internal naming of ITstream parameters
- the #eval directive is similar to the #calc directive, but for evaluating
string expressions into scalar values. It uses an internal parser for
the evaluation instead of dynamic code compilation. This can make it
more suitable for 'quick' evaluations.
The evaluation supports the following:
- operations: - + * /
- functions: exp, log, log10, pow, sqrt, cbrt, sqr, mag, magSqr
- trigonometric: sin, cos, tan, asin, acos, atan, atan2, hypot
- hyperbolic: sinh, cosh, tanh
- conversions: degToRad, radToDeg
- constants: pi()
- misc: rand(), rand(seed)
- unfriend HashSet, HashTable IO operators
- global min(), max(), minMax() functions taking a labelHashSet and an
optional limit. For example,
labelHashSet set = ...;
Info<< "min is " << min(set) << nl;
Info<< "max (non-negative) " << max(set, 0) << nl;
- make HashTable iterator '->' dereferencing more consistent by also
supporting non-pointer types as well.
- read HashTable values in-situ to avoid copying
Integration of VOF MULES new interfaces. Update of VOF solvers and all instances
of MULES in the code.
Integration of reactingTwoPhaseEuler and reactingMultiphaseEuler solvers and sub-models
Updating reactingEuler tutorials accordingly (most of them tested)
New eRefConst thermo used in tutorials. Some modifications at thermo specie level
affecting mostly eThermo. hThermo mostly unaffected
New chtMultiRegionTwoPhaseEulerFoam solver for quenching and tutorial.
Phases sub-models for reactingTwoPhaseEuler and reactingMultiphaseEuler were moved
to src/phaseSystemModels/reactingEulerFoam in order to be used by BC for
chtMultiRegionTwoPhaseEulerFoam.
Update of interCondensatingEvaporatingFoam solver.
- this is somewhat like labelRange, but with a stride.
Can be used to define slices (of lists, fields, ..) or as a range specifier
for a for-loop. For example,
for (label i : sliceRange(0, 10, 3))
{
...
}
- operators are still incomplete, as are dimensioned fields,
field-fields etc.
- split complexFields into separate complexField, complexVectorField files
- new regExpCxx wrapper for C++11 regex support with drop-in
compatibility with existing code.
- regExpPosix (was regExp), for future phase out in favour of regExpCxx.
- The regExp header will continue to be used for defining an
appropriate typedef corresponding to the preferred implementation.
- remove unused and deprecated emptyList() casting function.
This function is disllowed by many modern compilers and is no longer
used within OpenFOAM - was deprecated 2018-07.
- the counterpart to floatVector, doubleTensor, which can be useful
for connecting to programs that always expect double precision for
the arguments, when using single-precision for OpenFOAM itself.
Eg,
doubleVector pos = ...;
vtkcamera->SetPosition(pos.v_);
- For compatibility, access to the old global names is provided via
macros
#define FOAMversion foamVersion::version
#define FOAMbuild foamVersion::build
#define FOAMbuildArch foamVersion::buildArch
- this isolation makes it easier to provide additional scoped methods
for dealing with version related information. Eg, printBuildInfo()
- generalize output text wrapping, use for usage notes
- add -help-man option for generating manpage content for any OpenFOAM
application or solver.
bin/tools/foamCreateManpage as helper
This fixes the static-initialisation order problem - fieldTypes.C
referes to labelIOField etc. which are after it in Make/files and
hence the link order.