Skip to content

Commit

Permalink
cleanup: QM/MM linkatom printing
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarB83 committed Sep 13, 2024
1 parent 9ee0c31 commit 2a2035a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ash/modules/module_QMMM.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ def elstat_run(self, current_coords=None, elems=None, Grad=False, numcores=1, ex
else:
print("Unknown linkatom_forceproj_method. Exiting")
ashexit()
print("QM1grad contrib:", QM1grad_contrib)
print("MM1grad contrib:", MM1grad_contrib)
#print("QM1grad contrib:", QM1grad_contrib)
#print("MM1grad contrib:", MM1grad_contrib)

self.QM_PC_gradient[fullatomindex_qm] = QM1grad_contrib
self.QM_PC_gradient[fullatomindex_mm] = MM1grad_contrib
Expand Down
10 changes: 7 additions & 3 deletions ash/modules/module_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -3117,9 +3117,13 @@ def get_linkatom_positions(qm_mm_boundary_dict, qmatoms, coords, elems, linkatom
print("Inside get_linkatom_positions")
print("linkatom_method:", linkatom_method)

if linkatom_simple_distance is None:
print("linkatom_simple_distance not set. Getting standard distance from dictionary for each element:")
else:
print("linkatom_simple_distance was set by user:", linkatom_simple_distance)
#Dict of linkatom distances for different elements
linkdistances_dict = {('C', 'H'): 1.09, ('O', 'H'): 0.98, ('N', 'H'): 0.99}

print("Linkdatom distance dictionary:", linkdistances_dict)
# If dictionary of linkatom-distances provided then use that instead
if linkatom_method == 'ratio':
if linkatom_ratio == 'Auto' and bondpairs_eq_dict is None:
Expand Down Expand Up @@ -3161,11 +3165,11 @@ def get_linkatom_positions(qm_mm_boundary_dict, qmatoms, coords, elems, linkatom
elif linkatom_method == 'simple':
print("Linkatom method: simple")
if linkatom_simple_distance is None:
print("linkatom_simple_distance not set. Getting standard distance from dictionary for element:", elems[dict_item[0]])
#print("linkatom_simple_distance not set. Getting standard distance from dictionary for element:", elems[dict_item[0]])
#Getting from dict
linkatom_distance = linkdistances_dict[(elems[dict_item[0]], 'H')]
else:
print("linkatom_simple_distance was set by user:", linkatom_simple_distance)
#print("linkatom_simple_distance was set by user:", linkatom_simple_distance)
#Getting from user
linkatom_distance = linkatom_simple_distance
print("Linkatom distance (QM1-L) is:", linkatom_distance)
Expand Down

0 comments on commit 2a2035a

Please sign in to comment.