2D AMRCLAW
Functions/Subroutines
intfil.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine intfil (val, mi, mj, time, flaguse, nrowst, ncolst, ilo, ihi, jlo, jhi, level, nvar, naux, msrc)
 Fill values for a patch at the specified level and location, using values from grids at level level ONLY! Leave cells that are not filled unchanged. More...
 
integer pure function iadd (ivar, i, j)
 
integer pure function iadnew (ivar, i, j)
 
integer pure function iadold (ivar, i, j)
 

Function/Subroutine Documentation

integer pure function intfil::iadd ( integer, intent(in)  ivar,
integer, intent(in)  i,
integer, intent(in)  j 
)

Definition at line 293 of file intfil.f90.

Referenced by basecheck(), bufnst2(), colate2(), conck(), drivesort(), iadd(), icall(), intcopy(), intfil(), preicall(), preintcopy(), update(), and valout().

Here is the caller graph for this function:

integer pure function intfil::iadnew ( integer, intent(in)  ivar,
integer, intent(in)  i,
integer, intent(in)  j 
)

Definition at line 299 of file intfil.f90.

Referenced by intfil().

Here is the caller graph for this function:

integer pure function intfil::iadold ( integer, intent(in)  ivar,
integer, intent(in)  i,
integer, intent(in)  j 
)

Definition at line 305 of file intfil.f90.

Referenced by intfil().

Here is the caller graph for this function:

subroutine intfil ( real(kind=8), dimension(nvar,mi,mj), intent(inout)  val,
integer, intent(in)  mi,
integer, intent(in)  mj,
real(kind=8), intent(in)  time,
integer(kind=1), dimension(ilo:ihi, jlo:jhi), intent(inout)  flaguse,
integer, intent(in)  nrowst,
integer, intent(in)  ncolst,
integer, intent(in)  ilo,
integer, intent(in)  ihi,
integer, intent(in)  jlo,
integer, intent(in)  jhi,
integer, intent(in)  level,
integer, intent(in)  nvar,
integer, intent(in)  naux,
integer, intent(in)  msrc 
)

Fill values for a patch at the specified level and location, using values from grids at level level ONLY! Leave cells that are not filled unchanged.

Search the intersection of a grid patch with corners at ilo,ihi, jlo,jhi and all grids mptr on level level. If there is a non-null intersection, copy the solution $q$ and auxiliary values from grid mptr into val array.

Assume called in correct order of levels, so that when copying is ok to overwrite.

It uses array, flaguse, to indicate whether each cell is filled. All cells outside computational domain will be marked as "used" as well and will be processed later by bc2amr() in filrecur().

Input:

  • a patch that needs to be filled
  • global indices that describe the patch to be filled
  • the grid msrc that might contain with the patch
  • relative position of the patch to grid msrc (nrowst, ncolst)

Output:

  • data array val that stores the new values
  • flagging array, flaguse that indicates whether a cell is filled

Algorithm

If msrc $ = -1 $, this patch is not associated with any grid. So the ''group of grids'', S, below contains all level level grids.

If msrc $ \neq -1 $, this patch is contained in grid msrc. So the ''group of grids'', S, below only contains level level grids that intersect with grid msrc. Size of S is smaller in this case.

procedure intfil()
for each grid mptr in a group of grids, S, do
if grid mptr intersect with the patch
if grid mptr has values at the time needed
copy values inside the intersection from grid mptr to val
mark cells in this intersection as "used"
else
interpolate from values on grid mptr at two different time
fill the intersection with interpolated values
mark cells in this intersection as "used"
end if
end if
end for
mark any portion of the patch that is out of whole computational domain as "used",
which will be processed by bc2amr elsewhere later
Parameters
valarray where values are copied to. The array covers the whole grid msrc
misize of val array in i direction
mjsize of val array in j direction
timesimulation time of the values in val array
flagusemarks indicating whether a position in val is filled
nrowstlocal i index (relative to lower-left corner of grid msrc) of the left-most cell of the patch to be filled
ncolstlocal j index (relative to lower-left corner of grid msrc) of the lower-most cell of the patch to be filled
iloglobal i index of left-most cell of the patch to be filled
ihiglobal i index of right-most cell of the patch to be filled
jloglobal j index of lower-most cell of the patch to be filled
jhiglobal j index of upper-most cell of the patch to be filled
levelThis patch is on level level
nvarnumber of equations for the system
nauxnumber of auxiliary variables
msrcindex of the grid that contains this patch

Definition at line 98 of file intfil.f90.

References iadd(), iadnew(), iadold(), and outtre().

Referenced by filrecur().

Here is the call graph for this function:

Here is the caller graph for this function: