Skip to content

Commit

Permalink
Merge pull request #382 from marrink-lab/speedopt
Browse files Browse the repository at this point in the history
Optimisation of Speed
  • Loading branch information
fgrunewald authored Sep 6, 2024
2 parents c820aaa + 6f168af commit f8fff22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion polyply/src/build_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ def _compose_system(self, molecules):
vector_sphere)
if success:
self.nonbond_matrix = new_nonbond_matrix
self.nonbond_matrix.concatenate_trees()
# concatanation only makes sense for polymers
# longer than 10; it really hurts performance
# for for example 1 monomer solvents
if len(molecule) > 10:
self.nonbond_matrix.concatenate_trees()
mol_idx += 1
pbar.update(1)

Expand Down
4 changes: 2 additions & 2 deletions polyply/src/random_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ def update_positions(self, vector_bundle, current_node, prev_node):
if fulfill_geometrical_constraints(new_point, self.molecule.nodes[current_node])\
and self.checks_milestones(current_node, new_point, step_length)\
and is_restricted(new_point, last_point, self.molecule.nodes[current_node])\
and not self._is_overlap(new_point, current_node)\
and self.bendiness(new_point, current_node):
and self.bendiness(new_point, current_node)\
and not self._is_overlap(new_point, current_node):

self.nonbond_matrix.add_positions(new_point,
self.mol_idx,
Expand Down

0 comments on commit f8fff22

Please sign in to comment.