libyt API
Procedure
It can break down into five stages:
- initialization,
- loading simulation data into Python1,
- do in situ analysis,
- reset,
- and finalization.
libyt API
| Stage | libyt API | Description |
|---|---|---|
| Initialization | yt_initialize | Initialize embedded Python and import inline Python script. |
| Loading data |
yt_set_Parameters, yt_set_UserParameter*
| Set yt parameters and user specific parameters. |
yt_get_FieldsPtr, yt_get_ParticlesPtr, yt_get_GridsPtr
| Get fields, particles, and grids information array (ptr), and write corresponding data in. | |
yt_commit | Tell libyt you're done. | |
| In situ analysis |
yt_run_Function, yt_run_FunctionArguments
| Run Python functions. |
yt_run_InteractiveMode | Activate interactive prompt. This is only available in interactive mode. | |
yt_run_ReloadScript | Enter reloading script phase. This is only available in interactive mode. | |
yt_run_JupyterKernel | Activate interactive prompt. This is only available in Jupyter kernel mode. | |
| Reset | yt_free | Free resources for in situ analysis. |
| Finalization | yt_finalize | Finalize libyt. |
-
Currently, libytonly supports loading simulation data with adaptive mesh refinement grid structure (AMR grid) to Python. We are trying to makelibytworks with more data structure. ↩