Commit 0fdd92dc authored by cmaffeo2's avatar cmaffeo2
Browse files

Add mrdna.simulate.multiresolution_simulation(...,center_object = True,...) to...

Add mrdna.simulate.multiresolution_simulation(...,center_object = True,...) to center objects at each step during multiresolution simulations, avoiding drift to locations where PDB format cannot be used
parent 387bfe13
......@@ -132,7 +132,9 @@ def main():
if args.dimensions is None:
dim = [max(x,1000) for x in model.dimensions_from_structure( padding_factor=2.5 )]
model.dimensions = dim
model.origin = model.get_center()-0.5*np.array(model.dimensions)
# model.origin = model.get_center()-0.5*np.array(model.dimensions)
model.translate( -model.get_center() )
model.origin = -0.5*np.array(model.dimensions)
else:
model.dimensions = args.dimensions
......@@ -194,6 +196,7 @@ def main():
oxdna_output_period = args.oxdna_output_period,
enrg_md_steps = args.enrg_md_steps,
write_pqr = args.write_pqr,
center_object = args.dimensions is None,
run_enrg_md = args.run_enrg_md
)
......
......@@ -92,6 +92,7 @@ def multiresolution_simulation( model, output_name,
write_pqr = False,
run_enrg_md = False,
enrg_md_steps = 1e6,
center_object = True,
arbd = None
):
......@@ -140,6 +141,8 @@ def multiresolution_simulation( model, output_name,
coordinates = readArbdCoords('%s.0.restart' % full_output_prefix)
model.update_splines(coordinates)
if center_object:
model.translate( -model.get_center() )
simulation_step += 1
coarse_model_args = dict( max_basepairs_per_bead = 5,
......@@ -150,6 +153,8 @@ def multiresolution_simulation( model, output_name,
# TODO: add the output directory in to the readArbdCoords functions or make it an attribute of the model object
""" Prepare coarse model for minimization and coarse simulation """
if center_object:
model.translate( -model.get_center() )
model.clear_beads()
model.generate_bead_model( **coarse_model_args )
......
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