parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
105 stars 33 forks source link

Refactor Mesh Constructors #1055

Closed lroberts36 closed 1 month ago

lroberts36 commented 3 months ago

PR Summary

This PR splits up the Mesh constructors to remove code duplication between the regular and restart mesh constructors. The main rationale for doing this is to split up the constructors so that new constructors for non-hyper-rectangular meshes can easily be added.

In the process of going through this PR, I noticed that some of the user function overrides were not set in the restart constructor. Someone please confirm that it is ok to set all of these on restart.

Almost all of the changes should be just a reorganization of pre-existing code. One exception is that on restart the base mesh is built from the parameter input file, and then the base mesh properties are checked against the restart file (as opposed to directly building from the restart file information). I think there is no reason why the parameter input should be able to change the mesh properties on restart, but please correct me if I am wrong.

PR Checklist

lroberts36 commented 3 months ago

Passes Riot and parthenon-mhd tests.

lroberts36 commented 2 months ago

riot and parthenon-mhd tests still passing.

pgrete commented 1 month ago

It looks like the extended tests don't pass (any more?)

lroberts36 commented 1 month ago

Ah, there was a bug. I was mapping the derefinement counts based on the legacy logical location and then trying to find them based on the forest logical location (so effectively every derefinement count was set to zero). I think this wasn't showing up previously because the test was still setting a very high number for the derefinement_count until the latest PR was merged in. Should all be fixed now.