Version 8 (modified by 12 years ago) ( diff ) | ,
---|
Back to BearEZ
RECURSIVE SUBROUTINE AMR (INTEGER level, REAL tstart, REAL tend)
Click here to view the v166 source.
Description
The main subroutine of the AMR algorithm, this subroutine is responsible for building the Forest of nodes that BearCLAW uses to run simulations. AMR()
is applied to one Forest level at a time using a time interval of [tstart, tend]
. A high-level view is as follows:
For n = 1 to CoarsenRatio(level):
- Set the timestep for each node of level
level
.
- Set up ghost cells for each
level
-level grid.
- If running in a multi-processor mode:
3a. Redistribute level's computation duties across CPUs. 3b. Wait for each processor to become available before proceeding.
- If
level+1
is not the maximum level, then:
4a. Perform error estimation across level. 4b. Create new child nodes (and accompanying sub-grids) based on error estimations for
level
.
- Find new maximum CFL and flag all nodes on level
level
for a timestep.
- If any new nodes have been created for
level+1
, then callAMR()
onlevel+1
.
- Perform finer-resolution calculations on children of
level
-level nodes and replace coarse estimates onlevel
-level nodes with averaged results.
END FOR
Note that AMR()
does not directly perform a timestep advancement on the system, but is instead called within the BEARstep() subroutine prior to advancing the problem's time.
For a PowerPoint presentation of this algorithm with pictures, click here.
INCLUDES:
None.
USES:
- nodeinfodef.f90 supplies the NodeInfo data structure and some functions that operate on it.
- treeops.f90 supplies the Node and Forest structures and accompanying methods, as well as the ApplyOn_ functions.
- mpi_exec.f90 supplies functions used to set up distributed processing (most of which tend to have MPI_ somewhere in the name).
- serial_exec.f90 supplies functions used for single-processor processing.
- beario.f90 provides some file IO functions.
- scheme module supplies time-stepping scheme.
- contrib/astro/problem.f90 Contains problem-specific variables and functions.