From 39a7afa4a3aceb319ffb8b710b07ecd9dd220102 Mon Sep 17 00:00:00 2001 From: doublylinkedlist Date: Sat, 9 Sep 2023 03:00:36 -0500 Subject: [PATCH] Update write_lammps_data.py --- mofa/simulation/cif2lammps/write_lammps_data.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mofa/simulation/cif2lammps/write_lammps_data.py b/mofa/simulation/cif2lammps/write_lammps_data.py index c3f2f720..7f121884 100644 --- a/mofa/simulation/cif2lammps/write_lammps_data.py +++ b/mofa/simulation/cif2lammps/write_lammps_data.py @@ -328,7 +328,7 @@ def lammps_inputs(args): data.write('Atoms\n') data.write('\n') total_charge = 0.0 - print(system["names"]) + for a in SG.nodes(data=True): atom_data = a[1] @@ -336,10 +336,11 @@ def lammps_inputs(args): force_field_type = atom_data['force_field_type'] lammps_type = FF.atom_types[force_field_type] charge = atom_data['charge'] + cif_label = atom_data['cif_label'] total_charge += charge pos = [np.round(v, 8) for v in atom_data['cartesian_position']] - data.write('{:>5} {:<5} {:<5} {:8.5f} {:12.5f} {:12.5f} {:12.5f}'.format(index, atom_data['mol_flag'], lammps_type, charge, pos[0], pos[1], pos[2])) + data.write('{:>5} {:<5} {:<5} {:8.5f} {:12.5f} {:12.5f} {:12.5f} # {:>5}'.format(index, atom_data['mol_flag'], lammps_type, charge, pos[0], pos[1], pos[2], cif_label)) data.write('\n') if charges and abs(total_charge) > 0.001: