- 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
- 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)
- 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)
- 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
- 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
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
- Favour use of argList methods that are more similar to dictionary
method names with the aim of reducing the cognitive load.
* Silently deprecate two-parameter get() method in favour of the
more familiar getOrDefault.
* Silently deprecate opt() method in favour of get()
These may be verbosely deprecated in future versions.
- includes restructuring and simplification of low-level ensight part
handling and refactor of backends to improve code reuse.
foamToEnsight
-------------
* new cellZone support.
This was previously only possible via a separate foamToEnsightParts
utility that was not parallelized.
* support for point fields.
* `-nearCellValue` option (as per foamToVTK)
* data indexing now uses values from the time index.
This is consistent with the ensightWrite function object and
can help with restarts.
* existing ensight directories are removed, unless the -no-overwrite
option is supplied
foamToEnsightParts
------------------
* now redundant and removed.
ensightOutputSurface (new class)
--------------------------------
* a lightweight wrapper for point/face references that is tailored
for the ensightSurfaceWriter. It uses compact face/point information
and is serial only, since this is the format requirements from the
surfaceWriter class.
ensightMesh (revised class)
---------------------------
* now only holds a polyMesh reference, which removes its dependency
on finiteVolume and allows it to be relocated under fileFormats
instead of conversion.
Removed classes: ensightParts, ensighPartFaces, ensightPartCells
- these were used by foamToEnsightParts, but not needed anymore.
- changed ensightOutput from a class solely comprising static methods to
a namespace and added in sub-namespaces Detail and Serial.
This makes it easier to "mix-in" functions at different levels.
Refactored and combined some serial/parallel code where possible.
The general ensightOutput namespace has now shifted to be in the
fileFormats lib, while leaving volField outputs in the conversion lib
and cloud outputs in the lagrangian-intermediate lib.
The ensightCloud namespace is now simply folded into the new
ensightOutput namespace.
These changes clean up some code, reduce fragmentation and
duplication and removes the previous libconversion dependency for
sampling.
- use int for ensight nTypes constexpr
Note: issue #1176 is unaffected except for the change in file name:
ensightOutputTemplates.C -> ensightOutputVolFieldTemplates.C
- change previous default (convert all faceZones unless -noFaceZones
specified) with the default behaviour to only convert face zones on
request.
- uses the '-faceZones' option as per foamToEnsight
- handle tmp fields in interpolate methods
- special method interpolateInternal() for creating a volume field
with zero-gradient treatment for patches from an internal field.
This method was previously also called interpolate(), but that
masked the ability to subset the internal field only.
Ensight output needs the volume field:
uses interpolateInternal().
VTK output has separate handling of internal and patch fields:
uses interpolate().
ENH: added fvMeshSubset mesh() method for baseMesh or subMesh.
- simplies coding when the fvMeshSubset may or may not be in active use.
ENH: update foamToEnsight to use newer methods in wrapped form
- static interpolate functions with renaming for manual use with
fvMeshSubset (when fvMeshSubsetProxy may be too limiting in
functionality)
General:
* -roots, -hostRoots, -fileHandler
Specific:
* -to <coordinateSystem> -from <coordinateSystem>
- Display -help-compat when compatibility or ignored options are available
STYLE: capitalization of options text
- simplifies usage.
Support syncPar check on names() to detect inconsistencies.
- simplify readFields, ReadFields and other routines by using these
new methods.
- relocated HashSetPlusEqOp and HashTablePlusEqOp to
HashSetOps::plusEqOp and HashTableOps::plusEqOp, respectively
- additional functions for converting between a labelHashSet
and a PackedBoolList or List<bool>:
From lists selections to labelHashSet indices:
HashSetOps::used(const PackedBoolList&);
HashSetOps::used(const UList<bool>&);
From labelHashSet to list forms:
PackedBoolList bitset(const labelHashSet&);
List<bool> bools(const labelHashSet&);
- problems when the cloud was not available on all processors.
- NB: ensight measured data only allows a single cloud, but
foamToEnsight writes all clouds.
- use succincter method names that more closely resemble dictionary
and HashTable method names. This improves method name consistency
between classes and also requires less typing effort:
args.found(optName) vs. args.optionFound(optName)
args.readIfPresent(..) vs. args.optionReadIfPresent(..)
...
args.opt<scalar>(optName) vs. args.optionRead<scalar>(optName)
args.read<scalar>(index) vs. args.argRead<scalar>(index)
- the older method names forms have been retained for code compatibility,
but are now deprecated
- manifest in some parallel operations.
STYLE: update foamToEnsight, foamToEnsightParts to use C++ initializer_list
- avoid warning message when removing a non-existent directory (ensight output).
- eliminate ensightAsciiStream, ensightBinaryStream, ensightStream in
favour of using ensightFile and ensightGeoFile classes throughout.
- encapsulate mesh-parts sorting with the ensightCells, ensightFaces
class.
- handle of patches/faceZones entirely within ensightMesh for a lighter
interaction with field output. Both faceZones and point fields need
more testing to see if they behave properly for all cases.
- move some output functionality into its own namespace
'ensightOutput', move into a library.
- use the ensightCase class to open new ensight output streams
in the proper sub-directory locations.
- Less looping when detecting lagrangian clouds and their fields.
- Avoid using Time::setTime() and IOobjectList in tight loops.
They both kill performance immensely.
ENH: provide a -noLagrangian option to foamToEnsight and foamToEnsightParts
for even more control.
Old code:
Found 10990 time steps
Search for moving mesh ... no moving mesh detected.
Startup in 329.09 s
Updated:
Found 10990 time steps
Search for moving mesh ... no moving mesh detected.
Startup in 1.6 s
- Cause was checking "polyMesh/points" via an IOobject.
Short-circuit with a check for a polyMesh/ directory first.
Limit the check to the master-node as well to further reduce
load on the file-system.
------------------------------
ENH: improve per-step conversion times for foamToEnsight.
Old code:
Converting 11001 time steps
Time [0] = 0 Wrote in 1.53 s
Time [1] = 1 Wrote in 1.52 s
...
Time [100] = 100 Elapsed time 205.35 s
Updated:
Converting 11001 time steps
Time [0] = 0 Wrote in 1.4 s
Time [1] = 1 Wrote in 0.07 s
...
Time [100] = 100 Elapsed time 42.4 s
- Speedup by hashing test results from the first conversion step
instead of checking each time.
Check data on all nodes to avoid problems with incomplete writes.
------------------------------
BUG: moving mesh detection failed for foamToEnsightParts
- adjusted to agree with updated foamToEnsight
------------------------------
Note:
- foamToEnsightParts (serial) still has about twice the throughput of
foamToEnsight.
- Default is a width of 8 characters, but this can be extended up to 31
characters via the '-width' command-line option.
- Now use a similar structure as foamToEnsightParts for the masking.
This reduces the clutter within the directory, makes it easier to
selectively delete some time steps (using shell commands).
- Added in a "time" information data in each sub-directory to
make it possible to reconstruct the case file with an external
script.
- Conversion of cloud data should now also work in parallel
(may need more testing).
- Support binary output for cloud data.
- Better avoidance of illegal ensight variable names.
But still partially incomplete (due to patch fields).
==================================================
Example of NEW file structure:
EnSight/verticalChannel.case # case name
EnSight/geometry # for non-moving geometry
EnSight/data/ # time-varying data
EnSight/data/00000000/
EnSight/data/00000001/
...
Fields are stored by name within the data/********/ directories:
EnSight/data/00000001/time # human-readable time info
EnSight/data/00000001/U
EnSight/data/00000001/p
...
EnSight/data/00000001/geometry # for moving geometry
Clouds are stored at the next sub-directory level:
EnSight/data/00000001/lagrangian/<cloudName>/positions
EnSight/data/00000001/lagrangian/<cloudName>/U
...
==================================================
The old structure was significantly more cluttered:
EnSight/verticalChannel.case
EnSight/verticalChannel.0000.mesh
EnSight/verticalChannel.0001.p
EnSight/verticalChannel.0001.<cloudName>
EnSight/verticalChannel.0001.<cloudName>.U
==================================================