[Paraview] Memory-saving method for data passing

David Lonie david.lonie at kitware.com
Thu Dec 1 13:08:47 EST 2016


Many VTK objects have a ShallowCopy method that does what you want. You can
shallow copy the entire datasets (which just copies pointers to data into a
new dataset container), or selectively copy e.g. points.

Datasets can easily share components. For instance, if you have two grids
that have the same points, you can do something like:

grid1->SetPoints(grid2->GetPoints());

and both grids will share the same vtkPoints object and its associated
memory buffers.

HTH,
Dave

On Thu, Dec 1, 2016 at 12:47 PM, Straub, Alexander <
inf76340 at stud.uni-stuttgart.de> wrote:

> Good day,
>
> I am currently developping a bunch of plugins (filters) for Paraview in
> the following setup:
>
>
> I have input data as a rectilinear grid, including an array of scalar
> values per cell (volume-of-fluid data (vof)). On this data I now want to
> perform some calculations. First, a plugin calculates the gradient. Then,
> another plugin takes the grid with the vof-data and the gradients to
> calculate other vectors. This goes on for a few plugins.
>
> The problem I get is that every time another filter is applied onto the
> last one, I copy all the data and add another array with the filter's own
> results. Thus, the second filter stores its own calculation and the source
> data, the third filter stores its own calculation, the calculation of the
> previous plugin and the source data.
>
> You can see, that this results in a huge increase of memory usage.
>
> Now to my question: Is there a possibility or method which passes along a
> pointer, or a copy pointing to the input of the plugin to which I then only
> need to add another array? Additionally I might add that the grid itself
> always stays the same, only each filter appends another array.
>
> I hope you can help me, or at least quickly tell me if it is not possible
> at all.
>
> Kind regards,
> Alexander Straub
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=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/20161201/5b060396/attachment.html>


More information about the ParaView mailing list