diff --git a/src/compute_property_grid.cpp b/src/compute_property_grid.cpp index 7624a3b4a9..730923c3b2 100644 --- a/src/compute_property_grid.cpp +++ b/src/compute_property_grid.cpp @@ -255,8 +255,8 @@ void ComputePropertyGrid::allocate_grid() } else { grid3d = new Grid3d(lmp, world, nxgrid, nygrid, nzgrid); - grid3d->setup_grid(nxlo_in, nxhi_in, nylo_in, nyhi_in, nzlo_in, nzhi_in, - nxlo_out, nxhi_out, nylo_out, nyhi_out, nzlo_out, nzhi_out); + grid3d->setup_grid(nxlo_in, nxhi_in, nylo_in, nyhi_in, nzlo_in, nzhi_in, nxlo_out, nxhi_out, + nylo_out, nyhi_out, nzlo_out, nzhi_out); if (nvalues == 1) memory->create3d_offset(vec3d, nzlo_out, nzhi_out, nylo_out, nyhi_out, nxlo_out, nxhi_out, "property/grid:vec3d"); @@ -342,13 +342,11 @@ void ComputePropertyGrid::pack_proc(int n) if (nvalues == 1) { for (int iz = nzlo_in; iz <= nzhi_in; iz++) for (int iy = nylo_in; iy <= nyhi_in; iy++) - for (int ix = nxlo_in; ix <= nxhi_in; ix++) - vec3d[iz][iy][ix] = me; + for (int ix = nxlo_in; ix <= nxhi_in; ix++) vec3d[iz][iy][ix] = me; } else { for (int iz = nzlo_in; iz <= nzhi_in; iz++) for (int iy = nylo_in; iy <= nyhi_in; iy++) - for (int ix = nxlo_in; ix <= nxhi_in; ix++) - array3d[iz][iy][ix][n] = me; + for (int ix = nxlo_in; ix <= nxhi_in; ix++) array3d[iz][iy][ix][n] = me; } } } @@ -452,7 +450,7 @@ template void ComputePropertyGrid::pack_coords(int } } - // only for coords which are triclinic AND unscaled + // only for coords which are triclinic AND unscaled } else { @@ -462,11 +460,15 @@ template void ComputePropertyGrid::pack_coords(int if (nvalues == 1) { for (int iy = nylo_in; iy <= nyhi_in; iy++) { - if (POS == LOW) lamda[1] = iy * dy; - else lamda[1] = (iy + 0.5) * dy; + if (POS == LOW) + lamda[1] = iy * dy; + else + lamda[1] = (iy + 0.5) * dy; for (int ix = nxlo_in; ix <= nxhi_in; ix++) { - if (POS == LOW) lamda[0] = ix * dx; - else lamda[0] = (ix + 0.5) * dx; + if (POS == LOW) + lamda[0] = ix * dx; + else + lamda[0] = (ix + 0.5) * dx; domain->lamda2x(lamda, xone); if (IDIM == 0) vec2d[iy][ix] = xone[0]; if (IDIM == 1) vec2d[iy][ix] = xone[1]; @@ -475,11 +477,15 @@ template void ComputePropertyGrid::pack_coords(int } else { for (int iy = nylo_in; iy <= nyhi_in; iy++) { - if (POS == LOW) lamda[1] = iy * dy; - else lamda[1] = (iy + 0.5) * dy; + if (POS == LOW) + lamda[1] = iy * dy; + else + lamda[1] = (iy + 0.5) * dy; for (int ix = nxlo_in; ix <= nxhi_in; ix++) { - if (POS == LOW) lamda[0] = ix * dx; - else lamda[0] = (ix + 0.5) * dx; + if (POS == LOW) + lamda[0] = ix * dx; + else + lamda[0] = (ix + 0.5) * dx; domain->lamda2x(lamda, xone); if (IDIM == 0) array2d[iy][ix][n] = xone[0]; if (IDIM == 1) array2d[iy][ix][n] = xone[1]; @@ -488,7 +494,7 @@ template void ComputePropertyGrid::pack_coords(int } } - // 3d grid + // 3d grid } else if (dimension == 3) { @@ -542,7 +548,7 @@ template void ComputePropertyGrid::pack_coords(int } } - // only for coords which are triclinic AND unscaled + // only for coords which are triclinic AND unscaled } else { @@ -552,14 +558,20 @@ template void ComputePropertyGrid::pack_coords(int if (nvalues == 1) { for (int iz = nzlo_in; iz <= nzhi_in; iz++) { - if (POS == LOW) lamda[2] = iz * dz; - else lamda[2] = (iz + 0.5) * dz; + if (POS == LOW) + lamda[2] = iz * dz; + else + lamda[2] = (iz + 0.5) * dz; for (int iy = nylo_in; iy <= nyhi_in; iy++) { - if (POS == LOW) lamda[1] = iy * dy; - else lamda[1] = (iy + 0.5) * dy; + if (POS == LOW) + lamda[1] = iy * dy; + else + lamda[1] = (iy + 0.5) * dy; for (int ix = nxlo_in; ix <= nxhi_in; ix++) { - if (POS == LOW) lamda[0] = ix * dx; - else lamda[0] = (ix + 0.5) * dx; + if (POS == LOW) + lamda[0] = ix * dx; + else + lamda[0] = (ix + 0.5) * dx; domain->lamda2x(lamda, xone); if (IDIM == 0) vec3d[iz][iy][ix] = xone[0]; if (IDIM == 1) vec3d[iz][iy][ix] = xone[1]; @@ -570,14 +582,20 @@ template void ComputePropertyGrid::pack_coords(int } else { for (int iz = nzlo_in; iz <= nzhi_in; iz++) { - if (POS == LOW) lamda[2] = iz * dz; - else lamda[2] = (iz + 0.5) * dz; + if (POS == LOW) + lamda[2] = iz * dz; + else + lamda[2] = (iz + 0.5) * dz; for (int iy = nylo_in; iy <= nyhi_in; iy++) { - if (POS == LOW) lamda[1] = iy * dy; - else lamda[1] = (iy + 0.5) * dy; + if (POS == LOW) + lamda[1] = iy * dy; + else + lamda[1] = (iy + 0.5) * dy; for (int ix = nxlo_in; ix <= nxhi_in; ix++) { - if (POS == LOW) lamda[0] = ix * dx; - else lamda[0] = (ix + 0.5) * dx; + if (POS == LOW) + lamda[0] = ix * dx; + else + lamda[0] = (ix + 0.5) * dx; domain->lamda2x(lamda, xone); if (IDIM == 0) array3d[iz][iy][ix][n] = xone[0]; if (IDIM == 1) array3d[iz][iy][ix][n] = xone[1]; diff --git a/src/fix_ave_grid.h b/src/fix_ave_grid.h index 39a38089e8..23c6ccc253 100644 --- a/src/fix_ave_grid.h +++ b/src/fix_ave_grid.h @@ -48,7 +48,7 @@ class FixAveGrid : public Fix { double memory_usage() override; private: - int nxgrid,nygrid,nzgrid; + int nxgrid, nygrid, nzgrid; int nvalues; int nrepeat, irepeat; bigint nvalid, nvalid_last; @@ -57,14 +57,14 @@ class FixAveGrid : public Fix { double maxdist; int running_count; - int window_count,window_oldest,window_newest; + int window_count, window_oldest, window_newest; int biasflag; char *id_bias; class Compute *tbias; // ptr to additional bias compute - double adof,cdof; + double adof, cdof; - int dimension,triclinic; + int dimension, triclinic; int *which, *argindex; char **ids; @@ -75,26 +75,26 @@ class FixAveGrid : public Fix { int ngrid_buf1, ngrid_buf2; double *grid_buf1, *grid_buf2; - int nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in; - int nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out; + int nxlo_in, nxhi_in, nylo_in, nyhi_in, nzlo_in, nzhi_in; + int nxlo_out, nxhi_out, nylo_out, nyhi_out, nzlo_out, nzhi_out; int ngridout; struct GridData { - double **vec2d,***vec3d; - double ***array2d,****array3d; - double **count2d,***count3d; + double **vec2d, ***vec3d; + double ***array2d, ****array3d; + double **count2d, ***count3d; }; GridData *grid_output; - GridData *grid_sample,*grid_nfreq,*grid_running; + GridData *grid_sample, *grid_nfreq, *grid_running; GridData **grid_window; // old grid data for remap operation class Grid2d *grid2d_previous; class Grid3d *grid3d_previous; - int nxlo_out_previous,nylo_out_previous,nzlo_out_previous; - GridData *grid_sample_previous,*grid_nfreq_previous,*grid_running_previous; + int nxlo_out_previous, nylo_out_previous, nzlo_out_previous; + GridData *grid_sample_previous, *grid_nfreq_previous, *grid_running_previous; GridData **grid_window_previous; int **bin;