8.3 Computational Domain

The size of the computational domain in physical units is specified at runtime through the (xmin, xmax), (ymin, ymax), and (zmin, zmax) runtime parameters. When working with curvilinear coordinates (see below in Sec:Grid geometry), the extrema for angle coordinates are specified in degrees. Internally all angles are represented in radians, so angles are converted to radians at Grid initialization.
FLASH3 Transition: The convention for specifying the ranges for angular coordinates has changed from FLASH2, which used units of $ \pi$ instead of degrees for angular coordinates.

The physical domain is mapped into a computational domain at problem initialization through routine Grid_initDomain in PARAMESH and Chombo, and Grid_init in UG.When using the uniform grid UG, the mapping is easy: one block is created for each processor in the run, which can be sized either at build time or runtime depending upon the mode of UG use. 8.1 Further description can be found in Sec:Grid UG. When using the AMR grid PARAMESH, the mapping is non-trivial. The adaptive mesh gr_createDomain function creates an initial mesh of nblockx * nblocky * nblockz top level blocks, where nblockx, nblocky, and nblockz are runtime parameters which default to 1.8.2The resolution of the computational domain is usually very coarse and unsuitable for computation after the initial mapping. The gr_expandDomain routine remedies the situation by applying the refinement process to the initial domain until a satisfactory level of resolution is reached everywhere in the domain. This method of mapping the physical domain to computational domain is effective because the resultant resolution in any section is related to the demands of the initial conditions there.

FLASH3 Transition: FLASH2 supported only an AMR grid with paramesh 2. At initialization, it created the coarsest level initial blocks covering the domain using an algorithm called “sequential” divide domain. A uniform grid of blocks on processor zero was created, and until the first refinement, all blocks were on processor zero. FLASH3 onwards the paramesh based implementation of the Grid uses a “parallel” domain creation algorithm that attempts to create the initial domain in blocks that are distributed amongst all processors according to the same Morton ordering used by PARAMESH.

First, the parallel algorithm computes a Morton number for each block in the coarsest level uniform grid, producing a sorted list of Morton numbers for all blocks to be created. Each processor will create the blocks from a section of this list, and each processor determines how big its section will be. After that, each processor loops over all the blocks on the top level, computing Morton numbers for each, finding them in the sorted list, and determining if this block is in its own section. If it is, the processor creates the block. Parallel divide domain is especially useful in three-dimensional problems where memory constraints can sometimes force the initial domain to be unrealistically coarse with a sequential divide domain algorithm.