# Catalyst V2 for OpenFOAM

**URL:** https://discourse.paraview.org/t/catalyst-v2-for-openfoam/6903
**Category:** In Situ Support
**Created:** [April 8, 2021, 8:33pm UTC](https://discourse.paraview.org/t/catalyst-v2-for-openfoam/6903 "2021-04-08T20:33:36Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 15, 2021, 1:44pm UTC](https://discourse.paraview.org/t/catalyst-v2-for-openfoam/6903/5 "2021-04-15T13:44:12Z")

</div>

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):

```cpp
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:

1. Is it possible with the new API to pipe the objects back into an an interactive ParaView session?
2. Are there any working examples for multi-rank producers? The examples I found in `Examples/Catalyst2` appear to be all single-rank.
3. Is it possible to suppress missing **options warning**?
4. 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

```auto
( 13.617s) [pvbatch] v2_internals.py:150 WARN| Module 'slice_extractor' missing Catalyst 'options', will use a default options object

```

#### SOA warning

```auto
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.

```

---

_[View the full topic](https://discourse.paraview.org/t/catalyst-v2-for-openfoam/6903)._
