sxs-collaboration / spectre

SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
https://spectre-code.org
Other
159 stars 189 forks source link

Cleanup element map and decrease size of ChildSize/MortarSize enums #6032

Closed nilsdeppe closed 4 months ago

nilsdeppe commented 4 months ago

Proposed changes

Upgrade instructions

Code review checklist

Further comments

nilsvu commented 4 months ago

Yes I think we can get rid of ElementMap, see the notes I wrote in this file: https://github.com/sxs-collaboration/spectre/blob/develop/src/Domain/Python/ElementMap.cpp. I think we can just construct a Composition coordinate map instead of the ElementMap where it's needed. The function to create a Composition element map is already implemented in the file I linked. We could factor that out to a free function.

nilsdeppe commented 4 months ago

Right, though if I'm reading the comment right that's saying replace ElementMap by a composition? The goal is to not store the block maps in the element databoxes, which means doing a composition is an issue

nilsvu commented 4 months ago

No need to store the (composition) element map in the element databoxes either in most cases. It can always be constructed on the fly just from the ElementID and the domain/block.

Note: I remember vaguely that some coordinate maps have caches (ylm interpolation info or something like that), so removing them from the element databox may have an effect. Can't find the code right now though, so maybe this was just an idea. I only find src/Domain/CoordinateMaps/TimeDependent/Shape.cpp where the interpolation info doesn't seem to be cached.

nilsdeppe commented 4 months ago

Oh, I see. Sure! What Larry and I had discussed was possibly having the coordinates/Jacobians compute tags handle the compositions in some manner as needed. But I have no idea what all this looks like exactly in the elliptic code. I think in the evolution code we could just store a pointer in ElementMap that points to the global cache, or just have the compute items.

Hmm, I don't remember us caching anything. SpEC does that a lot, but I thoguht we intentionally avoided it because of memory overhead. But there's too much code now, so I don't honestly remember :)

knelli2 commented 4 months ago

Just an FYI, I'm planning a lot of interpolation framework changes around using compute tags to have coordinates/tensors in different frames