lanl / phoebus

Phifty One Ergs Blows Up A Star
BSD 3-Clause "New" or "Revised" License
46 stars 2 forks source link

Fix restriction bug on initialization #158

Closed Yurlungur closed 1 year ago

Yurlungur commented 1 year ago

PR Summary

Upon updating parthenon, @brryan found that Phoebus was crashing when restriction was called. The issue turned out to be a subtle interaction between Metadata and the custom prolongation/restriction operations. Essentially primitive and/or conserved variables need to be set for prolongation/restriction when they are used for boundary conditions. However, they were being set with an "empty" prolongation/restriction operator and the code was crashing when the stored functor was a nullptr.

This was happening because because Metadata::FillGhost was being set after the constructor for the metadata object was called, but the default prolongation/restriction ops are currently only set when Metadata is constructed.

I fix this issue here by creating Metadata objects once and not changing their flags after construction. There should also be some changes in parthenon to guard against this in the future. But this fixes Phoebus for now.

I also tweak the eos_phoebus.cpp file while I was debugging. Essentially I just moved the vector of valid names outside initialize.

PR Checklist