Fixing typos
This commit is contained in:
@ -158,7 +158,7 @@ void CommBrick::setup()
|
||||
// for multi:
|
||||
// cutghostmulti = same as cutghost, only for each atom type
|
||||
|
||||
int i;
|
||||
int i,j;
|
||||
int ntypes = atom->ntypes;
|
||||
double *prd,*sublo,*subhi;
|
||||
|
||||
@ -175,14 +175,23 @@ void CommBrick::setup()
|
||||
|
||||
if (mode == Comm::MULTI) {
|
||||
if (multi2) {
|
||||
// If using multi2 binlists, use the itype-itype interaction distance for communication
|
||||
// If using multi2 binlists, communicate itype particles a distance
|
||||
// equal to the max of itype-jtype interaction given smaller jtype particles
|
||||
double **cutneighsq = neighbor->cutneighsq;
|
||||
double *cuttypesq = neighbor->cuttypesq;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
cut = 0.0;
|
||||
if (cutusermulti) cut = cutusermulti[i];
|
||||
cutghostmulti[i][0] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][1] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][2] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
if (cutusermulti) {
|
||||
cutghostmulti[i][0] = cutusermulti[i];
|
||||
cutghostmulti[i][1] = cutusermulti[i];
|
||||
cutghostmulti[i][2] = cutusermulti[i];
|
||||
}
|
||||
for (j = 1; j <= ntypes; j++){
|
||||
if(cuttypesq[j] > cuttypesq[i]) continue;
|
||||
cutghostmulti[i][0] = MAX(cutghostmulti[i][0],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][1] = MAX(cutghostmulti[i][1],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][2] = MAX(cutghostmulti[i][2],sqrt(cutneighsq[i][j]));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If using a single binlist, use the max itype-jtype interaction distance for communication
|
||||
@ -212,14 +221,27 @@ void CommBrick::setup()
|
||||
|
||||
if (mode == Comm::MULTI) {
|
||||
if (multi2) {
|
||||
// If using multi2 binlists, use the itype-itype interaction distance for communication
|
||||
// If using multi2 binlists, communicate itype particles a distance
|
||||
// equal to the max of itype-jtype interaction given smaller jtype particles
|
||||
double **cutneighsq = neighbor->cutneighsq;
|
||||
double *cuttypesq = neighbor->cuttypesq;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
cut = 0.0;
|
||||
if (cutusermulti) cut = cutusermulti[i];
|
||||
cutghostmulti[i][0] = length0 * MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][1] = length1 * MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][2] = length2 * MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
if (cutusermulti) {
|
||||
cutghostmulti[i][0] = cutusermulti[i];
|
||||
cutghostmulti[i][1] = cutusermulti[i];
|
||||
cutghostmulti[i][2] = cutusermulti[i];
|
||||
}
|
||||
for (j = 1; j <= ntypes; j++){
|
||||
if(cuttypesq[j] > cuttypesq[i]) continue;
|
||||
cutghostmulti[i][0] = MAX(cutghostmulti[i][0],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][1] = MAX(cutghostmulti[i][1],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][2] = MAX(cutghostmulti[i][2],sqrt(cutneighsq[i][j]));
|
||||
}
|
||||
|
||||
cutghostmulti[i][0] *= length0;
|
||||
cutghostmulti[i][1] *= length1;
|
||||
cutghostmulti[i][2] *= length2;
|
||||
}
|
||||
} else {
|
||||
// If using a single binlist, use the max itype-jtype interaction distance for communication
|
||||
|
||||
@ -177,14 +177,23 @@ void CommTiled::setup()
|
||||
if (mode == Comm::MULTI) {
|
||||
double cut;
|
||||
if (multi2) {
|
||||
// If using multi2 binlists, use the itype-itype interaction distance for communication
|
||||
// If using multi2 binlists, communicate itype particles a distance
|
||||
// equal to the max of itype-jtype interaction given smaller jtype particles
|
||||
double **cutneighsq = neighbor->cutneighsq;
|
||||
double *cuttypesq = neighbor->cuttypesq;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
cut = 0.0;
|
||||
if (cutusermulti) cut = cutusermulti[i];
|
||||
cutghostmulti[i][0] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][1] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
cutghostmulti[i][2] = MAX(cut,sqrt(cutneighsq[i][i]));
|
||||
if (cutusermulti) {
|
||||
cutghostmulti[i][0] = cutusermulti[i];
|
||||
cutghostmulti[i][1] = cutusermulti[i];
|
||||
cutghostmulti[i][2] = cutusermulti[i];
|
||||
}
|
||||
for (j = 1; j <= ntypes; j++){
|
||||
if(cuttypesq[j] > cuttypesq[i]) continue;
|
||||
cutghostmulti[i][0] = MAX(cutghostmulti[i][0],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][1] = MAX(cutghostmulti[i][1],sqrt(cutneighsq[i][j]));
|
||||
cutghostmulti[i][2] = MAX(cutghostmulti[i][2],sqrt(cutneighsq[i][j]));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If using a single binlist, use the max itype-jtype interaction distance for communication
|
||||
|
||||
@ -324,6 +324,7 @@ void NStencil::create_setup()
|
||||
stencil_multi2[i] = new int*[n+1]();
|
||||
for (j = 1; j <= n; ++j) {
|
||||
maxstencil_multi2[i][j] = 0;
|
||||
nstencil_multi2[i][j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ void NStencilFullMulti22d::create()
|
||||
mbinx = stencil_mbinx_multi2[itype][jtype];
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[i][j];
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ void NStencilFullMulti23d::create()
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
mbinz = stencil_mbinz_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[i][j];
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ void NStencilHalfMulti22d::set_stencil_properties()
|
||||
|
||||
void NStencilHalfMulti22d::create()
|
||||
{
|
||||
int itype, jtype, i, j, ns;
|
||||
int itype, jtype, bin_type, i, j, ns;
|
||||
int n = atom->ntypes;
|
||||
double cutsq;
|
||||
|
||||
@ -88,19 +88,21 @@ void NStencilHalfMulti22d::create()
|
||||
mbinx = stencil_mbinx_multi2[itype][jtype];
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
if (stencil_half[itype][jtype]) {
|
||||
for (j = 0; j <= sy; j++)
|
||||
for (i = -sx; i <= sx; i++)
|
||||
if (j > 0 || (j == 0 && i > 0)) {
|
||||
if (bin_distance(i,j,0) < cutsq)
|
||||
if (bin_distance_multi2(i,j,0,bin_type) < cutsq)
|
||||
stencil_multi2[itype][jtype][ns++] = j*mbinx + i;
|
||||
}
|
||||
} else {
|
||||
for (j = -sy; j <= sy; j++)
|
||||
for (i = -sx; i <= sx; i++)
|
||||
if (bin_distance(i,j,0) < cutsq)
|
||||
if (bin_distance_multi2(i,j,0,bin_type) < cutsq)
|
||||
stencil_multi2[itype][jtype][ns++] = j*mbinx + i;
|
||||
}
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ void NStencilHalfMulti22dTri::create()
|
||||
mbinx = stencil_mbinx_multi2[itype][jtype];
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[i][j];
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ void NStencilHalfMulti23d::create()
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
mbinz = stencil_mbinz_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[i][j];
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ void NStencilHalfMulti23dTri::create()
|
||||
mbiny = stencil_mbiny_multi2[itype][jtype];
|
||||
mbinz = stencil_mbinz_multi2[itype][jtype];
|
||||
|
||||
bin_type = stencil_bin_type[i][j];
|
||||
bin_type = stencil_bin_type[itype][jtype];
|
||||
|
||||
cutsq = stencil_cut[itype][jtype];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user