add ITEM: DIMENSION to dump grid src/doc

This commit is contained in:
Steve Plimpton
2023-01-13 09:42:11 -07:00
parent 6a8df032b6
commit 9169d88090
2 changed files with 18 additions and 11 deletions

View File

@ -363,22 +363,25 @@ attributes is given below.
.. versionadded:: 22Dec2022
For style *grid* the extent of the Nx by Ny by Nz grid that overlays
the simulation domain is output with each snapshot:
For style *grid* the dimension and extent of the Nx by Ny by Nz grid
that overlays the simulation domain is also output with each snapshot:
.. parsed-literal::
ITEM: GRID EXTENT
ITEM: DIMENSION
dim
ITEM: GRID SIZE
nx ny nz
For 2d simulations, nz will be 1. There will also be an "ITEM: GRID
DATA" line which includes column descriptors for the per grid cell
data. Each subsequent line (Nx * Ny * Nz lines) will list the data
for a single grid cell. If grid cell IDs are included in the output
via the :doc:`compute property/grid <compute_property_grid>` command,
then the IDs will range from 1 to N = Nx*Ny*Nz. The ordering of IDs
is with the x index varying fastest, then the y index, and the z index
varying slowest.
Dim will be 2 or 3 for 2d or 3d simulations. For 2d simulations, nz
will be 1. There will also be an "ITEM: GRID DATA" line which
includes column descriptors for the per grid cell data. Each
subsequent line (Nx * Ny * Nz lines) will list the data for a single
grid cell. If grid cell IDs are included in the output via the
:doc:`compute property/grid <compute_property_grid>` command, then the
IDs will range from 1 to N = Nx*Ny*Nz. The ordering of IDs is with
the x index varying fastest, then the y index, and the z index varying
slowest.
For style *local*, local output generated by :doc:`computes <compute>`
and :doc:`fixes <fix>` is used to generate lines of output that is

View File

@ -377,6 +377,7 @@ void DumpGrid::header_binary(bigint ndump)
fwrite(&boxyhi,sizeof(double),1,fp);
fwrite(&boxzlo,sizeof(double),1,fp);
fwrite(&boxzhi,sizeof(double),1,fp);
fwrite(&domain->dimension,sizeof(int),1,fp);
fwrite(&nxgrid,sizeof(int),1,fp);
fwrite(&nygrid,sizeof(int),1,fp);
fwrite(&nzgrid,sizeof(int),1,fp);
@ -409,6 +410,7 @@ void DumpGrid::header_binary_triclinic(bigint ndump)
fwrite(&boxxy,sizeof(double),1,fp);
fwrite(&boxxz,sizeof(double),1,fp);
fwrite(&boxyz,sizeof(double),1,fp);
fwrite(&domain->dimension,sizeof(int),1,fp);
fwrite(&nxgrid,sizeof(int),1,fp);
fwrite(&nygrid,sizeof(int),1,fp);
fwrite(&nzgrid,sizeof(int),1,fp);
@ -438,6 +440,7 @@ void DumpGrid::header_item(bigint /*ndump*/)
"{:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e}\n",
boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi);
fmt::print(fp,"ITEM: DIMENSION\n{}\n",domain->dimension);
fmt::print(fp,"ITEM: GRID SIZE nx ny nz\n{} {} {}\n",nxgrid,nygrid,nzgrid);
fmt::print(fp,"ITEM: GRID CELLS {}\n",columns);
}
@ -458,6 +461,7 @@ void DumpGrid::header_item_triclinic(bigint /*ndump*/)
"{:>1.16e} {:>1.16e} {:>1.16e}\n"
"{:>1.16e} {:>1.16e} {:>1.16e}\n",
boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz);
fmt::print(fp,"ITEM: DIMENSION\n{}\n",domain->dimension);
fmt::print(fp,"ITEM: GRID SIZE nx ny nz\n{} {} {}\n",nxgrid,nygrid,nzgrid);
fmt::print(fp,"ITEM: GRID CELLS {}\n",columns);
}