Thanks!
I have made some progress, although just because I made some sacrifices in generality. For now I fill focus on static meshes with hex elements. I am aiming for zero-copy and therefore I went with constructs like this (iter
is a mesh region):
const label nPoints = iter.val()->nPoints();
meshData["coordsets/coords/type"].set_string("explicit");
// TODO: Test this in parallel.
meshData["coordsets/coords/values/x"].set_external(
const_cast<double *>(iter.val()->points().cdata()->cdata()),
nPoints,
/*offset=*/0,
/*stride=*/3 * sizeof(double));
meshData["coordsets/coords/values/y"].set_external(
const_cast<double *>(iter.val()->points().cdata()->cdata()),
nPoints,
/*offset=*/sizeof(double),
/*stride=*/3 * sizeof(double));
meshData["coordsets/coords/values/z"].set_external(
const_cast<double *>(iter.val()->points().cdata()->cdata()),
nPoints,
/*offset=*/2 * sizeof(double),
/*stride=*/3 * sizeof(double));
I think ultimately there will be a need to create classes in src/conversion
and src/fileFormats
to handle this more generically.
I have several questions:
- Is it possible with the new API to pipe the objects back into an an interactive ParaView session?
- Are there any working examples for multi-rank producers? The examples I found in
Examples/Catalyst2
appear to be all single-rank. - Is it possible to suppress missing options warning?
- To test velocity transfer I created a script which draws glyphs and colours them with magnitude. It seems to work, but it appears to producing a SOA warning. If you have an idea what may be causing it, please advise.
Options warning
( 13.617s) [pvbatch ] v2_internals.py:150 WARN| Module 'slice_extractor' missing Catalyst 'options', will use a default options object
SOA warning
WARN| 23vtkSOADataArrayTemplateIdE (0x55a3e7539640): GetVoidPointer called. This is very expensive for non-array-of-structs subclasses, as the scalar array must be generated for each call. Using the vtkGenericDataArray API with vtkArrayDispatch are preferred. Define the environment variable VTK_SILENCE_GET_VOID_POINTER_WARNINGS to silence this warning.