diff --git a/mrdna/simulate.py b/mrdna/simulate.py index 8d9cc11b85e0a122401be2aa414fe66125428bce..fef95d0e41dbbabd68fc36066941af934553fa00 100644 --- a/mrdna/simulate.py +++ b/mrdna/simulate.py @@ -46,7 +46,10 @@ def multiresolution_simulation( model, output_name, full_output_prefix = "%s/%s" % (output_directory,output_prefix) ## TODO Remove long bonds model.simulate( outputPrefix = output_prefix, numSteps=0.05*coarse_steps, **simargs ) - coordinates = readArbdCoords('%s.0.restart' % full_output_prefix) + try: + coordinates = readArbdCoords('%s.restart' % full_output_prefix) + except: + coordinates = readArbdCoords('%s.0.restart' % full_output_prefix) output_prefix = "%s-1" % output_name model._update_segment_positions(coordinates) model.simulate( outputPrefix = output_prefix, numSteps=0.95*coarse_steps, **simargs ) @@ -54,7 +57,10 @@ def multiresolution_simulation( model, output_name, output_prefix = "%s-1" % output_name full_output_prefix = "%s/%s" % (output_directory,output_prefix) model.simulate( outputPrefix = output_prefix, numSteps=coarse_steps, **simargs ) - coordinates = readArbdCoords('%s.0.restart' % full_output_prefix) + try: + coordinates = readArbdCoords('%s.restart' % full_output_prefix) + except: + coordinates = readArbdCoords('%s.0.restart' % full_output_prefix) """ Fine simulation """ @@ -66,7 +72,10 @@ def multiresolution_simulation( model, output_name, model._clear_beads() model._generate_bead_model( 1, 1, local_twist=True, escapable_twist=True ) model.simulate( outputPrefix = output_prefix, numSteps=fine_steps, **simargs ) - coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.0.dcd' % full_output_prefix, rmsdThreshold=1) + try: + coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.dcd' % full_output_prefix, rmsdThreshold=1) + except: + coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.0.dcd' % full_output_prefix, rmsdThreshold=1) """ Freeze twist """ @@ -76,7 +85,10 @@ def multiresolution_simulation( model, output_name, model._clear_beads() model._generate_bead_model( 1, 1, local_twist=True, escapable_twist=False ) model.simulate( outputPrefix = output_prefix, numSteps=fine_steps, **simargs ) - coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.0.dcd' % full_output_prefix ) + try: + coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.dcd' % full_output_prefix ) + except: + coordinates = readAvgArbdCoords('%s.psf' % output_prefix,'%s.pdb' % output_prefix, '%s.0.dcd' % full_output_prefix ) """ Atomic simulation """