Commit 967b04d8 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added 'directory' option to arbdmodel.simulate

parent f1c64034
......@@ -676,10 +676,16 @@ class ArbdModel(PdbModel):
if typeA != typeB:
self.nbSchemes.append( (nbScheme, typeB, typeA) )
def simulate(self, outputPrefix, outputDirectory='output', numSteps=100000000, timestep=None, gpu=0, outputPeriod=1e4, arbd=None):
def simulate(self, outputPrefix, outputDirectory='output', numSteps=100000000, timestep=None, gpu=0, outputPeriod=1e4, arbd=None, directory='.'):
assert(type(gpu) is int)
numSteps = int(numSteps)
d_orig = os.getcwd()
try:
if not os.path.exists(directory):
os.makedirs(directory)
os.chdir(directory)
if timestep is not None:
self.timestep = timestep
......@@ -727,6 +733,12 @@ class ArbdModel(PdbModel):
sys.stdout.write(line)
sys.stdout.flush()
except:
raise
finally:
os.chdir(d_orig)
# -------------------------- #
# Methods for printing model #
# -------------------------- #
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment