Open johnomotani opened 4 years ago
Agreed, this would be really nice functionality. Very useful for many different projects.
Another comment: x-direction interpolation should be done region-by-region (so similar code to interpolate_parallel(), but without the shifting to/from field-aligned). z-direction interpolation doesn't need to split into regions since there are no region boundaries in the z-direction, so should be simpler (although there's a question of whether we use FFT-based interpolation or polynomial interpolation).
It would be nice to have some generic interpolation method to convert a Dataset to a higher (or lower) resolution grid. We could then use
to_restart()
to create restart files for a simulation to continue at a different resolution. This would be a more general version ofBoutDataset.interpolate_parallel()
.Things to remember/consider:
dx
,dy
anddz
for the new resolutionnx
,nx
,nz
, topology indices, etc.) for the new resolutionnz
is not a multiple of or a divisor of the oldnz
?interpolate_parallel
within this new interpolation method. However, it might be more efficient to re-implement the functionality (or to convertinterpolate_parallel
to a special case of this method) - in particular if we are operating region-by-region it would probably be best to split into regions once, do all the necessary interpolations, and then re-combine once, rather than splitting/recombining for theinterpolate_parallel
part and then splitting/recombining again for the perpendicular interpolation.