[lammps-users] Different versions of LAMMPS

Dear all,

I’m using the LAMMPS to simulate the compression of granular materials. A 2D model (only 9 balls) was considered in my test run. Compressive loads were applied via the fix volume/rescale command. I found that different results were given using different versions of LAMMPS (the most recent version and the 20 Oct 06 one). It seems that the old version gave the right answers. The problem (arised in the new version) may come from the last several lines in Comm::communicate() routine:


n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc_dist[iswap]);
avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);

in which, the variable pbc_dist(iswap]), which relates to domain->prd, is only updated in the Comm::setup() in the first step of a whole run and does not change even if the simulation box changes. However, the old version codes use the domain-prd directly in the avec->pack_comm(…) subroutine, which can trace the box change due to fix volume/rescale operation.

I’m not sure that this problem is a bug or not. Has anybody else come across this or have an explanation?

Regards,

Yonggang

Input file

The comm::setup() routine is called whenever neighbor lists
are built (every few steps), so it should track volume changes,
but not perfectly. Hadn't thought of the cases like yours when
the volume changes every step. Need to think what to do about
that. Try only changing the volume (via nevery in fix vol/rescale)
every N steps, where N is the same as the reneighboring frequency
and see if that fixes the problem.

There was also a bug-fix in the granular force field sometime in
the last few months which could affect your answer.

Steve

Hi Steve,

Thanks for your comments.
I have another question relates to this problem:

In the Verlet::iterate() routine, the comm::setup() routine is called when nflag==1,
that is, the neighbor lists are updated, and the variable ‘pbc_dist’ can be reset
immediately. When we do the fix vol/rescale operation, the domain->prd is changed,
but the ‘nflag’ may be equal to 0 (see neighbor::decide()) and the ‘pbc_dist’ cannot
be updaed correctly. So that the atom position may be computed improperly in the
Comm::communicate() routine.

If I change the following codes in the Verlet::iterate() subroutine,


nflag = neighbor->decide();
if (nflag == 0) {

} else {

}

to


nflag = neighbor->decide();
if (nflag == 0 && domain->box_change != 1) {

} else {

}

I can get the same results as given by the old version.

Thanks and regards.

Yonggang

在2007-03-14,“Steve Plimpton” [email protected] wrote:

This is the same bug another user flagged with NPT volume changes.
I'll try to post a patch later today.

Steve