2D AMRCLAW
|
Go to the source code of this file.
Functions/Subroutines | |
subroutine | flag2refine2 (mx, my, mbc, mbuff, meqn, maux, xlower, ylower, dx, dy, t, level, tolsp, q, aux, amrflags, DONTFLAG, DOFLAG) |
User routine to control flagging of points for refinement. More... | |
subroutine flag2refine2 | ( | integer, intent(in) | mx, |
integer, intent(in) | my, | ||
integer, intent(in) | mbc, | ||
integer, intent(in) | mbuff, | ||
integer, intent(in) | meqn, | ||
integer, intent(in) | maux, | ||
real(kind=8), intent(in) | xlower, | ||
real(kind=8), intent(in) | ylower, | ||
real(kind=8), intent(in) | dx, | ||
real(kind=8), intent(in) | dy, | ||
real(kind=8), intent(in) | t, | ||
integer, intent(in) | level, | ||
real(kind=8), intent(in) | tolsp, | ||
real(kind=8), dimension(meqn,1-mbc:mx+mbc,1-mbc:my+mbc), intent(in) | q, | ||
real(kind=8), dimension(maux,1-mbc:mx+mbc,1-mbc:my+mbc), intent(in) | aux, | ||
real(kind=8), dimension(1-mbuff:mx+mbuff,1-mbuff:my+mbuff), intent(inout) | amrflags, | ||
real(kind=8), intent(in) | DONTFLAG, | ||
real(kind=8), intent(in) | DOFLAG | ||
) |
User routine to control flagging of points for refinement.
Default version computes spatial difference dq in each direction and for each component of q and flags any point where this is greater than the tolerance tolsp. This is consistent with what the routine errsp did in earlier versions of amrclaw (4.2 and before).
This routine can be copied to an application directory and modified to implement some other desired refinement criterion.
Points may also be flagged for refining based on a Richardson estimate of the error, obtained by comparing solutions on the current grid and a coarsened grid. Points are flagged if the estimated error is larger than the parameter tol in amr2ez.data, provided flag_richardson is .true., otherwise the coarsening and Richardson estimation is not performed! Points are flagged via Richardson in a separate routine.
Once points are flagged via this routine and/or Richardson, the subroutine flagregions is applied to check each point against the min_level and max_level of refinement specified in any "region" set by the user. So flags set here might be over-ruled by region constraints.
output: amrflags
mx | number of cells in i direction |
my | number of cells in j direction |
mbc | width of ghost cell region |
mbuff | width of buffer region |
meqn | number of equations for the system |
maux | number of auxiliary variables |
xlower | x-coordinate of left physical boundary |
ylower | y-coordinate of lower physical boundary |
dx | spacing in i direction |
dy | spacing in j direction |
t | simulation time on this grid |
level | AMR level of this grid |
tolsp | tolerance specified by user in input file amr.data, used in default version of this routine as a tolerance for spatial differences |
q | grid values including ghost cells (bndry vals at specified time have already been set, so can use ghost cell values too) |
aux | auxiliary array on this grid patch |
amrflags | array to be flagged with either the value DONTFLAG or DOFLAG for each cell. It is enlarged from grid size to include buffer regions around the grid. |
DONTFLAG | value to be assigned to amrflags for cells that need no refinement |
DOFLAG | value to be assigned to amrflags for cells that do need refinement |
Definition at line 55 of file flag2refine2.f90.
Referenced by flagger(), and spest2().