mirror of https://github.com/lammps/lammps.git
must skip corresponding per-atom data accumulation if compute_flag for pair or kspace is 0
This commit is contained in:
parent
2371db3242
commit
799b676f89
|
@ -177,7 +177,7 @@ void ComputeCentroidStressAtom::compute_peratom()
|
|||
|
||||
// per-atom virial and per-atom centroid virial are the same for two-body
|
||||
// many-body pair styles not yet implemented
|
||||
if (pairflag && force->pair) {
|
||||
if (pairflag && force->pair && force->pair->compute_flag) {
|
||||
if (force->pair->centroidstressflag & 2) {
|
||||
double **cvatom = force->pair->cvatom;
|
||||
for (i = 0; i < npair; i++)
|
||||
|
@ -226,7 +226,7 @@ void ComputeCentroidStressAtom::compute_peratom()
|
|||
stress[i][j] += cvatom[i][j];
|
||||
}
|
||||
|
||||
if (kspaceflag && force->kspace) {
|
||||
if (kspaceflag && force->kspace && force->kspace->compute_flag) {
|
||||
double **vatom = force->kspace->vatom;
|
||||
for (i = 0; i < nkspace; i++) {
|
||||
for (j = 0; j < 6; j++)
|
||||
|
@ -258,7 +258,7 @@ void ComputeCentroidStressAtom::compute_peratom()
|
|||
|
||||
// communicate ghost virials between neighbor procs
|
||||
|
||||
if (force->newton || (force->kspace && force->kspace->tip4pflag))
|
||||
if (force->newton || (force->kspace && force->kspace->tip4pflag && force->kspace->compute_flag))
|
||||
comm->reverse_comm_compute(this);
|
||||
|
||||
// zero virial of atoms not in group
|
||||
|
|
|
@ -119,7 +119,7 @@ void ComputePEAtom::compute_peratom()
|
|||
|
||||
// add in per-atom contributions from each force
|
||||
|
||||
if (pairflag && force->pair) {
|
||||
if (pairflag && force->pair && force->pair->compute_flag) {
|
||||
double *eatom = force->pair->eatom;
|
||||
for (i = 0; i < npair; i++) energy[i] += eatom[i];
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ void ComputePEAtom::compute_peratom()
|
|||
for (i = 0; i < nbond; i++) energy[i] += eatom[i];
|
||||
}
|
||||
|
||||
if (kspaceflag && force->kspace) {
|
||||
if (kspaceflag && force->kspace && force->kspace->compute_flag) {
|
||||
double *eatom = force->kspace->eatom;
|
||||
for (i = 0; i < nkspace; i++) energy[i] += eatom[i];
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ void ComputeStressAtom::compute_peratom()
|
|||
|
||||
// add in per-atom contributions from each force
|
||||
|
||||
if (pairflag && force->pair) {
|
||||
if (pairflag && force->pair && force->pair->compute_flag) {
|
||||
double **vatom = force->pair->vatom;
|
||||
for (i = 0; i < npair; i++)
|
||||
for (j = 0; j < 6; j++)
|
||||
|
@ -205,7 +205,7 @@ void ComputeStressAtom::compute_peratom()
|
|||
stress[i][j] += vatom[i][j];
|
||||
}
|
||||
|
||||
if (kspaceflag && force->kspace) {
|
||||
if (kspaceflag && force->kspace && force->kspace->compute_flag) {
|
||||
double **vatom = force->kspace->vatom;
|
||||
for (i = 0; i < nkspace; i++)
|
||||
for (j = 0; j < 6; j++)
|
||||
|
|
Loading…
Reference in New Issue