git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8430 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -164,14 +164,19 @@ void ComputeStressAtom::compute_peratom()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add in per-atom contributions from relevant fixes
|
// add in per-atom contributions from relevant fixes
|
||||||
|
// skip if vatom = NULL
|
||||||
|
// possible during setup phase if fix has not initialized its vatom yet
|
||||||
|
// e.g. fix ave/spatial defined before fix shake,
|
||||||
|
// and fix ave/spatial uses a per-atom stress from this compute as input
|
||||||
|
|
||||||
if (fixflag) {
|
if (fixflag) {
|
||||||
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
||||||
if (modify->fix[ifix]->virial_flag) {
|
if (modify->fix[ifix]->virial_flag) {
|
||||||
double **vatom = modify->fix[ifix]->vatom;
|
double **vatom = modify->fix[ifix]->vatom;
|
||||||
for (i = 0; i < nlocal; i++)
|
if (vatom)
|
||||||
for (j = 0; j < 6; j++)
|
for (i = 0; i < nlocal; i++)
|
||||||
stress[i][j] += vatom[i][j];
|
for (j = 0; j < 6; j++)
|
||||||
|
stress[i][j] += vatom[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ void Fix::v_setup(int vflag)
|
|||||||
if (vflag_atom && atom->nlocal > maxvatom) {
|
if (vflag_atom && atom->nlocal > maxvatom) {
|
||||||
maxvatom = atom->nmax;
|
maxvatom = atom->nmax;
|
||||||
memory->destroy(vatom);
|
memory->destroy(vatom);
|
||||||
memory->create(vatom,maxvatom,6,"bond:vatom");
|
memory->create(vatom,maxvatom,6,"fix:vatom");
|
||||||
}
|
}
|
||||||
|
|
||||||
// zero accumulators
|
// zero accumulators
|
||||||
|
|||||||
Reference in New Issue
Block a user