geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 49 forks source link

Allow radial resolution changes for multiple domains #537

Closed illorenzo7 closed 1 month ago

illorenzo7 commented 1 month ago

This pull request should accomplish two main goals:

  1. Allow the user to increase the number of radial points in each Chebyshev sub-domain (even with multiple domains, e.g., ncheby=64, 96 --> ncheby = 96,256) and then restart from a checkpoint with the old (coarse) resolution. Before, the chebyshev coefficients weren't initialized correctly for multiple domains.

  2. Throw an error message and exit if the user tries to lower radial resolution in any subdomain. Before, the code would simply do nothing, likely integrating a bunch of zeros.

illorenzo7 commented 1 month ago

@feathern OK, this should be ready to be reviewed. I made logic so as to not touch the old code block that handles the single-domain case. The only place single-domain behavior will change is to throw an error and exit if the user tries to lower the resolution.

FYI I tested this by restarting from a checkpoint in (1) a simulation with a single domain and (2) a simulation with three subdomains. In each simulation, I tried lowering, raising, and not modifying the radial resolution and achieved the expected results.