Support for multiple grid hierarchies ===================================== Author: Erik Schnetter Date: 21 May 2004 Status: open for discussion Some remarks on introducing multiple GH structures to the flesh It is either the flesh's or the driver's task to decide how many GH structures there should be. Given that the flesh ultimately allocate the memory and initialises the structure, it should probably be a flesh parameter that sets this. I suggest "num_hierarchies". We can later introduce mechanisms by which different drivers negotiate with the flesh. It is the driver's task to create unique IDs for these GH structures. There exists a string "identity" in the GH structure for this purpose. It is in many cases useful to have a small non-negative integer index associated with each GH structure. I propose to add "cctk_hierarchy_index" and "cctk_num_hierarchies" for that. The driver's registered routine SetupGH is called once for each GH. We can later introduce a mechanism (see above) by which some drivers might only "see" a subset of the GH structures. The flesh data structure tFleshConfig already contains an array of GH structures and a counter. According to the CactusDefault*.c files, these are meant for convergence levels. We can either reuse these or turn these into an array of arrays, so that each convergence level contains a number of hierarchies. In addition to multiple patches and multiple convergence levels, it might be interesting to introduce one GH per refinement level for Carpet. Carpet currently rewrites many entries in the GH structure; it would save time if there existed one GH per level. In view of this, it might be best if the flesh knew only abstractly about different GH structues and was oblivious of what these were actually used for (convergence level, refinemene level, multigrid level, patch index, and whatever-the-next-person-comes-up-with). In view of this, it might be best to forget all of the above and only rename the "convergence_level" variables in the flesh to "GH_index". Drivers can then add GH structures by calling "CCTKi_AddGH".