Here is how the VTK pipeline handles ghost cells.
- Source can produce data with up to N level of ghost cells
- Filter request M level of ghost cells
- During the RequestUpdateExtent pass, M is forwarded to the Source
- During the RequestData pass, Source produce M level of ghost cells
This working very well when you update the pipeline only once and M never changes, but in complex application, it is almost always never the case. ParaView comes to mind.
Here is what happens if M changes over time for any reason, eg in ParaView:
- Source can produce data with up to N level of ghost cells
- Filter1 request N level of ghost cells
- Filter2 request M (>N) level of ghost cells
- ParaView create the Source and update the pipeline, no ghost cells were requested, none were produced
- Filter1 is added, ParaView update the pipeline, N is forwarded and the source needs to reexecute
- There is no way around it, this is what should be done
- Filter2 is added, ParaView update the pipeline, M is forwarded and the source execute again but it still generate N level of ghost cells as it cant generate more than that.
- This is a useless execution
If source (and filters for that matter) could declare the maximum number of ghost cells they can produce during the RequestInformation pass, the pipeline could take that into account and skip the Source execution altogether.