Cleaning coord and coordp vectors in compute_stress_mop_profile.cpp
This commit is contained in:
committed by
GitHub
parent
ad3752431f
commit
dc1eb43cf2
@ -258,7 +258,7 @@ void ComputeStressMopProfile::compute_array()
|
|||||||
MPI_Allreduce(&bond_local[0][0],&bond_global[0][0],nbins*nvalues,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(&bond_local[0][0],&bond_global[0][0],nbins*nvalues,MPI_DOUBLE,MPI_SUM,world);
|
||||||
|
|
||||||
for (int ibin=0; ibin<nbins; ibin++) {
|
for (int ibin=0; ibin<nbins; ibin++) {
|
||||||
array[ibin][0] = coord[ibin][0];
|
array[ibin][0] = coord[ibin];
|
||||||
|
|
||||||
int mo = 1;
|
int mo = 1;
|
||||||
int m = 0;
|
int m = 0;
|
||||||
@ -358,8 +358,8 @@ void ComputeStressMopProfile::compute_pairs()
|
|||||||
if (newton_pair || j < nlocal) {
|
if (newton_pair || j < nlocal) {
|
||||||
|
|
||||||
for (ibin=0;ibin<nbins;ibin++) {
|
for (ibin=0;ibin<nbins;ibin++) {
|
||||||
pos = coord[ibin][0];
|
pos = coord[ibin];
|
||||||
pos1 = coordp[ibin][0];
|
pos1 = coordp[ibin];
|
||||||
|
|
||||||
//check if ij pair is across plane, add contribution to pressure
|
//check if ij pair is across plane, add contribution to pressure
|
||||||
|
|
||||||
@ -385,8 +385,8 @@ void ComputeStressMopProfile::compute_pairs()
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (ibin=0;ibin<nbins;ibin++) {
|
for (ibin=0;ibin<nbins;ibin++) {
|
||||||
pos = coord[ibin][0];
|
pos = coord[ibin];
|
||||||
pos1 = coordp[ibin][0];
|
pos1 = coordp[ibin];
|
||||||
|
|
||||||
//check if ij pair is across plane, add contribution to pressure
|
//check if ij pair is across plane, add contribution to pressure
|
||||||
|
|
||||||
@ -447,8 +447,8 @@ void ComputeStressMopProfile::compute_pairs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ibin = 0; ibin < nbins; ibin++) {
|
for (ibin = 0; ibin < nbins; ibin++) {
|
||||||
pos = coord[ibin][0];
|
pos = coord[ibin];
|
||||||
pos1 = coordp[ibin][0];
|
pos1 = coordp[ibin];
|
||||||
|
|
||||||
if (((xi[dir]-pos)*(xj[dir]-pos)*(xi[dir]-pos1)*(xj[dir]-pos1)<0)) {
|
if (((xi[dir]-pos)*(xj[dir]-pos)*(xi[dir]-pos1)*(xj[dir]-pos1)<0)) {
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ void ComputeStressMopProfile::compute_bonds()
|
|||||||
if (btype <= 0) continue;
|
if (btype <= 0) continue;
|
||||||
|
|
||||||
for (int ibin = 0; ibin<nbins; ibin++) {
|
for (int ibin = 0; ibin<nbins; ibin++) {
|
||||||
double pos = coord[ibin][0];
|
double pos = coord[ibin];
|
||||||
|
|
||||||
// minimum image of atom1 with respect to the plane of interest
|
// minimum image of atom1 with respect to the plane of interest
|
||||||
dx[0] = x[atom1][0];
|
dx[0] = x[atom1][0];
|
||||||
@ -642,8 +642,8 @@ void ComputeStressMopProfile::setup_bins()
|
|||||||
nbins = static_cast<int> ((hi-lo) * invdelta + 1.5);
|
nbins = static_cast<int> ((hi-lo) * invdelta + 1.5);
|
||||||
|
|
||||||
//allocate bin arrays
|
//allocate bin arrays
|
||||||
memory->create(coord,nbins,1,"stress/mop/profile:coord");
|
memory->create(coord,nbins,"stress/mop/profile:coord");
|
||||||
memory->create(coordp,nbins,1,"stress/mop/profile:coordp");
|
memory->create(coordp,nbins,"stress/mop/profile:coordp");
|
||||||
memory->create(values_local,nbins,nvalues,"stress/mop/profile:values_local");
|
memory->create(values_local,nbins,nvalues,"stress/mop/profile:values_local");
|
||||||
memory->create(values_global,nbins,nvalues,"stress/mop/profile:values_global");
|
memory->create(values_global,nbins,nvalues,"stress/mop/profile:values_global");
|
||||||
memory->create(bond_local,nbins,nvalues,"stress/mop/profile:bond_local");
|
memory->create(bond_local,nbins,nvalues,"stress/mop/profile:bond_local");
|
||||||
@ -652,11 +652,11 @@ void ComputeStressMopProfile::setup_bins()
|
|||||||
|
|
||||||
// set bin coordinates
|
// set bin coordinates
|
||||||
for (i = 0; i < nbins; i++) {
|
for (i = 0; i < nbins; i++) {
|
||||||
coord[i][0] = offset + i*delta;
|
coord[i] = offset + i*delta;
|
||||||
if (coord[i][0] < (domain->boxlo[dir]+domain->prd_half[dir])) {
|
if (coord[i] < (domain->boxlo[dir]+domain->prd_half[dir])) {
|
||||||
coordp[i][0] = coord[i][0] + domain->prd[dir];
|
coordp[i] = coord[i] + domain->prd[dir];
|
||||||
} else {
|
} else {
|
||||||
coordp[i][0] = coord[i][0] - domain->prd[dir];
|
coordp[i] = coord[i] - domain->prd[dir];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user