nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Slice ModelArrays #735

Open timspainNERSC opened 7 hours ago

timspainNERSC commented 7 hours ago

Both advection (#99) and the halo regions needed for MPI (#132) require moving around subsets of ModelArray data. A unified slicing class/library to provide a common interface would be a useful addition to the model.

timspainNERSC commented 7 hours ago

Currently in progress on the branch slicer.

TomMelt commented 3 hours ago

maybe 106445222 assertions is a bit overkill.

image

Could we reduce the size/dimensionality of this test case? https://github.com/nextsimhub/nextsimdg/blob/5216f7b8343a37de1e4924709820f63e0cff4d18/core/test/Slice_test.cpp#L137-L149

TomMelt commented 3 hours ago

Thanks for sharing this branch @timspainNERSC. This will be super helpful.

I had a quick look and maybe I missed it. Is it possible to get the elements from a 1D slice back as a array/vector? possibly a std::array would be most sensible for my use case.