Skip to content

Commit

Permalink
Include Boron in Chemkin
Browse files Browse the repository at this point in the history
  • Loading branch information
ssun30 committed Jul 11, 2023
1 parent ae42977 commit d4b718e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rmgpy/chemkin.pyx
Expand Up @@ -2470,7 +2470,7 @@ def write_elements_section(f):

# map of isotope elements with chemkin-compatible element representation:
elements = ('H', ('H', 2), ('H', 3), 'C', ('C', 13), 'O', ('O', 18), 'N', 'Ne', 'Ar', 'He', 'Si', 'S',
'F', 'Cl', 'Br', 'I')
'F', 'Cl', 'Br', 'I', 'B')
for el in elements:
if isinstance(el, tuple):
symbol, isotope = el
Expand Down
18 changes: 12 additions & 6 deletions rmgpy/molecule/atomtype.py
Expand Up @@ -269,7 +269,7 @@ def get_features(self):
'Br','Br1s',
'I','I1s',
'F','F1s',
'B','Bs','Bd', 'Bt','BO','Bb','Bbf'])
'B','Bs','Bd', 'Bt','BO','Bb','Bbf','B1+','B1-'])

ATOMTYPES['R!H'] = AtomType(label='R!H', generic=['R'], specific=[
'Val3','Val4','Val5','Val6','Val7',
Expand All @@ -284,7 +284,7 @@ def get_features(self):
'Br','Br1s',
'I','I1s',
'F','F1s',
'B','Bs','Bd', 'Bt','BO','Bb','Bbf'])
'B','Bs','Bd', 'Bt','BO','Bb','Bbf','B1+','B1-'])

ATOMTYPES['R!H!Val7'] = AtomType(label='R!H!Val7', generic=['R'], specific=[
'Val3','Val4','Val5','Val6',
Expand All @@ -295,12 +295,12 @@ def get_features(self):
'Si','Sis','Sid','Sidd','Sit','SiO','Sib','Sibf','Siq',
'P','P0sc','P1s','P1sc','P1dc','P3s','P3d','P3t','P3b','P5s','P5sc','P5d','P5dd','P5dc','P5ddc','P5t','P5td','P5tc','P5b','P5bd',
'S','Sa','S0sc','S2s','S2sc','S2d','S2dc','S2tc','S4s','S4sc','S4d','S4dd','S4dc','S4b','S4t','S4tdc','S6s','S6sc','S6d','S6dd','S6ddd','S6dc','S6t','S6td','S6tt','S6tdc',
'B','Bs','Bd','Bt','BO','Bb','Bbf'
'B','Bs','Bd','Bt','BO','Bb','Bbf','B1+','B1-'
])

ATOMTYPES['Val4'] = AtomType(label='Val4', generic=['R', 'R!H', 'R!H!Val7'], specific=[
'C','Ca','Cs','Csc','Cd','CO','CS','Cq','Cdd','Cdc','Ctc','Ct','Cb','Cbf','C2s','C2sc','C2d','C2dc','C2tc',
'Si','Sis','Sid','Sidd','Sit','SiO','Sib','Sibf','Siq'])
'Si','Sis','Sid','Sidd','Sit','SiO','Sib','Sibf','Siq','B','B1-'])

ATOMTYPES['Val5'] = AtomType(label='Val5', generic=['R', 'R!H', 'R!H!Val7'], specific=[
'N','N0sc','N1s','N1sc','N1dc','N3s','N3sc','N3d','N3t','N3b','N5sc','N5dc','N5ddc','N5dddc','N5tc','N5b','N5bd',
Expand All @@ -317,7 +317,7 @@ def get_features(self):
'F','F1s'])

ATOMTYPES['Val3'] = AtomType(label='Val3', generic=['R', 'R!H', 'R!H!Val7'], specific=[
'B','Bs','Bd', 'Bt','BO','Bb','Bbf'])
'B','Bs','Bd', 'Bt','BO','Bb','Bbf','B1+'])

