Skip to content

Commit

Permalink
Update write_lammps_data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyxl authored Sep 9, 2023
1 parent 3e89835 commit b07de15
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions mofa/simulation/cif2lammps/write_lammps_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ def lammps_inputs(args):
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} # {:>5}'.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')

Expand All @@ -366,11 +366,11 @@ def lammps_inputs(args):
for bond_type in FF.bond_data['all_bonds']:
for bond in FF.bond_data['all_bonds'][bond_type]:
bond_index += 1
data.write('{:>5} {:<5} {:<6} {:<6} # {:>6} {:>6}'.format(bond_index,
bond_type,
bond[0],
bond[1],
id2label[bond[0]],
data.write('{:>5} {:<5} {:<6} {:<6} # {:>6} {:>6}'.format(bond_index,
bond_type,
bond[0],
bond[1],
id2label[bond[0]],
id2label[bond[1]]))
data.write('\n')

Expand All @@ -382,13 +382,13 @@ def lammps_inputs(args):
for angle_type in FF.angle_data['all_angles']:
for angle in FF.angle_data['all_angles'][angle_type]:
angle_index += 1
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6}'.format(angle_index,
angle_type,
angle[0],
angle[1],
angle[2],
id2label[angle[0]],
id2label[angle[1]],
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6}'.format(angle_index,
angle_type,
angle[0],
angle[1],
angle[2],
id2label[angle[0]],
id2label[angle[1]],
id2label[angle[2]]))
data.write('\n')

Expand All @@ -402,15 +402,15 @@ def lammps_inputs(args):
for dihedral_type in FF.dihedral_data['all_dihedrals']:
for dihedral in FF.dihedral_data['all_dihedrals'][dihedral_type]:
dihedral_index += 1
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6} {:>6}'.format(dihedral_index,
dihedral_type,
dihedral[0],
dihedral[1],
dihedral[2],
dihedral[3],
id2label[dihedral[0]],
id2label[dihedral[1]],
id2label[dihedral[2]],
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6} {:>6}'.format(dihedral_index,
dihedral_type,
dihedral[0],
dihedral[1],
dihedral[2],
dihedral[3],
id2label[dihedral[0]],
id2label[dihedral[1]],
id2label[dihedral[2]],
id2label[dihedral[3]]))
data.write('\n')

Expand All @@ -424,15 +424,15 @@ def lammps_inputs(args):
for improper_type in FF.improper_data['all_impropers']:
for improper in FF.improper_data['all_impropers'][improper_type]:
improper_index += 1
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6} {:>6}'.format(improper_index,
improper_type,
improper[0],
improper[1],
improper[2],
improper[3],
id2label[improper[0]],
id2label[improper[1]],
id2label[improper[2]],
data.write('{:>5} {:<5} {:<6} {:<6} {:<6} {:<6} # {:>6} {:>6} {:>6} {:>6}'.format(improper_index,
improper_type,
improper[0],
improper[1],
improper[2],
improper[3],
id2label[improper[0]],
id2label[improper[1]],
id2label[improper[2]],
id2label[improper[3]]))
data.write('\n')

Expand Down

0 comments on commit b07de15

Please sign in to comment.