2D AMRCLAW
Functions/Subroutines
bc2amr.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine bc2amr (val, aux, nrow, ncol, meqn, naux,
 Take a grid patch with mesh widths hx,hy, of dimensions nrow by ncol, and set the values of any piece of of the patch which extends outside the physical domain using the boundary conditions. More...
 

Function/Subroutine Documentation

subroutine bc2amr ( real*8, dimension(meqn,nrow,ncol)  val,
real*8, dimension(naux,nrow,ncol)  aux,
integer  nrow,
integer  ncol,
integer  meqn,
integer  naux 
)

Take a grid patch with mesh widths hx,hy, of dimensions nrow by ncol, and set the values of any piece of of the patch which extends outside the physical domain using the boundary conditions.

Standard boundary condition choices for amr2ez in clawpack

At each boundary k = 1 (left), 2 (right), 3 (bottom), 4 (top):

mthbc(k) =

  • 0 for user-supplied BC's (must be inserted!)
  • 1 for zero-order extrapolation
  • 2 for periodic boundary conditions
  • 3 for solid walls, assuming this can be implemented by reflecting the data about the boundary and then negating the 2'nd (for k=1,2) or 3'rd (for k=3,4) component of q.
  • 5 for sphere bcs (left half maps to right half of same side, and vice versa), as if domain folded in half

The corners of the grid patch are at (xlo_patch,ylo_patch) – lower left corner (xhi_patch,yhi_patch) – upper right corner

The physical domain itself is a rectangle bounded by (xlower,ylower) – lower left corner (xupper,yupper) – upper right corner Any cells that lie outside the physical domain are ghost cells whose values should be set in this routine. This is tested for by comparing xlo_patch with xlower to see if values need to be set at the left and similarly at the other boundaries. Patches are guaranteed to have at least 1 row of cells filled with interior values so it is possible to extrapolate. Fix trimbd() if you want more than 1 row pre-set.

Make sure the order the boundaries are specified is correct so that diagonal corner cells are also properly taken care of.

Periodic boundaries are set before calling this routine, so if the domain is periodic in one direction only you can safely extrapolate in the other direction.

Don't overwrite ghost cells in periodic directions!

Parameters
valbigdata array for solution $q $ (cover the whole grid msrc)
auxdata array for auxiliary variables
nrownumber of cells in i direction on this grid
ncolnumber of cells in j direction on this grid
meqnnumber of equations for the system
nauxnumber of auxiliary variables
hxspacing (mesh size) in i direction
hyspacing (mesh size) in j direction
levelAMR level of this grid
timesetting ghost cell values at time time
xlo_patchleft bound of the input grid
xhi_patchright bound of the input grid
ylo_patchlower bound of the input grid
yhi_patchupper bound of the input grid

Definition at line 87 of file bc2amr.f.

Referenced by bound(), filrecur(), filval(), and saveqc().

Here is the caller graph for this function: