Skip to content

Commit

Permalink
have md.step return a copy of atom positions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpvandermause committed Jun 16, 2020
1 parent 1829b0c commit a2a785a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 4 additions & 3 deletions flare/ase/otf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ def md_step(self):
Get new position in molecular dynamics based on the forces predicted by
FLARE_Calculator or DFT calculator
'''
pos = np.copy(self.structure.positions)
self.md.step()
self.structure.positions = pos
return self.atoms.positions

# Return a copy so that future updates to atoms.positions doesn't also
# update structure.positions.
return np.copy(self.atoms.positions)

# TODO: fix the temperature output in the log file

Expand Down
8 changes: 0 additions & 8 deletions flare/otf.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,7 @@ def run(self):
# compute forces and stds with GP
self.dft_step = False
self.compute_properties()
# print('positions pre:')
# print(self.structure.positions)
new_pos = self.md_step()
# print('positions post:')
# print(self.structure.positions)
# print('new pos:')
# print(new_pos)

# get max uncertainty atoms
std_in_bound, target_atoms = \
Expand All @@ -239,8 +233,6 @@ def run(self):
dft_frcs = deepcopy(self.structure.forces)

# run MD step & record the state
# new_pos = self.md_step()
# self.update_temperature(new_pos)
self.record_state()

# compute mae and write to output
Expand Down

0 comments on commit a2a785a

Please sign in to comment.