- 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
- add writer support for VERTICES
- updated use of globalIndex
ENH: add base vtk writer for points/verts/lines
STYLE: noexcept, explicit constructors etc
- scene
- write with fileName, additional getMesh accessor
- addColourToMesh accepts an alpha field size 1 as a constant
alpha value
- sceneWriter wrapper
ENH: improve gltf handling of colour and alpha specification
- accept plain input directly.
Eg,
colour (1 0 1);
vs
colour uniform;
colourValue (1 0 1);
- use field magnitude for colouring of non-scalar fields.
Eg, having three different colour maps for a vector field simply
does not help much with visualisation.
- meshTools is the first layer in which coordSet is actually needed
STYLE: rename writer implementations in advance of upcoming changes (#2347)
- simplifies tracing of code changes (git blame)
- used low-level MPI gather, but the wrapping routine contains an
additional safety check for is_contiguous which is not defined for
various std::pair<..> combination.
So std::pair<label,vector> (which is actually contiguous, but not
declared as is_contiguous) would falsely trip the check.
Avoid by simply gathering unbundled values instead.
Description
Writes point data in glTF v2 format
Two files are generated:
- filename.bin : a binary file containing all scene entities
- filename.gltf : a JSON file that ties fields to the binary data
The output can contain both geometry and fields, with additional support
for colours using a user-supplied colour map, and animation of particle
tracks.
Controls are provided via the optional formatOptions dictionary.
For non-particle track data:
\verbatim
formatOptions
{
// Apply colours flag (yes | no ) [optional]
colours yes;
// List of options per field
fieldInfo
{
p
{
// Colour map [optional]
colourMap <colourMap>;
// Colour map minimum and maximum limits [optional]
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (uniform | field)
alpha uniform;
alphaValue 0.5;
//alpha field;
//alphaField T;
//normalise yes;
}
}
}
\verbatim
For particle tracks:
\verbatim
formatOptions
{
// Apply colours flag (yes | no) [optional]
colours yes;
// Animate tracks (yes | no) [optional]
animate yes;
// Animation properties [optional]
animationInfo
{
// Colour map [optional]
colourMap <colourMap>;
// Colour [optional] (uniform | field)
colour uniform;
colourValue (1 0 0); // RGB in range [0-1]
//colour field;
//colourField d;
// Colour map minimum and maximum limits [optional]
// Note: for colour = field option
// Uses field min and max if not specified
min 0;
max 1;
// Alpha channel [optional] (uniform | field)
alpha uniform;
alphaValue 0.5;
//alpha field;
//alphaField T;
//normalise yes;
}
}
\endverbatim
Note
When writing particle animations, the particle field and colour properties
correspond to initial particle state (first data point) and cannot be
animated (limitation of the file format).
For more information on the specification see
https://www.khronos.org/registry/glTF/
- this revises the changes made in 95cd8ee75c to replace the
SFINAE-type of handling of string hashes with direct definitions.
This places a bit more burden on the developer if creating hashable
classes derived from std::string or variants of Foam::string, but
improves reliability when linking.
STYLE: drop template key defaulting from HashSet
- this was never used and `HashSet<>` is much less transparent
than writing `HashSet<word>` or `wordHashSet`
- reuse single component buffer within an Ensight output method.
Use direct UPstream read/write to avoid Pstream char buffers
- replace blocking transfer with scheduled for Ensight cloud output
- previously returned the range slice as a UList,
but this prevents convenient assignment.
Apply similar handling for Field/SubField
Allows the following
labelRange range(...);
fullList.slice(range) = identity(range.size());
and
fullList.slice(range) = UIndirectList<T>(other, addr);
ENH: create SubList from full FixedList (simplifies interface)
- allow default constructed SubList. Use shallowCopy to 'reset' later
- simply adds in the reinterpret_cast, which simplifies coding for
binary data movement.
Name complements the size_bytes() method for contiguous data
STYLE: container IO.C files into main headers for better visibility
STYLE: include CompactListList.H in polyTopoChange
- avoids future mismatches if the CompactListList template signature
changes
GIT: relocate CompactListList into CompactLists/ directory
- PstreamBuffers for parallel VTK output.
- avoids MPI overflows for larger meshes
- new vtk::lineWriter for writing edges
- vtk::fileWriter::writeUniform now also supports processor-specific
uniform values instead of assuming that they are identical everywhere.
- support simple mesh subsetting to vtu formats to enable debug output
for a subsection of an existing polyMesh
- rudimentary support for VTK from cellShapes is intended for handling
basic primitive cell shapes without a full blown polyMesh description.
For example,
// Create an empty polyMesh with points only
polyMesh debugMesh
(
io,
std::move(points),
faceList(), // faces
labelList(), // owner
labelList(), // neighbour
true // syncPar
);
// Establish the appropriate VTK sizing for the TET shapes
vtk::vtuCells vtuCells;
vtuCells.resetShapes(debugCutTets);
vtuCells.nPoints(debugMesh.nPoints());
NOTE
Since the vtk::internalMeshWriter only uses the polyMesh reference
for the points, it is also possible to create the vtuCells
description without a pointField (or from a different mesh
description) and write out the connectivity using the pointField
from a different mesh.
- with the changes in vtkCellArray, the legacy files now have
OFFSET, CONNECTIVITY information.
- support reading of both versions.
- continue to generate legacy format 2.0, since this is what
many programs still expect
* removed internal upper limit on word/string length for parsed input.
- Although it has not caused many problems, no reason to retain
these limits.
- simplify some of the internal logic for reading string-like items.
- localize parsers for better separation from the header
- expose new function seekCommentEnd_Cstyle(), as useful
handler of C-style comments
* exclude imbalanced closing ')' from word/variable
- previously included this into the word/variable, but makes more
sense to leave on the parser for the following token.
Prevents content like 'vector (10 20 $zmax);' from being parsed
as '$zmax)' instead of as '$zmax' followed by a ')'.
No conceivable reason that the former would actually be desirable,
but can still be obtained with brace notation: Eg, '${zmax)}'
* consistent handling of ${{ ... }} expressions
- within a dictionary content, the following construct was
incorrectly processed:
value ${{2*sqrt(0.5)}};
Complains about no dictionary/env variable "{2*sqrt(0.5)}"
Now trap expressions directly and assign their own token type
while reading. Later expansion can then be properly passed to
the exprDriver (evalEntry) instead of incorrectly trying
variable expansion.
Does not alter the use of expressions embedded within other
expansions. Eg, "file${{10*2}}"
* improve #eval { ... } brace slurping
- the initial implementation of this was rudimentary and simply
grabbed everything until the next '}'. Now continue to grab
content until braces are properly balanced
Eg, the content: value #eval{${radius}*2};
would have previously terminated prematurely with "${radius" for
the expression!
NOTE:
both the ${{ expr }} parsed input and the #eval { ... } input
discard C/C++ comments during reading to reduce intermediate
overhead for content that will be discarded before evaluation
anyhow.
* tighten recognition of verbatim strings and expressions.
- parser was previously sloppy and would have accepted content such
as "# { ..." (for example) as an verbatim string introducer.
Now only accept parse if there are no intermediate characters
discarded.
Historically the "geometry" for static meshes was placed under
directly in the EnSight case directory.
Eg,
ensight/ensight.case
ensight/geometry
ensight/data/000001
ensight/data/000002 ...
This generally works ok, but relocating it to a constant data directory
Eg
ensight/ensight.case
ensight/data/constant/geometry
ensight/data/000001
ensight/data/000002 ...
Improves handling and avoids potential collisions when adding in
additional mesh regions
- 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
- less important for VTK (may help in future though) but preserve
the face point 0 when flipping faces to ensure that the result
is the same as having called face::reverseFace()
- improves interface and data consistency.
Older signatures are still active (via the Foam_IOstream_extras
define).
- refine internals for IOstreamOption streamFormat, versionNumber
ENH: improve data alignment for IOstream and IOobject
- fit sizeof label/scalar into unsigned char
STYLE: remove dead code
- 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
- eliminates a potentially invalid code branch.
Since it essentially had the same internals as std::swap anyhow,
make that more evident.
ENH: use std::swap for basic types
- makes it clearer that they do not rely on any special semantics
- read surfaces which are defined in terms of solid element sides. Eg,
```
*ELEMENT, TYPE=C3D4, ELSET=...
1, ...
2, ...
*SURFACE, NAME=Things, TYPE=ELEMENT
1, S1
2, S1
```
The element and side number are encoded as a synthetic face id
according to
-(10 * elemId + sideNum)
but the underlying solid geometry is discarded, since there is no
reasonable way to pass it through the surface sampling mechanism.
- returns a range of `int` values that can be iterated across.
For example,
for (const int proci : Pstream::subProcs()) { ... }
instead of
for
(
int proci = Pstream::firstSlave();
proci <= Pstream::lastSlave();
++proci
)
{
...
}