Name: TaskAMR
Owner: Los Alamos National Laboratory
Description: null
Created: 2018-05-14 15:54:32.0
Updated: 2018-05-15 18:44:33.0
Pushed: 2018-05-24 18:10:33.0
Homepage: null
Size: 81
Language: Rouge
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Adaptive Mesh Refinement for Finite Volumes using Legion
C18035 - TaskAMR has been acknowledged by NNSA for open source release. Please read the License.
git clone git@gitlab.com:StanfordLegion/legion.git
cd legion/language/
./install.py --debug
--debug
../regent.py ./examples/circuit.rg
.model.rg
sf linear_advection.rg model.rg
un -n 4 <PATH_TO>/regent.py ./1d_fix.rg
alyze_linear.py linear.80.txt
global_const.rg
requires the settings:
S_PER_BLOCK_X = -- must be multiple of 2 for AMR
L_1_BLOCKS_X = -- number of blocks at coarsest level
REFINEMENT_LEVEL = -- every level above 1 doubles max resolution
PARTITIONS = -- how many parallel pieces to break problem into (suggestion)
TH_X = -- DX = LENGTH_X / NX
NAL == -- simulation ends at T_FINAL <= time < T_FINAL + DT
These settings are shared with the AMR version. For fix-grid calculations, the resolution is fixed at
CELLS_PER_BLOCK_X * LEVEL_1_BLOCKS_X * 2 ** (MAX_REFINEMENT_LEVEL - 1)
.
linear_constants.rg
requires the settings:
-- velocity for linear advection
-- fixed time step
ce CellValues = -- Do not change these
ce FaceValues = -- Do not change these
In linear_advection.rg
, the task initializeCells()
can be altered to change the initial conditions.
model.rg
sf euler.rg model.rg
global_const.rg
:NAL = 0.142681382
un -n 4 <PATH_TO>/regent.py ./1d_fix.rg
global_const.rg
:S_PER_BLOCK_X = 32
un -n 4 <PATH_TO>/regent.py ./1d_fix.rg
alyze_euler.py euler.80.txt euler.1280.txt
global_const.rg
settings are the same as for linear advection.
euler.rg
requires the settings:
A = -- ratio of specific heats for ideal gas equation of state
-- fixed time step
ce CellValues = -- Do not change these
ce FaceValues = -- Do not change these
In euler.rg
, the task initializeCells()
can be altered to change the initial conditions.
model.rg
and model_amr.rg
sf linear_advection.rg model.rg
sf linear_advection_amr.rg model_amr.rg
un -n 4 <PATH_TO>/regent.py ./1d_amr.rg
alyze_amr_linear.py linear_amr.*.txt
global_const.rg
settings are the same as for fixed-grid linear advection
with the exception that LENGTH_X / (CELLS_PER_BLOCK_X * LEVEL_1_BLOCKS_X * 2 ** (MAX_REFINEMENT_LEVEL - 1))
is now the minimum grid size instead
of the fixed grid size.
linear_constants.rg
settings are the same as for fixed-grid linear advection.
Initial conditions settings are the same as for fixed-grid linear advection.
To run the linear fixed-grid convergence test:
st_linear.py
To run the euler fixed-grid convergence test:
st_euler.py
To run the linear AMR-grid convergence test:
st_linear_amr.py
To run the unit tests for AMR grid refinement and coarsening:
un -n 4 <PATH_TO>/regent.py ./unit_tests.rg
global_const.rg
is required:
S_PER_BLOCK_X = -- must be multiple of 2
L_1_BLOCKS_X = -- number of blocks at coarsest level
REFINEMENT_LEVEL = -- every level above 1 doubles max resolution
PARTITIONS = -- how many parallel pieces to break problem into (suggestion)
-- fixed time step
TH_X = -- DX = LENGTH_X / NX
NAL == -- simulation ends at T_FINAL <= time < T_FINAL + DT
These settings are shared with the AMR version. For fix-grid calculations, the resolution is fixed at
CELLS_PER_BLOCK_X * LEVEL_1_BLOCKS_X * 2 ** (MAX_REFINEMENT_LEVEL - 1)
.
ce CellValues
ce FaceValues
model.rg
must implement following API:
initializeCells(num_cells : int64,
cell_region: region(ispace(int1d), CellValues))
calculateFlux(num_cells : int64,
dx : double,
dt : double,
blocks: region(ispace(int1d), RefinementBits),
bloated_cells: region(ispace(int1d), CellValues),
faces: region(ispace(int1d), FaceValues))
applyFlux(dx : double,
dt : double,
blocks: region(ispace(int1d), RefinementBits),
cells: region(ispace(int1d), CellValues),
faces: region(ispace(int1d), FaceValues))
writeCells(nx : int64,
cells: region(ispace(int1d), CellValues))
writeCells()
.model_amr.rg
must implement following API: calculateGradient(num_cells : int64,
dx : double,
bloated_cells: region(ispace(int1d), CellValues),
faces: region(ispace(int1d), FaceValues))
task flagRegrid(blocks: region(ispace(int1d), RefinementBits),
faces: region(ispace(int1d), FaceValues))
task interpolateToChildren(num_children: int64,
blocks: region(ispace(int1d), RefinementBits),
ghost_parents: region(ispace(int1d), CellValues),
ghost_children: region(ispace(int1d), CellValues),
children: region(ispace(int1d), CellValues))
task smoothGrid(blocks: region(ispace(int1d), RefinementBits))
task updateRefinement(num_blocks: int64,
blocks: region(ispace(int1d), RefinementBits),
cells: region(ispace(int1d), CellValues),
ghosts: region(ispace(int1d), RefinementBits),
children: region(ispace(int1d), RefinementBits),
child_cells: region(ispace(int1d), CellValues),
ghost_children: region(ispace(int1d), RefinementBits))
task writeAMRCells(ncells : int64,
blocks: region(ispace(int1d), RefinementBits),
cells: region(ispace(int1d), CellValues))
task printAMRCells(level : int64,
blocks: region(ispace(int1d), RefinementBits),
cells: region(ispace(int1d), CellValues))
task copyToChildren(blocks: region(ispace(int1d), RefinementBits),
cells: region(ispace(int1d), CellValues),
children: region(ispace(int1d), CellValues))
task calculateAMRFlux(num_cells : int64,
dx : double,
dt : double,
blocks: region(ispace(int1d), RefinementBits),
bloated_cells: region(ispace(int1d), CellValues),
bloated_children: region(ispace(int1d), CellValues),
faces: region(ispace(int1d), FaceValues))
task calculateAMRGradient(num_cells : int64,
dx : double,
blocks: region(ispace(int1d), RefinementBits),
bloated_cells: region(ispace(int1d), CellValues),
bloated_children: region(ispace(int1d), CellValues),
faces: region(ispace(int1d), FaceValues))