Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
craabreu committed Dec 6, 2023
1 parent 28c0948 commit cff3cdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ufedmm/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.1.0+3.g28c0948.dirty"
10 changes: 7 additions & 3 deletions ufedmm/ufedmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,16 +848,20 @@ def get_driving_force(variables):
return driving_force

driving_force_variables = [[]]
added_colvars = 0
for var in variables:
if len(driving_force_variables[-1]) + len(var.colvars) > 31:
colvars_to_add = len(var.colvars) + 1
if added_colvars + colvars_to_add > 32:
driving_force_variables.append([])
added_colvars = 0
driving_force_variables[-1].append(deepcopy(var))
added_colvars += colvars_to_add
driving_forces = [get_driving_force(vars) for vars in driving_force_variables]
box_length_x = system.getDefaultPeriodicBoxVectors()[0].x
num_particles = system.getNumParticles()
collective_variables = []
for vars in driving_force_variables:
for var in vars:
for dfvars in driving_force_variables:
for var in dfvars:
system.addParticle(var._particle_mass(box_length_x))
var.force.setParticleParameters(0, num_particles, [])
num_particles += 1
Expand Down

0 comments on commit cff3cdb

Please sign in to comment.