Issue with reading in multiple data file, read_data command

Hi all,

I have a problem as following: The molecule ID(s) of the added molecule(s) in the second (or 3rd,…) data file is not added to previous molecule-IDs in the first specified data file. For this reason, as I used neigh_modify, the trouble showed up. Therefore, I have to modify the molecule ID in the later data file(s) by hand.

For example, you may wanna check it as using

read_data 1st_file.data # 3 molecule IDs (1, 2, 3)
read_data 2nd_file.data # 2 molecule IDs (1, 2) starting from 1

write_data data.out

What I expect is the added molecules would have IDs of 4 and 5 but they were still 1, 2 instead.

Is there a way to solve this in LAMMPS?

Best,

Hi all,

I have a problem as following: The molecule ID(s) of the added molecule(s)
in the second (or 3rd,...) data file is not added to previous molecule-IDs
in the first specified data file. For this reason, as I used neigh_modify,
the trouble showed up. Therefore, I have to modify the molecule ID in the
later data file(s) by hand.

For example, you may wanna check it as using

read_data 1st_file.data # 3 molecule IDs (1, 2, 3)
read_data 2nd_file.data # 2 molecule IDs (1, 2) starting from 1

write_data data.out

What I expect is the added molecules would have IDs of 4 and 5 but they
were still 1, 2 instead.

​there is no mention that LAMMPS does this anywhere in the read_data
documentation, so it won't do it.
molecule IDs in LAMMPS are just an arbitrary label that is attached to
atoms as a way to group them.

Is there a way to solve this in LAMMPS?

​you have to change the molecule id in the second data file. i think you
can easily do that with LAMMPS through reading in the second data file
only, defining an atom-style variable that has the value of molecule-id
plus 3, use the ​set command to set the molecule id to the atom-style
variable (the mol option supports atom-style variables), and then write it
out again.

axel.