For some applications, the region flagged by the monitor function to be refined may not be the region we are interested in, i.e., we cannot find a suitable monitor to flag that region. In this case, we must force the refinement. For example, when we solve the Euler equation by the artificial viscosity method, the region near the contact discontinuity cannot be resolved as well as the region near the shock wave. After some time, the refinement level at the region near the contact discontinuity is reduced. We need to add finer levels in that region to ensure that the discontinuity is properly resolved. For some steady-state problems, we are not very much interested in the solution at early times. Instead, we want the solution near the steady-state to be correct and well-resolved. All of these cases show that the user needs some control over the adaptivity, either in time or in space. One kind of control is to let the user input and modify the refinement region at any time and any place.
The user's input can be written as a grid file. The format of the grid file
is presented in Figure 4.1.
In order to facilitate output and display of the solutions, we supply a
transformation which can convert hierarchical data to conventional linear
array data, i.e., instead of outputing the data as many patches,
we output the
data as one big patch on a nonuniform grid. Thus conventional
data graphical output can be used immediately after each time step.
The output order forms a W-cycle. For example (see Figure 4.2),
supposing we have four
refinement levels (the patch number at each level is shown at the right side of
Figure 4.2), we replace the coarse grid with
its immediate finer grid if it exists. This is done recursively for all
the grids. The final output order is shown in Figure 4.2.
The user is also given additional controls over the adaptivity by