LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] How to wrap atoms into simulation box with read_data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] How to wrap atoms into simulation box with read_data


From: Andrew Gibbons <agibbons@...7232...>
Date: Tue, 14 Nov 2017 11:44:44 +0900

Hello,

I have a script that generates molecule files that can be read into LAMMPS using read_data. My problem is that this file can generate molecules that lie outside of the simulation box. When reading into a periodic boundary system this is not a problem, but trying to read into a fixed boundary box causes an error. What is the best way to reposition the atoms when reading the data file?

Here the relevant part of the LAMMPS script:

    # Initialization
    units        real
    boundary    f f f
    atom_style    molecular
    log         log.${simname}.txt
    read_data    ${fname}

This causes an error as the atoms are outside of the box defined in the atom data file.

I found a way around this, basically I change the atom images and box boundary conditions after loading the data file.

    # Initialization
    units        real
    boundary    p p p
    atom_style    molecular
    log         log.${simname}.txt
    read_data    ${fname}
    set atom * image 0 0 0
    change_box all boundary f f f

But I was wondering is a better way?

Thanks