- on large memory systems (eg, 6TB) the process information
exceeds an 'int' range, so adjust parsing of the /proc/..
to use int64
ENH: update/modernize OSspecific system information
ENH: minor update of profiling code
- std::string, noexcept, lazier evaluations
STYLE: use direct call of memInfo
- static version of polyMesh::meshDir(), which takes a region name
polyMesh::meshDir(regionName)
vs
polyMesh::regionName(regionName)/polyMesh::meshSubDir
STYLE: use polyMesh::regionName(..) instead of comparing to defaultRegion
STYLE: use getOrDefault when retrieving various -region options
FIX: polyMesh::dbDir() now checks registry name, not full path (#3033)
- in most cases a parallel-consistent order is required.
Even when the order is not important, it will generally require
fewer allocations to create a UPtrList of entries instead of a
HashTable or even a wordList.
- this complements the whichPatch(meshFacei) method [binary search]
and the list of patchID() by adding internal range checks.
eg,
Before
~~~~~~
if (facei >= mesh.nInternalFaces() && facei < mesh.nFaces())
{
patchi = pbm.patchID()[facei - mesh.nInternalFaces()];
...
}
After
~~~~~
patchi = pbm.patchID(facei);
if (patchi >= 0)
{
...
}
- skip loading of fields with -no-internal, -no-boundary
- suppress reporting fields with -no-internal, -no-boundary
- cache loaded volume field for reuse with point interpolation.
Trade off some memory overhead against reading twice.
NOTE: this issue will not be evident with foamToEnsight since there
it only handles cell data *or* point data (not both), so a field is
only ever loaded/processed once.
- since ensight format is always float and also always written
component-wise, perform the double -> float narrowing when
extracting the components. This reduces the amount of data
transferred between processors.
ENH: avoid vtk/ensight parallel communication of empty messages
- since ensight writes by element type (eg, tet, hex, polyhedral) the
individual written field sections will tend to be relatively sparse.
Skip zero-size messages, which should help reduce some of the
synchronization bottlenecks.
ENH: use 'data chunking' when writing ensight files in parallel
- since ensight fields are written on a per-element basis, the
corresponding segment can become rather sparsely distributed. With
'data chunking', we attempt to get as many send/recv messages in
before flushing the buffer for writing. This should make the
sequential send/recv less affected by the IO time.
ENH: allow use of an external buffer when writing ensight components
STYLE: remove last vestiges of autoPtr<ensightFile> for output routines
- include -no-libs option by default, similar to '-lib',
which makes it available to all solvers/utilities.
Add argList allowLibs() method to query it.
- relocate with/no functionObjects logic from Time to argList
itself as argList allowFunctionObjects()
- add libs/functionObjects override handling to decomposePar etc
ENH: report the stream relativeName for IOerrors (see c9333a5ac8)
- consistent with defining IO of int32_t/int64_t and with recent
changes to ensightFile. Using the primitives directly instead of
typedefs to them makes the code somewhat less opaque.
- in various situations with mesh regions it is also useful to
filter out or remove the defaultRegion name (ie, "region0").
Can now do that conveniently from the polyMesh itself or as a static
function. Simply use this
const word& regionDir = polyMesh::regionName(regionName);
OR mesh.regionName()
instead of
const word& regionDir =
(
regionName != polyMesh::defaultRegion
? regionName
: word::null
);
Additionally, since the string '/' join operator filters out empty
strings, the following will work correctly:
(polyMesh::regionName(regionName)/polyMesh::meshSubDir)
(mesh.regionName()/polyMesh::meshSubDir)
- previously filtered on the existence of area fields, but with
faMesh::TryNew this is not required anymore.
STYLE: enable -verbose for various parallel utilities (consistency)
- specifies the number of consecutive cells to assign to the same
randomly chosen processor. Can be used to have a less extremely
random distribution for testing possible breaking points.
Eg,
method random;
coeffs
{
agglom 4;
}
- Add finiteArea cellID (actually face ids) / faceLabel and procID
for foamToVTK with -write-ids. Useful when this type of information
is needed.
- bundles frequently used 'gather/scatter' patterns more consistently.
- combineAllGather -> combineGather + broadcast
- listCombineAllGather -> listCombineGather + broadcast
- mapCombineAllGather -> mapCombineGather + broadcast
- allGatherList -> gatherList + scatterList
- reduce -> gather + broadcast (ie, allreduce)
- The allGatherList currently wraps gatherList/scatterList, but may be
replaced with a different algorithm in the future.
STYLE: PstreamCombineReduceOps.H is mostly unneeded now
- also disables PointData if manifold cells are detected.
This is a partial workaround for volPointInterpolation problems
with handling manifold cells.
- additional verbosity option for conversions
- ignore old `-finite-area` option and always convert available
finiteArea mesh/fields unless `-no-finite-area` is specified (#2374)
ENH: simplify point offset handling for ensight output
- extend writing to include compact face/cell lists
- a try/catch approach is not really robust enough (or even possible)
since read failures likely do not occur on all ranks simultaneously.
This leads to situations where the master has thrown an exception
(and thus exiting the current routine) while other ranks are still
waiting to receive data and the program blocks completely.
Since this primarily affects data conversion routines such as
foamToEnsight etc, treat similarly to lagrangian: check for the
existence of essential files before proceeding or not. This is
wrapped into a TryNew factory method:
autoPtr<faMesh> faMeshPtr(faMesh::TryNew(mesh));
if (faMeshPtr) ...
- set() was silently deprecated in favour of reset() FEB-2018
since the original additional check for overwriting an existing
pointer was never used. The reset(...) name is more consistent
with unique_ptr, tmp etc.
Now emit deprecations for set().
- use direct test for autoPtr, tmp instead of valid() method.
More consistent with unique_ptr etc.
STYLE: eliminate redundant ptr() use on cloned quantities
- previously used an indirect patch to get the sampling locations,
but this doesn't take account of the face flips. Now use
the faceZone intrinsic for generating a properly flipped patch
and provide the sampling locations separately.
STYLE: adjust compatiblity header for surfaceMeshWriter
- improved separation of patch creation that is also parallel-aware,
which now allows creation in parallel
- memory-safe use of PtrList for adding patches, with a more generalized
faPatchData helper
- use uindirectPrimitivePatch instead of indirectPrimitivePatch
for internal patch handling.
- align boundary methods with polyMesh equivalents
- system/faMeshDefinition instead of constant/faMesh/faMeshDefinition
as per blockMesh convention. Easier to manage definitions, easier
for cleanup.
- drop inheritence from GeoMesh.
- reduces code, simplifies creation of new, specialized polyData
writers.
- new templated vtk::GenericPatchWriter, which adds support for
writing both uindirectPrimitivePatch + indirectPrimitivePatch types.
- handle geometric fields separately from regular fields with
* vtk:GenericPatchGeoFieldsWriter
* vtk:indirectPatchGeoFieldsWriter
* vtk:uindirectPatchGeoFieldsWriter
Step 1.
include "addAllRegionOptions.H"
Adds the -allRegions, -regions and -region options to argList.
Step 2.
include "getAllRegionOptions.H"
Processes the options with -allRegions selecting everything
from the regionProperties.
OR use -regions to specify multiple regions (from
regionProperties), and can also contain regular expressions
OR use the -region option
Specifying a single -regions NAME (not a regular expresssion)
is the same as -region NAME and doesn't use regionProperties
Creates a `wordList regionNames`
Step 3.
Do something with the region names.
Either directly, or quite commonly with the following
include "createNamedMeshes.H"
Creates a `PtrList<fvMesh> meshes`
STYLE: add description to some central include files
- wrap command-line retrieval of fileName with an implicit validate.
Instead of this:
fileName input(args[1]);
fileName other(args["someopt"]);
Now use this:
auto input = args.get<fileName>(1);
auto other = args.get<fileName>("someopt");
which adds a fileName::validate on the inputs
Because of how it is implemented, it will automatically also apply
to argList getOrDefault<fileName>, readIfPresent<fileName> etc.
- adjust fileName::validate and clean to handle backslash conversion.
This makes it easier to ensure that path names arising from MS-Windows
are consistently handled internally.
- dictionarySearch: now check for initial '/' directly instead of
relying on fileName isAbsolute(), which now does more things
BREAKING: remove fileName::clean() const method
- relying on const/non-const to control the behaviour (inplace change
or return a copy) is too fragile and the const version was
almost never used.
Replace:
fileName sanitized = constPath.clean();
With:
fileName sanitized(constPath);
sanitized.clean());
STYLE: test empty() instead of comparing with fileName::null
- simplifies local toggling.
- centralize fileModification static variables into IOobject.
They were previously scattered between IOobject and regIOobject
- direct check of punctuation.
For example,
while (!tok.isPunctuation(token::BEGIN_LIST)) ..
instead of
while (!(tok.isPunctuation() && tok.pToken() == token::BEGIN_LIST)) ..
Using direct comparison (tok != token::BEGIN_LIST) can be fragile
when comparing int values:
int c = readChar(is);
while (tok != c) .. // Danger, uses LABEL comparison!
- direct check of word.
For example,
if (tok.isWord("uniform")) ..
instead of
if (tok.isWord() && tok.wordToken() == "uniform") ..
- make token lineNumber() a setter method
ENH: adjust internal compound method empty() -> moved()
- support named compound tokens
STYLE: setter method for stream indentation
- the problem arises when output fields are missing on some
processors.
When the information is combined, the resulting HashTables can have
different insertion orders. This poses an issue when there are hash
key collisions and thus different chaining.
- Use sorted order.