next up previous
Next: Numerical Experiments Up: A Simple Adaptive Mesh Previous: Evolving and reusing the

User Control over the Adaptivity

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.

  
Figure: Data format for grid file
\begin{figure}
\rule[-2mm]{0.2mm}{2mm}\hrulefill\rule[-2mm]{0.2mm}{2mm}
\linebre...
...ce{-0.5\baselineskip}
\rule{0.2mm}{2mm}\hrulefill\rule{0.2mm}{2mm}\end{figure}

This file can be read by our AMR system. Using both ends of the patch and the base grid information, we can compute the logical coordinates for the refined grid. The algorithm is: first find the logical cell in the base grid which contains the end point; then divide it l-1 times if the patch is at the l level; finally, locate the nearest point and assign its logical coordinate to the end point. We also have a module to write the refined grid using the above format and store it as a grid file for later use. We have designed a friendly graphical user interface, called GFEditor (grid file editor) to modify and optimize the grid file.

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.

  
Figure: Order for hierarchical data structure to output as one patch
\begin{figure}
\rule[-2mm]{0.2mm}{2mm}\hrulefill\rule[-2mm]{0.2mm}{2mm}
\linebre...
...ce{-0.5\baselineskip}
\rule{0.2mm}{2mm}\hrulefill\rule{0.2mm}{2mm}\end{figure}

The user is also given additional controls over the adaptivity by


next up previous
Next: Numerical Experiments Up: A Simple Adaptive Mesh Previous: Evolving and reusing the
Shengtai Li
1998-03-05