LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] Fwd: Please forward to lammps mailing list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] Fwd: Please forward to lammps mailing list


From: Steve Plimpton <sjplimp@...24...>
Date: Thu, 14 Sep 2017 08:32:10 -0600


---------- Forwarded message ----------
From: Frank Zack <frankzack123@...5873......>
Date: Thu, Sep 14, 2017 at 6:02 AM
Subject: Please forward to lammps mailing list
To: Steve Plimpton <sjplimp@...24...>


Dear Steve,

sorry for bothering you. I've noticed that none of my mails I've submitted to the mailing list during the past 6 months or so showed up there.
Could you please forward the following question to the mailing list?

Thank you very much in advance.



I've written a fix for  pressure-absorbing boundary conditions for fcc-lattices which I'm using for my shockwave simulations.
It uses a monochromatic wave-solution approach for integrating the equations of motion for the atoms which represent the boundary group.
One input parameter is the distance between the current atomic positions of the boundary atoms and the equilibrium position of these atoms at the very first timestep.

Actually it works surprisingly well.
However, if the simulations runs for a while, it might happen that some of my the atoms travel across the periodic boundaries and a simple distance-calculation according to "pos_new- pos_old" is obiously wrong. I have to take into account the periodic images.

so this is what I'm doing (pseudocode):

loop "i" over all atoms:
  if atom is part of the boundary-group:
    imageint *imgflag = atom->image;
   
    flag_x=static_cast<int>(((imgflag[i] & IMGMASK)-IMGMAX);
    flag_y=static_cast<int>((imgflag[i] >> IMGBITS & IMGMASK) - IMGMAX);
    flag_z=static_cast<int>((imgflag[i] >> IMG2BITS) - IMGMAX);
   
    //get the "true" positions
    x_pos=x[i][0]+image_x*Ly;
    y_pos=x[i][1]+image_y*Ly;
    z_pos=x[i][2]+image_y*Ly;
    ...
this seems to work for most of my atoms. However, its no working for those atoms at the edges and corners of the simulation box.
Reason: From the very beginning the imgflag[i] - values seem to be uncorrect. They should all be "0". Instead, for the atoms at the edges and corners these are "-512"

Why is that? 
I've taken a look into the pack_scale_image function of dump_atom.cpp and the image flags are determined the very same way.
Where's my mistake?


Best regards,
frank.