Skip to content

Commit

Permalink
Add abspath reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgt16-LANL committed Nov 8, 2023
1 parent 8dce6b1 commit 08c6917
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions architector/io_samplers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ase
import numpy as np
import os.path as osp
from architector.io_align_mol import (reorder_align_rmsd, simple_rmsd)
from ase.vibrations import Vibrations
from ase.constraints import FixBondLengths
Expand Down Expand Up @@ -47,7 +48,7 @@ def md_sampler(relaxed_mol, temp=298.15, interval=20, n=50, warm_up=1000,
skip_n = int(warm_up/interval)
good = True
with tqdm(total=n+int(warm_up/interval)) as pbar:
with arch_context_manage.make_temp_directory() as _:
with arch_context_manage.make_temp_directory() as tdir:
dyn = Langevin(relaxed_atoms, timestep * ase.units.fs, temp* ase.units.kB, friction=friction)
def printenergy(a=relaxed_atoms): # store a reference to atoms in the definition.
"""Function to print the potential, kinetic and total energy."""
Expand All @@ -64,7 +65,7 @@ def incremental(a=relaxed_atoms):
dyn.attach(incremental,interval=interval)
# Now run the dynamics
dyn.run(warm_up + n*interval)
traj = Trajectory('moldyn3.traj')
traj = Trajectory(osp.join(tdir,'moldyn3.traj'))
trunc_traj = traj[skip_n:]
displaced_structures = []
energies = []
Expand Down

0 comments on commit 08c6917

Please sign in to comment.