openPMD / openPMD-standard

:notebook: Open Standard for Particle-Mesh Data
http://www.openPMD.org
Creative Commons Attribution 4.0 International
78 stars 27 forks source link

Move mesh geometry elsewhere #188

Open mccoys opened 6 years ago

mccoys commented 6 years ago

This issue is a bit messy, sorry. My ideas are not clear yet, but I hope constructive discussion will follow.

Two issues #141 & #142 bring changes to the mesh structure: meshes will not be spatial any more (but of any type) and their spacings may not be regular. Who knows, maybe unstructured mesh will be added some day. All this might introduce a significant overhead, both in terms of memory and in terms of saturating the standard with complexity. The geometry attribute, and associated attributes thus becomes too restrictive. The difference between cartesian and thetaMode will only appear on spatial coordinates, which will be a special case in v2.0, and does not provide any information on the spacings.

It is true that one could provide a ton of details in geometryParameters in order to indicate how to reconstruct the final view. However, this will look like a bit bloated and not convenient for parsing.

I suggest that the geometry information be spread among (optional) details, potentially moved to an extension. I am not sure yet what the best approach would be. Note that these changes impact most the attributes in a mesh record: geometry, geometryParameters, axisLabels, gridSpacing, gridGlobalOffset. Some of these do not always make sense in all geometries.

Some things to think about:

ax3l commented 6 years ago

Thank you for documenting your ideas!

I think moving geometry generally into an extension would be marvelous, even independent of the special spatial case of thetaMode.

Such an extension would and should be very similar to existing visualization markup standards (see e.g. here). Most of them are for a good reason using VTK-naming which has a great hierarchy of various structured and unstructured meshes.

Btw, another reason to move it into an extension is that geometry of the data does not imply visualization geometry. Take for example the thetaMode or a cylindrical symmetric mesh: in real-space one could do a full 3D reconstruction to look at it (because it's only a "compression scheme" for full 3D geometry under certain assumptions of symmetry) but one can also decide to look at individual modes or 2D cuts of reconstructed slices alone. The same is true for other geometries: projections and subsets in different geometrical representation do make sense and are not necessarily the same as the raw data geometry.

That said, in my opinion geometry attributes are an essential hint on what the data starts from for various geometric representations that one can then do with it in tools.

mccoys commented 6 years ago

Here is a list of mesh types that I can envision

The geometry thetaMode would not be defined explicitely: it is only a special case of cylindrical, where the array has only one point along theta (=0). Defining modes can be done as currently (in another argument).

A polar geometry could also be seen as a special case of cylindrical where z=0.

See additional considerations in #189