Commit 55af01d1 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added external_forces_file option to simulate_oxdna

parent 32ce45a6
......@@ -3803,6 +3803,7 @@ E = 0 0 0
delta_rotation = 0.22,
verlet_skin = 0.5,
max_backbone_force = 100,
external_forces_file = None
):
if seed is None:
......@@ -3852,6 +3853,11 @@ E = 0 0 0
delta_translation = ''
delta_rotation = ''
if external_forces_file is None:
external_forces = "external_forces = 0"
else:
external_forces = "external_forces = 1\nexternal_forces_file = {}".format(external_forces_file)
with open(filename,'w') as fh:
fh.write("""##############################
#### PROGRAM PARAMETERS ####
......@@ -3882,6 +3888,8 @@ dt = {timestep}
verlet_skin = {verlet_skin}
{max_backbone_force}
{external_forces}
##############################
#### INPUT / OUTPUT ####
##############################
......@@ -3897,7 +3905,6 @@ energy_file = {log_file}.energy.dat
print_conf_interval = {print_conf_interval}
print_energy_every = {print_energy_every}
time_scale = linear
external_forces = 0
""".format( **locals() ))
def simulate_oxdna(self, output_name, directory='.', output_directory='output', topology=None, configuration=None, oxDNA=None, **oxdna_args):
......
......@@ -54,16 +54,20 @@ def minimize_and_simulate_oxdna( model,
print_energy_every = 10,
**min_args)
model.simulate_oxdna(output_name = "{}-oxdna".format(output_name),
topology = top,
configuration = conf,
num_steps = num_steps,
print_conf_interval = output_period,
print_energy_every = output_period,
**oxdna_args)
top,conf = model.simulate_oxdna(output_name = "{}-oxdna".format(output_name),
topology = top,
configuration = conf,
num_steps = num_steps,
print_conf_interval = output_period,
print_energy_every = output_period,
**oxdna_args)
finally:
os.chdir(d_orig)
try:
return top,conf
except:
pass
def multiresolution_simulation( model, output_name,
job_id=None,
......
Markdown is supported
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