Skip to content
Snippets Groups Projects
Commit 47324c96 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'zoom_fix_restart' into 'zoom_merge'

Fixing restarting in a zoom run

See merge request !2139
parents 1ae00953 095b1de7
No related branches found
No related tags found
1 merge request!2139Fixing restarting in a zoom run
......@@ -52,6 +52,9 @@ void zoom_find_void_cells(struct space *s, const int verbose) {
/* Get the cell pointers. */
struct cell *cells = s->cells_top;
/* Zero the void cell count. */
zoom_props->nr_void_cells = 0;
/* Get the offset and the number of cells we're dealing with. */
int offset = zoom_props->bkg_cell_offset;
int ncells = zoom_props->nr_bkg_cells;
......
......@@ -431,6 +431,13 @@ void zoom_report_cell_properties(const struct space *s) {
struct zoom_region_properties *zoom_props = s->zoom_props;
/* Compute the number of background cells along each side of the void
* region. */
int void_cdim[3];
for (int i = 0; i < 3; i++) {
void_cdim[i] = (int)ceil(s->zoom_props->void_dim[i] * s->iwidth[i]);
}
/* Cdims */
message("%28s = [%d, %d, %d]", "Background cdim", s->cdim[0], s->cdim[1],
s->cdim[2]);
......@@ -439,6 +446,8 @@ void zoom_report_cell_properties(const struct space *s) {
zoom_props->buffer_cdim[1], zoom_props->buffer_cdim[2]);
message("%28s = [%d, %d, %d]", "Zoom cdim", zoom_props->cdim[0],
zoom_props->cdim[1], zoom_props->cdim[2]);
message("%28s = [%d, %d, %d]", "Void cdim", void_cdim[0], void_cdim[1],
void_cdim[2]);
/* Dimensions */
message("%28s = [%f, %f, %f]", "Background Dimensions", s->dim[0], s->dim[1],
......@@ -449,6 +458,9 @@ void zoom_report_cell_properties(const struct space *s) {
zoom_props->buffer_dim[2]);
message("%28s = [%f, %f, %f]", "Zoom Region Dimensions", zoom_props->dim[0],
zoom_props->dim[1], zoom_props->dim[2]);
message("%28s = [%f, %f, %f]", "Void Region Dimensions",
s->zoom_props->void_dim[0], s->zoom_props->void_dim[1],
s->zoom_props->void_dim[2]);
/* Cell Widths */
message("%28s = [%f, %f, %f]", "Background Cell Width", s->width[0],
......@@ -552,6 +564,12 @@ void zoom_props_init(struct swift_params *params, struct space *s,
*/
void zoom_region_init(struct space *s, const int verbose) {
/* Nothing to do if we are restarting, just report geometry and move on. */
if (s->e != NULL && s->e->restarting) {
if (verbose) zoom_report_cell_properties(s);
return;
}
/* Update the neighbour distance in case the gravity props have changed. */
if (s->e != NULL) {
s->zoom_props->neighbour_distance =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment