pwolfram / MPAS-Model

Repository for MPAS models and shared framework releases.
Other
1 stars 1 forks source link

Output global cell ID #5

Open pwolfram opened 5 years ago

pwolfram commented 5 years ago

The global Eulerian cell ID corresponding to the particle location should be output to facilitate easy analysis for postprocessing.

pwolfram commented 5 years ago

cc @bradyrx @maltrud

pwolfram commented 5 years ago

Addressed by #14

pwolfram commented 5 years ago

Closed by #14

bradyrx commented 5 years ago

@pwolfram,

A (maybe) bug found in the global cell ID. Currently, the default particle to globalCellID returns a 1-based index of nCell that the particle is in. I imagine this is due to you pulling from the Fortran code.

Thus, a Python user has to adjust the globalID output to get at the actual cell the particle is within. Not doing so causes drastically different answers, since cells aren't ordered in an "orange peel" fashion to my knowledge.

Perhaps this isn't a bug and rather a design decision. Is the average user analyzing in, e.g. MATLAB and Fortran, or in something 0-based like Python? Something to consider.

pwolfram commented 5 years ago

@bradyrx, all indices in MPAS are 1-index and do need the index -= 1 approach in python prior to their use. This was a pre-existing, across the board design decision that was made. Good catch on this -- it will cause quite a difference if the -1 is not included!

bradyrx commented 5 years ago

@pwolfram , this and https://github.com/pwolfram/MPAS-Model/issues/4 should be incorporated into the make_particle_file.py file so that this information is included in the init file.