I am currently trying to plot the evolution of stress at certain points via the h5 output files. I’m having trouble inferring the location of each cell. I recognize that I have 375 cells from /topology/cells (of the h5 file) and equal number of stress outputs in space. From the vertex ID’s of the /topology/cells I can see that I am working with ID’s from 0 to 503. However, /geometry/vertex has coordinates of 1024 vertices. How do I infer the location of cells using the h5 data?
See examples/2d/gravity/plot_soln.py. Here are the important lines:
cells = numpy.array(h5['topology/cells'][:], dtype=numpy.int) cellCoords = vertices[cells,:] cellCenters = numpy.mean(cellCoords, axis=1)
cells is the array of vertices in each cell.
cellCoords is an array of the coordinates of the vertices of each cell.
cellCenters is the coordinates of the center of each cell.
Perfect. Thank you so much for the help as always.