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