Question for dihedral data format.

Dear LAMMPS Users,

I have a question for lammps data format. I am working with someone else. He or she sent me a data file and I have checked the data file.

I have found something I do not understand. Does lammps allow to use same dihedral configurations but different dihedral coefficients?

For example, there is a data file called “data.foo”. In the “Dihedrals” section of data.foo, there are the exact same dihedral configurations but different dihedral coefficients like below.

Dihedrals

1 5 10 15 16 17
2 6 10 15 16 17

20 5 45 43 51 50
21 6 45 43 51 50

Is it possible? If possible, what does this mean?

Thanks.

Best regards,
Changwoon Jang

Dear LAMMPS Users,

     I have a question for lammps data format. I am working with someone
else. He or she sent me a data file and I have checked the data file.

I have found something I do not understand. Does lammps allow to use same
dihedral configurations but different dihedral coefficients?

yes. this is legal input.

For example, there is a data file called "data.foo". In the "Dihedrals"
section of data.foo, there are the exact same dihedral configurations but
different dihedral coefficients like below.

right, it even could be the same dihedral type. LAMMPS doesn't care.

Dihedrals

1 5 10 15 16 17
2 6 10 15 16 17
...

20 5 45 43 51 50
21 6 45 43 51 50
....

Is it possible? If possible, what does this mean?

it means that those interactions are added. this is
needed for example to model dihedral interactions
with barriers of different height. the classic example
for that is the rotation of n-butane around the central
C-C bond.

Thanks.

you're welcome,
     axel.

