Skip to content

Commit

Permalink
Merge pull request #17 from hernanchavezthielemann/opls_mol_double_tag
Browse files Browse the repository at this point in the history
Opls mol double tag
  • Loading branch information
hernanchavezthielemann committed Apr 15, 2019
2 parents 516a9fb + b3ac97d commit 201d090
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
5 changes: 4 additions & 1 deletion lib/gui/conversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ def getdata_and_convert(self):


_autoload_ = self.objt_c[0]

if not _autoload_:
pop_wrg_1('Proceeding without autoload.\nThis means that any '
+ 'internal address to files that are not specified '
+ 'as GUI input are going to be ignored.')
if self.get_entriesvalues():

data_cont = self.master._convert_['setup']
Expand Down
40 changes: 33 additions & 7 deletions lib/handling/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,10 @@ def write_lammps_data_auto( _topodata_, data_name, _config_):
)
ji_+=1

#########################################################
'''---------- 4th - Chemical topology ------------'''
#=======================================================#
# BULDING AUXILIAR ATOM TAG_ DATA DICTIONARY
###########################################################################
'''==========----------- 4th - Chemical topology ---------=========='''
#=========================================================================#
''' Building auxiliar atom tag1_tag2 data dictionary -/- OPLS Case '''
aat_ddic = {}
if len(atom_info[0]) - minr > 7:
for i in range( n_atomtypes):
Expand Down Expand Up @@ -448,7 +448,15 @@ def write_lammps_data_auto( _topodata_, data_name, _config_):
# better way to do this is trough corrds --------- <WFS>
for i in range( n_bonds - base_bonds_n):
# print sm_bonds[i]
_bond_ty_ = dicts[1][ sm_bonds[i][0]]
try:
_bond_ty_ = dicts[1][ sm_bonds[i][0]]
except KeyError:
# OPLS ??
at1_tag, at2_tag = sm_bonds[i][0].split('-')
at1_tag = aat_ddic[ at1_tag]
at2_tag = aat_ddic[ at2_tag]
_bond_ty_ = dicts[1][ at1_tag + '-'+ at2_tag]

_text_ += bond_shape.format(i+1 + base_bonds_n,
_bond_ty_,
sm_bonds[i][1],
Expand Down Expand Up @@ -488,8 +496,17 @@ def write_lammps_data_auto( _topodata_, data_name, _config_):
if _sidemol_f_ == 1:

for i in range( n_angles - base_angles_n):
_angle_ty_ = dicts[2][ sm_angles[i][0]]

try:
_angle_ty_ = dicts[2][ sm_angles[i][0]]
except KeyError:
# OPLS ??
at1_tag, at2_tag, at3_tag = sm_angles[i][0].split('-')
at1_tag = aat_ddic[ at1_tag]
at2_tag = aat_ddic[ at2_tag]
at3_tag = aat_ddic[ at3_tag]
_angle_ty_ = dicts[2][at1_tag + '-'+ at2_tag+ '-'+ at3_tag]

_text_ += angle_shape.format( i+1 + base_angles_n,
_angle_ty_,
sm_angles[i][1],
Expand Down Expand Up @@ -554,7 +571,16 @@ def write_lammps_data_auto( _topodata_, data_name, _config_):

if _sidemol_f_ == 1:
for i in range( n_dihedrals - base_dihedrals_n):
_dihe_ty_ = dicts[3][ sm_dihedrals[i][0]]

try:
_dihe_ty_ = dicts[3][ sm_dihedrals[i][0]]

except KeyError:
# OPLS ??
aux_here = sm_dihedrals[i][0].split('-')
aux_here = [ aat_ddic[ at_tag] for at_tag in aux_here]
_dihe_ty_ = dicts[3][ '-'.join( aux_here)]


_text_ += dihedral_shape.format( i+1 + base_dihedrals_n,
_dihe_ty_,
Expand Down

0 comments on commit 201d090

Please sign in to comment.