User: rhaas Date: 2012/10/29 01:06 PM
Modified: /trunk/src/driver/ setup.cc
Log: Initialize Cactus grid scalar with data from internal data structures
this is avoids errors when new horizons are turned on in a checkpoint recovery.
The reason is that AHFinderDirect attempts to initialize its internal variables from checkpointed data (in particular the patch system origin). Since the new horizons did not exist at the time of checkpoint (and the whole variable is missing) the recovery routine in CarpetIOHDF5 reads in no data which leaves the Cactus group uninitialized which in turn leads to invalid values in AHFinderDirect's internal data structures.
The attached fix circumvents this by having AHFinderDirect initialize the Cactus group from its internal data structures (which it constructed from the parameters) at BaseGrid. This way, any newly created horizon will retain the values from the parameter file, but existing ones have their values overwritten.
File Changes:
Directory: /trunk/src/driver/ =============================
File [modified]: setup.cc Delta lines: +7 -0 =================================================================== --- trunk/src/driver/setup.cc 2012-07-08 04:58:20 UTC (rev 1568) +++ trunk/src/driver/setup.cc 2012-10-29 18:06:51 UTC (rev 1569) @@ -683,6 +683,13 @@ printf ("AHF setup %d found_flag=%d\n", n+1, (int) AH_data.found_flag); } } + + // Save in grid array in case a recovery only recovers some horizons + for (int n = 0; n < N_horizons; ++ n) { + struct AH_data& AH_data = *state.AH_data_array[n+1]; + const struct BH_diagnostics& BH_diagnostics = AH_data.BH_diagnostics; + BH_diagnostics.save(cctkGH, n+1); + } }