libyt Python Module¶
Import libyt Python Module¶
import libyt
Note
libyt Python module is only importable during simulation runtime.
Dictionaries¶
libyt_info¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
|
|
- |
|
|
|
- Compile with |
|
|
|
- Compile with |
|
|
|
- Compile with |
|
|
|
- Compile with |
param_yt¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Will be set to 1, if it’s not set. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Default value is 0. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Usage: Contain
ytparameters. The values correspond to data members inyt_param_yt.
param_user¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
input |
|
Usage: A series of key-value pairs set through
yt_set_UserParameter*. The pairs will also be added as new attributes ifyt_libytis imported.
hierarchy¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Usage: Contain AMR grid hierarchy. The values and
idare corresponding to data members inyt_grid.
grid_data¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
Field data |
|
|
Usage: It only contains data in local process. The value corresponds to data member
field_data.
particle_data¶
Key |
Value |
Loaded by |
Notes |
|---|---|---|---|
|
Particle data |
|
|
Usage: It only contains data in local process. The value corresponds to data member
particle_datainyt_grid.
grid_dataandparticle_datais read-only. They contain the actual simulation data.
Methods¶
derived_func¶
derived_func(gid : int,
fname : str) -> numpy.ndarray
Usage: Return derived field data
fnamein grid idgidgenerated by user-defined C function (See Derived Field). It is a local process and does not require other processes to join.
get_particle¶
get_particle(gid : int,
ptype : str,
attr : str) -> numpy.ndarray
Usage: Return particle
ptypeattributeattrdata in grid idgidgenerated by user-defined C function (See Get Particle Attribute Function). It is a local process and does not require other processes to join.
get_field_remote¶
get_field_remote(fname_list : list,
fname_list_len : int,
prepare_list : list,
prepare_list_len : int,
fetch_gid_list : list,
fetch_process_list : list,
fetch_gid_list_len : int) -> dict
Usage: Return a dictionary that contains requested field data. The data is scattered in different processes. It is a collective operation.
Attention
This is a collective operation, and it requires every MPI process to participate.
get_particle_remote¶
get_particle_remote(par_dict : dict,
par_dict : dict_keys,
prepare_list : list,
prepare_list_len : int,
fetch_gid_list : list,
fetch_process_list : list,
fetch_gid_list_len : int) -> dict
Usage: Return a dictionary that contains requested particle data. The data is scattered in different processes. It is a collective operation.
Attention
This is a collective operation, and it requires every MPI process to participate.
get_field_remoteandget_particle_remotemay be hard to use in general case, since we have to prepare those list by ourselves. We will improve this and make it general in the future.