I've written a fix for pressure-absorbing boundary conditions for fcc-lattices which I'm using for my shockwave simulations.
uses a monochromatic wave-solution approach for integrating the
equations of motion for the atoms which represent the boundary group.
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.
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
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.
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?