Skip to content

Commit

Permalink
bugfix (copy)
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Jan 12, 2022
1 parent 6eae506 commit 350ce91
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tds/metadynamics_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _get_index(self, x):

def get_force(self, x):
index = self._get_index(x)
dBds = self.dBds[index],copy()
dBds = self.dBds[index].copy()
if self.use_gradient:
dx = x - self.mesh[index]
dBds += np.einsum('...j,ij->...i', dx, self.ddBdds[index])
Expand Down Expand Up @@ -211,19 +211,22 @@ def mass_ratios(self):
self._mass_ratios /= self._mass_ratios.sum()
return self._mass_ratios

def collect_output(self):
self.output.x = self.unit_cell.x_lst
self.output.B = self.unit_cell.B
self.output.dBds = self.unit_cell.dBds
self.output.ddBdds = self.unit_cell.ddBdds
self.to_hdf()

def run_static(self):
self.status.running = True
self.ref_job_initialize()
self.ref_job.set_fix_external(self.callback, overload_internal_fix_external=True)
self.ref_job.run()
self.status.collect = True
self.collect_output()
self.ref_job.interactive_close()
self.output.x = self.unit_cell.x_lst
self.output.B = self.unit_cell.B
self.output.dBds = self.unit_cell.dBds
self.output.ddBdds = self.unit_cell.ddBdds
self.status.finished = True
self.to_hdf()
self.run()

def get_x_shift(self):
x_v = -self.mass_ratios[-1] * self.total_displacements[-1]
Expand Down Expand Up @@ -279,7 +282,7 @@ def from_hdf(self, hdf=None, group_name=None):
self.unit_cell._x_lst.extend(self.output.x)
self.unit_cell.B = self.output.B
self.unit_cell.dBds = self.output.dBds
self.unit_cell.B = self.output.ddBdds
self.unit_cell.ddBdds = self.output.ddBdds

def write_input(self):
pass
Expand Down

0 comments on commit 350ce91

Please sign in to comment.