Yes. You can add multiple different dihedral forces on the same 4
atoms using this method. (The
I -think- you can even superimpose types of different dihedral forces
together (such as class2 and fourier or table). (One of the
moltemplate examples uses this trick.)

This discussion came up before (but it's difficult to find)
http://lammps.sandia.gov/threads/msg28838.html

--- moltemplate users ---

This behaviour is usually prevented in moltemplate. Users can enable
multiple dihedral interactions on the same 4 bonds using
"-overlay-dihedrals" command line argument. (There is a moltemplate
example which uses this. You can also use "-overlay-bonds",
"-overlay-angles", and "-overlay-impropers".)

--- other users ---

If you want to prevent this behaviour, you can discard the extra
angles using these commands:

extract_lammps_data.py Angles < data_file > angles.txt
remove_duplicates_nbody.py 3 < angles.txt > angles.TMP
renumber_DATA_first_column.py < angles.TMP > new_angles.txt

extract_lammps_data.py Dihedrals < data_file > dihedrals.txt
remove_duplicates_nbody.py 4 < dihedrals.txt > dihedrals.TMP
renumber_DATA_first_column.py < dihedrals.TMP > new_dihedrals.txt

extract_lammps_data.py Impropers < data_file > impropers.txt
remove_duplicates_nbody.py 4 < impropers.txt > impropers.TMP
renumber_DATA_first_column.py < impropers.TMP > new_impropers.txt

These commands remove lines containing the same atoms (columns 2 to
N-1) from your "Angles", "Dihedrals", and "Impropers" sections. When
using these scripts, priority is given to the most recently defined
(last) interaction. (It will override earlier interactions.)

(For other people who may read this email, if you downloaded lammps or
moltemplate recently, these scripts are located in your
tools/moltemplate/src folder. If not, I have attached them to this
email.)

--- Note for gen_all_angles_topo.sh users ---
The gen_all_angles_topo.sh script can generate multiple interactions
between the same 4 atoms as well. This happens sometimes when you use
* in your "dihedrals_by_type.txt" file. You can use the commands
above to remove them.

Cheers

extract_lammps_data.py (4.25 KB)

remove_duplicates_nbody.py (1.4 KB)

renumber_DATA_first_column.py (1.83 KB)

I feel like a cad for dropping so many references to "moltemplate" in
my last post. (copy and pasting) Anyway, here is a correction to the
script I posted earlier for removing duplicate angles, dihedrals, and
impropers:

extract_lammps_data.py Angles < data_file > angles.txt
remove_duplicates_nbody.py 3 < angles.txt > angles.TMP
renumber_DATA_first_column.py < angles.TMP > new_angles.txt
extract_lammps_data.py -n Angles < data_file > new_data_file.txt
echo -e "\nAngles\n" >> new_data_file
cat new_angles.txt >> new_data_file
echo >> new_data_file

extract_lammps_data.py Dihedrals < data_file > dihedrals.txt
remove_duplicates_nbody.py 4 < dihedrals.txt > dihedrals.TMP
renumber_DATA_first_column.py < dihedrals.TMP > new_dihedrals.txt
extract_lammps_data.py -n Dihedrals < data_file > new_data_file.txt
echo -e "\nDihedrals\n" >> new_data_file
cat new_dihedrals.txt >> new_data_file
echo >> new_data_file

extract_lammps_data.py Impropers < data_file > impropers.txt
remove_duplicates_nbody.py 4 < impropers.txt > impropers.TMP
renumber_DATA_first_column.py < impropers.TMP > new_impropers.txt
extract_lammps_data.py -n Impropers < data_file > new_data_file.txt
echo -e "\nImpropers\n" >> new_data_file
cat new_impropers.txt >> new_data_file
echo >> new_data_file

These commands remove lines containing the same atoms (columns 2 to
N-1) from your "Angles", "Dihedrals", and "Impropers" sections. When
using these scripts, priority is given to the most recently defined
(last) interaction. (It will override earlier interactions.)

extract_lammps_data.py Angles < data_file > angles.txt
remove_duplicates_nbody.py 3 < angles.txt > angles.TMP
renumber_DATA_first_column.py < angles.TMP > new_angles.txt

extract_lammps_data.py Dihedrals < data_file > dihedrals.txt
remove_duplicates_nbody.py 4 < dihedrals.txt > dihedrals.TMP
renumber_DATA_first_column.py < dihedrals.TMP > new_dihedrals.txt

extract_lammps_data.py Impropers < data_file > impropers.txt
remove_duplicates_nbody.py 4 < impropers.txt > impropers.TMP
renumber_DATA_first_column.py < impropers.TMP > new_impropers.txt

(For other people who may read this email, if you downloaded lammps or
moltemplate recently, these scripts are located in your
tools/moltemplate/src folder. If not, I have attached them to this
email.)

These were attached to the previous post in this thread.

In a hurry. I keep making mistakes. Here is one more correction.

extract_lammps_data.py Angles < data_file > angles.txt
remove_duplicates_nbody.py 3 < angles.txt > angles.TMP
renumber_DATA_first_column.py < angles.TMP > new_angles.txt
extract_lammps_data.py -n Angles < data_file > new_data_file.txt
echo -e "\nAngles\n" >> new_data_file
cat new_angles.txt >> new_data_file
echo >> new_data_file

cp -f new_data_file data_file

extract_lammps_data.py Dihedrals < data_file > dihedrals.txt
remove_duplicates_nbody.py 4 < dihedrals.txt > dihedrals.TMP
renumber_DATA_first_column.py < dihedrals.TMP > new_dihedrals.txt
extract_lammps_data.py -n Dihedrals < data_file > new_data_file.txt
echo -e "\nDihedrals\n" >> new_data_file
cat new_dihedrals.txt >> new_data_file
echo >> new_data_file

cp -f new_data_file data_file

extract_lammps_data.py Impropers < data_file > impropers.txt
remove_duplicates_nbody.py 4 < impropers.txt > impropers.TMP
renumber_DATA_first_column.py < impropers.TMP > new_impropers.txt
extract_lammps_data.py -n Impropers < data_file > new_data_file.txt
echo -e "\nImpropers\n" >> new_data_file
cat new_impropers.txt >> new_data_file
echo >> new_data_file

cp -f new_data_file data_file