2D AMRCLAW
Functions/Subroutines
flag2refine2.f90 File Reference

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...
 

Function/Subroutine Documentation

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

Parameters
mxnumber of cells in i direction
mynumber of cells in j direction
mbcwidth of ghost cell region
mbuffwidth of buffer region
meqnnumber of equations for the system
mauxnumber of auxiliary variables
xlowerx-coordinate of left physical boundary
ylowery-coordinate of lower physical boundary
dxspacing in i direction
dyspacing in j direction
tsimulation time on this grid
levelAMR level of this grid
tolsptolerance specified by user in input file amr.data, used in default version of this routine as a tolerance for spatial differences
qgrid values including ghost cells (bndry vals at specified time have already been set, so can use ghost cell values too)
auxauxiliary array on this grid patch
amrflagsarray 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.
DONTFLAGvalue to be assigned to amrflags for cells that need no refinement
DOFLAGvalue to be assigned to amrflags for cells that do need refinement

Definition at line 53 of file flag2refine2.f90.

References allowflag().

Referenced by flagger(), and spest2().

Here is the call graph for this function:

Here is the caller graph for this function: