- 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
==================================================
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
(e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
for fileModificationChecking manipulation.
- checkMesh has option to write faceSets or (outside of) cellSets as
sampledSurface format. It automatically reconstructs the set on the master
and writes it to the postProcessing folder (as any sampledSurface). E.g.
mpirun -np 6 checkMesh -allTopology -allGeometry -writeSets vtk -parallel
- fixed order writing of symmTensor in Ensight writers