Search code examples
meshvtkparaviewtriangulartetrahedra

Show 2D celldata fields in 3D domains with Paraview


I have a .vtu file composed of tetrahedral and triangular elements (located on an outer surface). I also have a celldata field (for example, nrc1) defined on the triangular elements and being zero in the tetrahedral ones. When I select to plot this field in Paraview, I only see a zero field, corresponding with the 3D elements, but no trace of the field in the 2D elements.

Is there a way to show that 2D field in Paraview?

P.D.: I cannot interpolate the 2D celldata field into a pointdata one, since part of the information (discontinuities,...) would be lost.


Solution

  • There is indeed a conflict between the information on the 3D cells (zeroes) and information on the 2D cells (actual information), where the 2D cells and the 3D cells overlap.

    Even though your dataset is valid, mixed dimension dataset are not easy to manage correctly, hence your issue.

    In any case, you should extract your 2D cells to be able to visualize your data correctly, here is how I would do it :

    • Create a new view, click on Spreadsheet view
    • show your dataset in the spreadsheet view
    • order by CellType
    • Manually select all 2D CellType has they will be located together
    • Add an Extract Selection filter, Apply
    • You can now visualize your data on this 2D cells only dataset

    You could also use Edit->Find Data and select by ID since your cells seems to be ordoned.

    Finally, you could write a small Python Programmable Filter to do all that for you completelly automatically, but it is not very easy to implement.