An AMR grid.
Levels are stored in the levels attribute, which is a list of hyperion.grid.amr_grid.Level objects, which in turn contain a grids attribute which is a list of Grid objects.
Levels can be added with:
level = amr.add_level()
And grids can be added to a level with:
grid = level.add_grid()
Grid objects have the following attributes which should be set:
- xmin - lower x position of the grid
- xmax - upper x position of the grid
- ymin - lower y position of the grid
- ymax - upper y position of the grid
- zmin - lower z position of the grid
- zmax - upper z position of the grid
- nx - number of cells in x direction
- ny - number of cells in y direction
- nz - number of cells in z direction
- quantities - a dictionary containing physical quantities (see below)
AMRGrid objects may contain multiple quantities (e.g. density, specific energy). To access these, you can specify the name of the quantity as an item:
>>> grid['density']
which is no longer an AMRGrid object, but a AMRGridView object. When setting this for the first time, this can be set either to another AMRGridView object, an external h5py link, or an empty list. For example, the following should work:
>>> grid['density_new'] = grid['density']
AMRGridView objects allow the specific dust population to be selected as an index:
>>> grid['density'][0]
Which is also an AMRGridView object.
Methods
read(group[, quantities]) | Read the geometry and physical quantities from an AMR grid |
read_geometry(group) | Read in geometry information from an AMR grid |
read_quantities(group[, quantities]) | Read in physical quantities from an AMR grid |
write(group[, quantities, copy, ...]) | Write out the AMR grid |
write_single_array(group, name, amr_grid[, ...]) | Write out a single quantity, checking for consistency with geometry |
add_derived_quantity(name, function) |
Methods (detail)
Read the geometry and physical quantities from an AMR grid
Parameters : | group : h5py.Group
quantities : ‘all’ or list
|
---|
Read in geometry information from an AMR grid
Parameters : | group : h5py.Group
|
---|
Read in physical quantities from an AMR grid
Parameters : | group : h5py.Group
quantities : ‘all’ or list
|
---|
Write out the AMR grid
Parameters : | group : h5py.Group
quantities : ‘all’ or list
copy : bool
absolute_paths : bool
compression : bool
wall_dtype : type
physics_dtype : type
|
---|
Write out a single quantity, checking for consistency with geometry
Parameters : | group : h5py.Group
name : str
amr_grid : AMRGridView
copy : bool
absolute_paths : bool
compression : bool
wall_dtype : type
physics_dtype : type
|
---|
Methods
append(amr_grid_view) | Used to append quantities from another grid |
add(amr_grid_view) | Used to add quantities from another grid |
Methods (detail)
Used to append quantities from another grid
Parameters : | amr_grid : AMRGridView instance
|
---|
Used to add quantities from another grid
Parameters : | amr_grid : AMRGridView instance
|
---|