Centroid point data in same file as mesh

Hello,

I am writing an aerodynamic solver which works on NASTRAN FEM. I am using Paraview to view my development.

So far I have managed to plot the FEM in Paraview by writing a VTU file. This involves using a single piece, with point coordinates, cell connectivity, cell offsets and cell types.

However, for the next step I am calculating the centroids of each cell. In order to view my centroids I want to plot these points on the mesh. In the same VTU file as above I am now writing a separate piece which just contains points. The piece line goes like:

Piece NumberOfPoints=“nPoints” NumberOfCells=“0”

I am explicitly setting number of cells to 0.

Then I just list all the centroid co-ordinates under

Points
DataArray type=“Float32” NumberOfComponents=“3” format=“ascii”

When I load this into Paraview I cannot find where to view these centroids. I seem to be able to just view the original mesh from the first piece.

Can someone advise how I can view the centroids - whether this requires using the Paraview application differently or writing my VTU file differently.

Thank you

Hi @deathtime

I am explicitly setting number of cells to 0.

This is expected then, without cells you do not get anything to view.

You can use “ConvertToPointClouds” filter to generate cells but since you create your data yourself, you may want to create cells yourself. Either one vertex by point or a single polyvertex.