- makes fileHandler calling resemble Time more closely
ENH: provide natural_sort less/greater functions
- more succinct than (compare < 0) or (compare > 0).
The corresponding wrappers for UList renamed as list_less, etc
but they were only used in unit tests
ENH: handle (-allRegions | -all-regions, ..) directly when retrieving args
- makes handling independent of aliasing order
STYLE: include <string_view> when including <string>
- the standard does not guarantee which headers (if any) actually
include string_view
Ideally wish to delay construction of the finite-area mesh until
updateCoeffs(), when it is actually needed.
This helps avoid difficult to trace errors and avoids inadvertent
parallel communication during construction from a dictionary.
However, lazy evaluation fails at the later stage while attempting
to load the corresponding initial fields, since the timeIndex has
already advanced.
Use the newly introduced regionModels::allowFaModels() switch
to locally enable or disable lazy evaluation as needed.
This allows selective disabling (eg, in post-processing utilities)
where loading the volume field should not activate the associated
regionFaModel and loading a finite-area mesh too (which may not
exist or be defined at that point).
- less typing than before and avoids relying on bash-specific behaviour
(fixes#3448)
ENH: add -region support for cleanFaMesh and cleanPolyMesh
CONFIG: add bash completion help for -area-region
ENH: general improvements for regionProperties
- robustness and failsafe for foamListRegions, regionProperties
- additional global model switches for regionModels
- further hide implementation (cxx ending)
STYLE: better distinction between code/templates for fileFormats/conversion
- for ensight and vtk, a large part of the code is header only.
Make this easier to identify
- add provisional support for selecting MPI_Gatherv
when merging fields in the surface writers.
Uses the 'gatherv' keyword [experimental]
BUG: gatherv/scatterv wrappers used the incorrect data type
- incorrectly checked against UPstream_basic_dataType trait instead of
UPstream_dataType, which resulted in a count mismatch for
user-defined types (eg, vector, tensor,...).
This was not visibly active bug, since previous internal uses of
gatherv were restricted to primitive types.
COMP: make UPstream dataType traits size(...) constexpr
- allows static asserts and/or compile-time selection
of code based on size(1)
- for a non-default mesh region, corresponding files:
system/finite-area/faOptions.<name>
system/finite-area/<name>/faSchemes, etc
if the entries within the faOptions dictionary happen to contain an
"area" entry and it conflicts with what is expected, it will be
rejected when creating the list of options, which helps avoid
unexpected behaviour and simplifies overall handling.
- unlike fvMesh and polyMesh, the faMesh mesh region name is passed
separately into constructors and functions. Thus need the same for
faMeshTools and faMeshSubset.
- ensure that an empty area name is treated like
polyMesh::defaultRegion.
The faMeshRegistry or other registries cannot have an empty name!
- extend the getAllRegionOptions and getAllFaRegionOptions handling
to use the supplied string literals as fallback values.
If regionProperties is missing (or empty) and the -regions/-area-regions
option is supplied with literal names, these will be used directly
instead of being used to filter the regionProperties.
STYLE: support both -all-regions and -allRegions
- in some shell models, only the mechanical properties (rho,E,nu) are
meaningful or just the basic thermal properties
(rho,Cp,kappa,emissivity).
Add a distinction when reading the dictionary entries
if those properties are mandatory and the thermo properties
(eg, molWt, Cp, etc) are optional or not.
This simplifies user input for thermal and vibration shell models.
- activeRequest() checks if given request is still active/pending
- finishedRequest() will now always call MPI_Test when running in
parallel instead of using a fast-path for skipping a null request.
This allows MPI a chance to progress operations even if that
particular request is not active.
- sameProcs() is a convenience wrapper for the following:
* check if indices resolve to the same underlying procs
* check the communicator procs against a list of procs
* to compare two lists of procs.
For example, check if the communicator corresponds to a
host-local communication:
if (UPstream::sameProcs(UPstream::commLocalNode(), myComm)) ...
STYLE: UPstream::Request gets an 'active()' method
- more MPI idiomatic than 'good'
- to avoid the many overload warnings on that platform,
may wish to use
FOAM_EXTRA_CXXFLAGS="-Wno-overloaded-virtual"
GIT: remove some old compilation stub files
- adjust the if/else-if/else-if cascade to have 'if constexpr (..)'
first and the *entire* alternate branch within the following 'else'.
This lets the compiler know that it can safely discarded the other
parts.
This change introduces a large amount of indentation change,
so use `--ignore-space-change` when inspecting.
COMP: reintroduce UList<T>() initialization in List [silence gcc]
COMP: use std::min() instead of direct check [silence gcc]
- gcc complains about possible strict-overflow for this:
```
if (count > len)
{
count = len; // The count truncated by the new length
}
```
Using `count = std::min(count, len);` avoids these (spurious)
warnings without adding a "diagnostic ignored" pragma
STYLE: pass std::pair<int,int> by copy [cheaper]
STYLE: make isdigit() and isspace() tests constexpr
- constexpr and C-locale only vs. the std counterparts
- extend time searching mechanisms to support searching in the case
global path: times(), findClosestTime(), findInstancePath()
- extend IOobject path() and objectPath() methods with
IOobjectOption::Layout variants
The changes are needed for addressing a global file structure
in parallel (#3431)
- add '<=' and '>=' operators that include rounding.
This means that typical code like the following would not have
considered any rounding:
instantList times = ...;
scalar val = ..;
// No rounding!
if (times[i].value() <= val) { ... }
// NEW: with rounding
if (times[i] <= val) { ... }
// old equivalent:
if (times[i].value() <= val || times[i].equal(val)) { ... }
ENH: provide a default stopInstance for fileOperation::findInstance
- makes it more consistent with Time::findInstance and more convenient
to use
STYLE: minor code style changes to TimePaths etc
- enables partial overwriting of content
- make default construct zero-sized, add reserve_exact() method
- improve sizing behaviour of OCharStream.
Since char buffers will approach the INT_MAX size more quickly than
other content, adapt the following strategy:
| Capacity range | Strategy |
|--------------------|------------------------------|
| 0 < N <= 0.25) | fast growth (2) |
| 0.25 < N <= 0.5) | slower growth (1.5) |
| 0.5 < N <= 0.75) | very slow growth (1.25) |
| 0.75 < N | already large - use max |
- improves usability of List as a general dynamic container as member
data without inheritance. Provide the same method for DynamicList
to enable more efficient use.
- additional string_view support for charList: useful when being used
as a character buffer
STYLE: improve allocation handling in List
- consolidate routines. Only assign size after allocation to ensure
that states are always consistent.
- make memory streams header-only (simpler)
- add sub-views and direct seek for span streams
New IOobject convenience methods
- IOobject::instanceValue() : return the IOobject instance as a scalar
value (or 0). Effectively the same as instant(io.instance()).value()
but with far less typing.
- IOobject::fileModificationChecking_masterOnly() : combines checks for
time-stamp and inotify variants
STYLE: minor adjustments for Enum
- can now create an empty entry and add/overwrite with tokens afterwards,
or copy/move construct from a list of tokens.
ENH: provided named token setter methods (disambiguates bool/char/label)
COMP: use 'if constexpr' for FlatOutput
DOC: more description for Field