flag to reset energy after each cycle
This commit is contained in:
@@ -17,6 +17,7 @@ class UmbrellaRunner():
|
||||
E_max (float, default=inf): Final energy. Umbrella sampling is stopped if no frames with E < E_max are found
|
||||
E_incr (float, default=1): E_min is incremented by this until E_max is reached
|
||||
max_iterations (int, default=-1): Max. number of iterations before umbrella sampling stops. -1 for infinite sampling
|
||||
reset_E (boolean, default=False): Wether the energy should be reset to E_min at the start of each cycle
|
||||
|
||||
"""
|
||||
|
||||
@@ -25,6 +26,7 @@ class UmbrellaRunner():
|
||||
self.E_min = 0
|
||||
self.E_max = np.inf
|
||||
self.E_incr = 1
|
||||
self.reset_E = False
|
||||
|
||||
def _get_pmf_shape(self):
|
||||
""" returns the shape of the pmf according to the cvs """
|
||||
@@ -148,13 +150,17 @@ class UmbrellaRunner():
|
||||
|
||||
self.num_iterations = 0
|
||||
|
||||
self.E = self.E_min # TODO move this in the loop?
|
||||
self.E = self.E_min
|
||||
|
||||
# outer main loop: increase E and calculate PMF until E > E_max
|
||||
while True:
|
||||
self.num_iterations += 1
|
||||
if reset_E:
|
||||
self.E = self.E_min
|
||||
|
||||
print("~~~~~~~~~~~~~~~ Iteration {}/{} ~~~~~~~~~~~~~~~~".format(self.num_iterations, self.max_iterations))
|
||||
print("Energy: {}".format(self.E))
|
||||
|
||||
|
||||
# find frames to sample
|
||||
if self.num_iterations == 1:
|
||||
|
||||
Reference in New Issue
Block a user