|
Afivo
0.3
|
Each box has storage for a single layer of ghost cells for its cell-centered variables, which can be filled with one the following routines (and their equivalents in 3D):
A typical example would be:
call a2_gc_tree(tree, i_phi, a2_gc_interp, boundary_method)
This would fill ghost cells for all the boxes for variable i_phi. The argument a2_gc_interp refers to the standard routine for filling ghost cells near refinement boundaries, which employs linear interpolation. Users can implement a custom routine as a replacement for m_a2_ghostcell::a2_gc_interp. The argument boundary_method refers to the user-defined method for boundary conditions, see Boundary conditions.
To understand in which order ghost cells are filled, have a look at the implementation of m_a2_ghostcell::a2_gc_box. Basically, the procedure is as follows:
When data cannot be copied from a neighbor at the same refinement level, we use linear extrapolation to fill ghost cells. Suppose that there is a corner like this:
c | d ----- a | b
where a lies inside the box, c and d are ghost cells on the sides, and d is a corner ghost cell. The recipe for d is then: \(d = (b+c) - a\).
This linear extrapolation has a nice property: if we later perform bilinear prolongation using the values a, b, c, and d, then we get the same result as when we linearly interpolated using only a, b, and c.
TODO
1.8.12