ppmd.cell module

class ppmd.cell.CellList(n_func, positions, domain)

Bases: object

Class to handle cell lists for a given domain.

property cell_array
property cell_contents_count
Returns

The cell contents count lookup

property cell_list
Returns

The held cell list.

property cell_reverse_lookup
Returns

The Reverse lookup map.

property cell_width

Return the cell width used to setup the cell structure. N.B. cells may be larger than this.

check()

Check if the cell_linked_list needs updating and update if required. :return:

create()
property domain
Returns

The domain used.

get_setup_parameters()

Get the values/function handles used to setup the cell list. :return:

halo_version_id

halo version id incremented when halo cell list is updated.

instance_id = 0
property max_cell_contents_count
property num_particles

Get the number of particles in the cell list

property offset

Get the offset required to find the starting position of the cells in the cell list.

Returns

int start of cells in cell list.

post_halo_exchange()
prepare_halo_sort(total_size)
reset_callbacks()
setup_callback_on_update(func)

Setup a function to be ran after the cell list if updated. :param func: Function to run. :return:

setup_pre_update(func)
setup_update_tracking(func)

Setup an automatic cell update. :param func:

sort()

Sort local particles into cell list. :return:

property total_num_particles

Number of local particles + halo particles.

trigger_update()

Trigger an update of the cell list.

version_id

Version id, incremented when the list is updated.

ppmd.cell.convert_offset_tuples(offsets, cell_array, remove_zero=False)
ppmd.cell.radius_cell_decompose(rc, rd, verbose=False)

returns list of cell offset tuples for cell sub-division with cell width rd matching a interaction cutoff rc.