Skip to content

Commit

Permalink
Update cif2system.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyxl authored Sep 11, 2023
1 parent b148cc6 commit e844ffa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mofa/simulation/cif2lammps/cif2system.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,14 @@ def initialize_system(
G = nx.Graph()
index = 0
index_key = {}
element_index_dict = {}
for e, n, cc, fc, charge in zip(
elems, names, ccoords, fcoords, charge_list):
index += 1
if e in element_index_dict.keys():
element_index_dict[e] = element_index_dict[e] + 1
else:
element_index_dict[e] = 1
G.add_node(index,
element_symbol=e,
mol_flag='1',
Expand All @@ -330,7 +335,7 @@ def initialize_system(
0.0,
0.0]),
duplicated_version_of=None,
cif_label=e + ("%d" % index))
cif_label=e + ("%d" % element_index_dict[e]))
index_key[n] = index

for b in bonds:
Expand Down

0 comments on commit e844ffa

Please sign in to comment.