[Paraview] OpenFOAM Reader - Showing multiple velocity components simulaneously

David E DeMarle dave.demarle at kitware.com
Mon Dec 8 16:25:06 EST 2014


I'ld use something like the PythonCalculator to pass through a renamed copy
of the original array.
Once the copy is renamed, paraview will let you color and otherwise treat
it independently from the input array that it is a copy of.

You can probably get away with a shallow copy of the array contents too.
Then the only cost will be a few bytes for the new container data
structures. I'ld start going about doing that at the VTK API level in the
python programmable filter.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Thu, Nov 27, 2014 at 3:12 AM, Christian Butcher <
christian.butcher at oist.jp> wrote:

> Dear ParaView list,
>
> I'm currently trying to open multiple 'RenderView' windows so that I
> can show, for example, U_x, U_y, and U_z along with U_Magnitude
> simultaneously for the purpose of exporting an animation using
> ParaView-v4.2.0.
>
> Studying a Python trace whilst switching components using the Qt GUI
> suggests this is not trivially possible using either the GUI or a
> Python shell.
>
> The Python trace shows these lines:
>    uLUT = GetColorTransferFunction('U')
>    uLUT.VectorMode = 'Magnitude'
> and switching to, for example, U_y requires
>    uLUT.VectorMode = 'Component'
>    uLUT.VectorComponent = 0
>
> Since the uLUT proxy is returned by the GetColorTransferFunction('U')
> function, I'm unsure but doubting that I can duplicate this proxy and
> set different values in different Views.
>
> Duplicating data files allows the reading of a file multiple times,
> but isn't really practicable given memory constraints etc.
>
> Looking at the OpenFOAM reader in vtkOpenFOAMReader.{h,cxx} and
> vtkPOpenFOAMReader.{h,cxx} suggests that the relevant function to
> modify in the reader might be
>
>     vtkFloatArray *vtkOpenFOAMReaderPrivate::FillField(vtkFoamEntry
> *entryPtr, int nElements, vtkFoamIOobject *ioPtr, const vtkStdString
> &fieldType)
> .P
> but since this has to return a (single) vtkFloatArray*, I'm unsure if
> any modifications are likely to help me.
>
> The 'U' field can be identified using statements like:
>     if (ioPtr->GetObjectName() == "U") { // process here }
> Individual components are accessible using:
>
>     data = static_cast<vtkFloatArray *>(entry.Ptr());
>     float *tuple = data->GetPointer(nComponents * tupleI);
>     tuple[0] = xValueOfVelocityForCellReferedToByTupleI;
>
> etc.
>
> The function can be found around line 6480 in vtkOpenFOAMReader.cxx
>
> Does anyone have an idea I could use to simultaneously display
> different velocity components (and magnitude, if possible, but this
> can be coded into a 4th component fairly easily I suspect, if only
> individual components could be simultaneously shown)?
>
> Best,
>
> Christian Butcher
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20141208/e04278e4/attachment.html>


More information about the ParaView mailing list