ATOMTYPES['H'] = AtomType('H', generic=['R'], specific=[])

Expand Down Expand Up @@ -640,7 +640,7 @@ def get_features(self):
single=[0,1], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[0], benzene=[0], lone_pairs=[3], charge=[0])
# examples for F1s: HF, [F], FO, CH3F, F2

ATOMTYPES['B'] = AtomType('B', generic=['R', 'R!H', 'R!H!Val7', 'Val3'], specific=['Bs', 'Bd', 'Bt', 'BO', 'Bb', 'Bbf'],
ATOMTYPES['B'] = AtomType('B', generic=['R', 'R!H', 'R!H!Val7', 'Val3', 'Val4'], specific=['Bs', 'Bd', 'Bt', 'BO', 'Bb', 'Bbf', 'B1+', 'B1-'],
single=[], all_double=[], r_double=[], o_double=[], s_double=[], triple=[], quadruple=[], benzene=[], lone_pairs=[], charge=[])
ATOMTYPES['Bs'] = AtomType('Bs', generic=['R', 'R!H', 'R!H!Val7', 'B', 'Val3'], specific=[],
single=[], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[], benzene=[0], lone_pairs=[], charge=[])
Expand All @@ -654,6 +654,10 @@ def get_features(self):
single=[], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[], benzene=[2], lone_pairs=[], charge=[])
ATOMTYPES['Bbf'] = AtomType('Bbf', generic=['R', 'R!H', 'R!H!Val7', 'B', 'Val3'], specific=[],
single=[], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[], benzene=[3], lone_pairs=[], charge=[])
ATOMTYPES['B1+'] = AtomType('B1+', generic=['R', 'R!H', 'R!H!Val7', 'B', 'Val3'], specific=[],
single=[], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[], benzene=[3], lone_pairs=[], charge=[1])
ATOMTYPES['B1-'] = AtomType('B1-', generic=['R', 'R!H', 'R!H!Val7', 'B', 'Val4'], specific=[],
single=[], all_double=[0], r_double=[], o_double=[], s_double=[], triple=[0], quadruple=[], benzene=[3], lone_pairs=[], charge=[-1])

# Boron Atom Types

Expand Down Expand Up @@ -804,6 +808,8 @@ def get_features(self):
ATOMTYPES['BO'].set_actions(increment_bond=[], decrement_bond=['Bs'], form_bond=['BO'], break_bond=['BO'], increment_radical=['BO'], decrement_radical=['BO'], increment_lone_pair=[], decrement_lone_pair=[])
ATOMTYPES['Bb'].set_actions(increment_bond=[], decrement_bond=[], form_bond=['Bb'], break_bond=['Bb'], increment_radical=['Bb'], decrement_radical=['Bb'], increment_lone_pair=[], decrement_lone_pair=[])
ATOMTYPES['Bbf'].set_actions(increment_bond=[], decrement_bond=[], form_bond=[], break_bond=[], increment_radical=[], decrement_radical=[], increment_lone_pair=[], decrement_lone_pair=[])
ATOMTYPES['B1+'].set_actions(increment_bond=['B'], decrement_bond=['B1+'], form_bond=['B'], break_bond=['B'], increment_radical=['B1+'], decrement_radical=['B1+'], increment_lone_pair=[], decrement_lone_pair=[])
ATOMTYPES['B1-'].set_actions(increment_bond=[], decrement_bond=['B'], form_bond=['B1-'], break_bond=['B1-'], increment_radical=[], decrement_radical=['B1-'], increment_lone_pair=[], decrement_lone_pair=[])

# these are ordered in priority of picking if a more general atomtype is encountered
allElements = ['H', 'C', 'O', 'N', 'S', 'P', 'B', 'Si', 'F', 'Cl', 'Br', 'I', 'Ne', 'Ar', 'He', 'X']
Expand Down

0 comments on commit d4b718e

Please sign in to comment.