yt_getGridInfo_* – Look Up Data¶
These APIs simply look up hierarchy array constructed by
libytor look up data pointer that is passed in by user and wrapped bylibyt.
These APIs are only available after
yt_commitis called.
yt_getGridInfo_Dimensions¶
int yt_getGridInfo_Dimensions( const long gid, int (*dimensions)[3] );
Usage: Get dimension of grid
gid.dimensions[0]corresponds to dimension in x-axis,dimensions[1]corresponds to dimension in y-axis, anddimensions[2]corresponds to dimension in z-axis, excluding ghost cells.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_LeftEdge¶
int yt_getGridInfo_LeftEdge(const long gid, double (*left_edge)[3]);
Usage: Get left edge of grid
gid.left_edge[0]is left edge of the grid in x-axis in code length,left_edge[1]for y-axis, andleft_edge[2]for z-axis.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_RightEdge¶
int yt_getGridInfo_RightEdge(const long gid, double (*right_edge)[3]);
Usage: Get right edge of grid
gid.right_edge[0]is right edge of the grid in x-axis in code length,right_edge[1]for y-axis, andright_edge[2]for z-axis.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_ParentId¶
int yt_getGridInfo_ParentId(const long gid, long *parent_id);
Usage: Get parent grid id of grid
gid. If there is no parent grid,parent_idwill be-1.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_Level¶
int yt_getGridInfo_Level(const long gid, int *level);
Usage: Get level of grid
gid. If grids are on root level,levelwill be0.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_ProcNum¶
int yt_getGridInfo_ProcNum(const long gid, int *proc_num);
Usage: Get MPI process number (MPI rank) of grid
gidlocated on.Return:
YT_SUCCESSorYT_FAIL
yt_getGridInfo_ParticleCount¶
int yt_getGridInfo_ParticleCount(const long gid, const char *ptype, long *par_count);
Usage: Get number of particle
ptypelocated on gridgid.Return:
YT_SUCCESSorYT_FAIL
Particle type name
ptypeshould be same as what you passed inyt_get_ParticlesPtr.
yt_getGridInfo_FieldData¶
int yt_getGridInfo_FieldData(const long gid, const char *field_name, yt_data *field_data);
Usage: Get the field data
field_namein grid idgid. The result will be stored infield_data.Return:
YT_SUCCESSorYT_FAILif it cannot get data.yt_datadata_ptr: Data pointer.data_dimensions[3]: Dimension of thedata_ptrarray, in the point of view of itself.data_dtype: Data type of the array.
Field name
field_nameshould be same as what you passed inyt_get_FieldsPtr.
Do not mix grid dimensions in
yt_getGridInfo_Dimensionswith data dimensions get throughyt_getGridInfo_FieldData. Grid dimensions are numbers of cells in [x][y][z] <–> [0][1][2], excluding ghost cells. Whereas data dimensions are just data length in data’s point of view, which may consist of ghost cells.
You should not modify
data_ptr, because they are actual simulation data passed in by user when setting grid informationyt_get_GridsPtr.
yt_getGridInfo_ParticleData¶
int yt_getGridInfo_ParticleData(const long gid, const char *ptype, const char *attr, yt_data *par_data);
Usage: Get the particle data
ptypeattributeattrin grid idgid. The result will be stored inpar_data.Return:
YT_SUCCESSorYT_FAILif it cannot get data.yt_datadata_ptr: Data pointer.data_dimensions[3]: Dimension of thedata_ptrarray, in the point of view of itself. Ifdata_ptris a 1-dim array, the last two elements will be 0.data_dtype: Data type of the array.
Particle type
ptypeand attributeattrshould be the same as what you passed inyt_get_ParticlesPtr.
You should not modify
data_ptr, because they are actual simulation data passed in by user when setting grid informationyt_get_GridsPtr.