[Paraview] using ParaView for in-situ visualization

Matthieu Dorier matthieu.dorier at gmail.com
Mon Feb 6 05:49:22 EST 2012


Hello,

I'm following the SC'10 tutorial with the help of the VTK doxygen, but I
don't understand how to do the following:

I have a 3D rectilinear grid which coordinates are defined by mesh_x,
mesh_y and mesh_z (float arrays of dimensions PX, PY and PZ). I have a
variable "temperature" defined as a 3D array representing the temperature
at each point of the grid. Currently I have followed the slides 24 and 25
from the SC'10 tutorial, at some point vtkDataObjects have to be created,
here is how I created the grid object :

// This function is called to retrieve the mesh
vtkObject* wrapMeshData()
{
  vtkFloatArray* xCoords, yCoords, zCoords;
  xCoords = vtkFloatArray::New();
  xCoords->setArray(mesh_x,PTX,1);
  yCoords = vtkFloatArray::New();
  yCoords->setArray(mesh_y,PTY,1);
  zCoords = vtkFloatArray::New();
  zCoords->setArray(mesh_z,PTZ,1);
  vtkRectilinearGrid *grid = vtkRectilinearGrid::New();
  grid->setDimensions(PTX,PTY,PTZ);
  grid->setXCoordinates(xCoords);
  grid->setYCoordinates(yCoords);
  grid->setZCoordinates(zCoords);
  return (vtkObject*)grid;
}

Now I want to make a function that retrieves the temperature so that I can
map each data value to each point of the mesh, something like :

vtkDataObject* wrapTemperature() {
  // ???
}

How can I do that without copying the original array that I want to wrap?
Also what functions do I then call from the vtkCPDataDescription object?
(on the tutorial they call SetGrid, I guess there is something else to call
for the temperature field)

Thank you for your help,

Matthieu

2012/1/19 Berk Geveci <berk.geveci at kitware.com>

> Please feel free to ask questions if anything is not clear or if you need
> some help. We will be working on better documentation in the coming few
> months.
>
> Best,
> -berk
>
>
> On Wed, Jan 18, 2012 at 12:08 PM, Matthieu Dorier <
> matthieu.dorier at gmail.com> wrote:
>
>> Thank you, this tutorial will help a lot.
>>
>> Matthieu
>>
>>
>> 2012/1/18 Andy Bauer <andy.bauer at kitware.com>
>>
>>> The current main wiki page for coprocessing with ParaView is at
>>> http://paraview.org/Wiki/CoProcessing.  In there it has links to 2
>>> examples, a C++ driven example and a python driven example.  You were
>>> looking at the C++ example.  There's also a powerpoint presentation and
>>> some more code examples at
>>> http://www.paraview.org/Wiki/SC10_Coprocessing_Tutorial.  We will but
>>> putting together a more extensive book but that probably won't be ready for
>>> a month or two.
>>>
>>> My suggestion would be to first work on creating a vtkDataObject to
>>> represent your data.  Look at the powerpoint presentation for information
>>> on doing that and then maybe the VTK doxygen (
>>> http://www.vtk.org/doc/nightly/html/classes.html) for more specific API
>>> questions.
>>>
>>> Andy
>>>
>>> On Wed, Jan 18, 2012 at 5:12 AM, Matthieu Dorier <
>>> matthieu.dorier at gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I have difficulties to understand how to instrument a simulation with
>>>> ParaView in order to perform in-situ visualization.
>>>> Is there any documentation other than the simple example provided at
>>>> http://paraview.org/Wiki/Coprocessing_example ?
>>>> Thank you,
>>>>
>>>> --
>>>> Matthieu Dorier
>>>> ENS Cachan, Brittany (Computer Science dpt.)
>>>> IRISA Rennes, Office C113
>>>> http://perso.eleves.bretagne.ens-cachan.fr/~mdori307
>>>>
>>>> _______________________________________________
>>>> 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://www.paraview.org/mailman/listinfo/paraview
>>>>
>>>>
>>>
>>
>>
>> --
>> Matthieu Dorier
>> ENS Cachan, Brittany (Computer Science dpt.)
>> IRISA Rennes, Office C113
>> http://perso.eleves.bretagne.ens-cachan.fr/~mdori307
>>
>> _______________________________________________
>> 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://www.paraview.org/mailman/listinfo/paraview
>>
>>
>


-- 
Matthieu Dorier
ENS Cachan, Brittany (Computer Science dpt.)
IRISA Rennes, Office C113
http://perso.eleves.bretagne.ens-cachan.fr/~mdori307
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120206/7d0d75bd/attachment-0001.htm>


More information about the ParaView mailing list