def __init__(self): super().__init__() self._cmdObject('acemd', ':class:`MDEngine <htmd.apps.app.App>` object', 'MD engine', None, Acemd) self._cmdValue( 'numsteps', 'int', 'Number of steps to run the simulations in units of 4fs', 0, TYPE_INT, RANGE_0POS) self._cmdValue('temperature', 'float', 'Temperature of the thermostat in Kelvin', 300, TYPE_FLOAT, RANGE_ANY) self._cmdValue( 'k', 'float', 'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5', 0, TYPE_FLOAT, RANGE_ANY) self._cmdString( 'reference', 'str', 'Reference selection to use as dynamic center of the flatbottom box.', 'none') self._cmdString( 'selection', 'str', 'Selection of atoms to apply the flatbottom potential', 'none') self._cmdList( 'box', 'list', 'Position of the flatbottom box in term of the reference center given as [xmin, xmax, ymin, ymax, zmin, zmax]', [0, 0, 0, 0, 0, 0]) self.acemd = Acemd() #self.acemd.binindex='input.idx' self.acemd.extendedsystem = 'input.xsc' self.acemd.coordinates = None self.acemd.structure = None self.acemd.parameters = None self.acemd.temperature = '300' self.acemd.restart = 'on' self.acemd.restartfreq = '5000' self.acemd.outputname = 'output' self.acemd.xtcfile = 'output.xtc' self.acemd.xtcfreq = '25000' self.acemd.timestep = '4' self.acemd.rigidbonds = 'all' self.acemd.hydrogenscale = '4' self.acemd.switching = 'on' self.acemd.switchdist = '7.5' self.acemd.cutoff = '9' self.acemd.exclude = 'scaled1-4' self.acemd.scaling14 = '1.0' self.acemd.langevin = 'on' self.acemd.langevintemp = '300' self.acemd.langevindamping = '0.1' self.acemd.pme = 'on' self.acemd.pmegridspacing = '1.0' self.acemd.fullelectfrequency = '2' self.acemd.energyfreq = '5000' self.acemd.run = '$numsteps' self._TCL = '''
def __init__(self): super().__init__() self._cmdObject('acemd', ':class:`MDEngine <htmd.apps.app.App>` object', 'MD engine', None, Acemd) self._cmdValue('runtime', 'float', 'Running time of the simulation.', 25000, TYPE_FLOAT, RANGE_0POS) self._cmdString( 'timeunits', 'str', 'Units for time arguments. Can be \'steps\', \'ns\' etc.', 'steps') self._cmdValue('temperature', 'float', 'Temperature of the thermostat in Kelvin', 300, TYPE_FLOAT, RANGE_ANY) self._cmdValue( 'fb_k', 'float', 'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5', 0, TYPE_FLOAT, RANGE_ANY) self._cmdString( 'fb_reference', 'str', 'Reference selection to use as dynamic center of the flatbottom box.', 'none') self._cmdString( 'fb_selection', 'str', 'Selection of atoms to apply the flatbottom potential', 'none') self._cmdList( 'fb_box', 'list', 'Position of the flatbottom box in term of the reference center given as ' '[xmin, xmax, ymin, ymax, zmin, zmax]', [0, 0, 0, 0, 0, 0]) self._cmdBoolean( 'useconstantratio', 'bool', 'For membrane protein simulations set it to true so that the ' 'barostat does not modify the xy aspect ratio.', False) self._cmdDict( 'constraints', 'dict', 'A dictionary of atomselections and values of the constraint to be ' 'applied (in kcal/mol/A^2). Atomselects must be mutually exclusive.', { 'protein and noh and not name CA': 0.1, 'protein and name CA': 1 }) self._cmdValue( 'nvtsteps', 'int', 'Number of initial steps to apply NVT in units of 4fs.', 500, TYPE_INT, RANGE_ANY) self._cmdValue( 'constraintsteps', 'int', 'Number of initial steps to apply constraints in units of 4fs. ' 'Defaults to half the simulation time.', None, TYPE_INT, RANGE_ANY) self.acemd = Acemd() self.acemd.coordinates = None self.acemd.structure = None self.acemd.parameters = None self.acemd.temperature = '$temperature' self.acemd.restart = 'on' self.acemd.restartfreq = '5000' self.acemd.outputname = 'output' self.acemd.xtcfile = 'output.xtc' self.acemd.xtcfreq = '25000' self.acemd.timestep = '4' self.acemd.rigidbonds = 'all' self.acemd.hydrogenscale = '4' self.acemd.switching = 'on' self.acemd.switchdist = '7.5' self.acemd.cutoff = '9' self.acemd.exclude = 'scaled1-4' self.acemd.scaling14 = '1.0' self.acemd.langevin = 'on' self.acemd.langevintemp = '$temperature' self.acemd.langevindamping = '1' self.acemd.pme = 'on' self.acemd.pmegridspacing = '1.0' self.acemd.fullelectfrequency = '2' self.acemd.energyfreq = '1000' self.acemd.constraints = 'on' self.acemd.consref = None self.acemd.constraintscaling = '1.0' self.acemd.berendsenpressure = 'on' self.acemd.berendsenpressuretarget = '1.01325' self.acemd.berendsenpressurerelaxationtime = '800' self.acemd.tclforces = 'on' self.acemd.minimize = '500' self.acemd.run = '$numsteps' self.acemd.TCL = (''' set numsteps {NUMSTEPS} set temperature {TEMPERATURE} set nvtsteps {NVTSTEPS} set constraintsteps {CONSTRAINTSTEPS} set fb_refindex {{ {REFINDEX} }} set fb_selindex {{ {SELINDEX} }} set fb_box {{ {BOX} }} set fb_K {KCONST} # ''', ''' proc flatbot1d {x xm xM fb_K} { set f 0 if {$x < $xm} { set f [expr $fb_K*[expr $xm-$x]] } if {$x > $xM} { set f [expr $fb_K*[expr $xM-$x]] } return $f } proc calcforces_init {} { global ref sel fb_refindex fb_selindex berendsenpressure off set ref [addgroup $fb_refindex] set sel [addgroup $fb_selindex] } proc calcforces {} { global ref sel numsteps fb_K fb_box nvtsteps constraintsteps loadcoords coords ##FLATBOTTOM if {$fb_K>0} { set r0 $coords($ref) set r1 $coords($sel) set dr [vecsub $r1 $r0] set fx [flatbot1d [lindex $dr 0] [lindex $fb_box 0] [lindex $fb_box 1] $fb_K] set fy [flatbot1d [lindex $dr 1] [lindex $fb_box 2] [lindex $fb_box 3] $fb_K] set fz [flatbot1d [lindex $dr 2] [lindex $fb_box 4] [lindex $fb_box 5] $fb_K] #print "dr: $dr fx: $fx fy: $fy fz: $fz" addforce $sel [list $fx $fy $fz] } ##EQUIL set step [ getstep ] if { $step > $nvtsteps } { berendsenpressure on } else { berendsenpressure off } if { $step > $constraintsteps } { constraintscaling 0 } else { constraintscaling [expr 1 - 0.95*$step/$constraintsteps] } } proc calcforces_endstep { } { } ''')
def __init__(self): super().__init__() self._cmdObject('acemd', ':class:`MDEngine <htmd.apps.app.App>` object', 'MD engine', None, Acemd) self._cmdValue('runtime', 'float', 'Running time of the simulation.', 0, TYPE_FLOAT, RANGE_0POS) self._cmdString('timeunits', 'str', 'Units for runtime. Can be \'steps\', \'ns\' etc.', 'steps') self._cmdValue('temperature', 'float', 'Temperature of the thermostat in Kelvin', 300, TYPE_FLOAT, RANGE_ANY) self._cmdValue( 'fb_k', 'float', 'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5', 0, TYPE_FLOAT, RANGE_ANY) self._cmdString( 'fb_reference', 'str', 'Reference selection to use as dynamic center of the flatbottom box.', 'none') self._cmdString( 'fb_selection', 'str', 'Selection of atoms to apply the flatbottom potential', 'none') self._cmdList( 'fb_box', 'list', 'Position of the flatbottom box in term of the reference center given as [xmin, xmax, ymin, ymax, zmin, zmax]', [0, 0, 0, 0, 0, 0]) self.acemd = Acemd() #self.acemd.binindex='input.idx' self.acemd.extendedsystem = 'input.xsc' self.acemd.coordinates = None self.acemd.structure = None self.acemd.parameters = None self.acemd.temperature = '300' self.acemd.restart = 'on' self.acemd.restartfreq = '5000' self.acemd.outputname = 'output' self.acemd.xtcfile = 'output.xtc' self.acemd.xtcfreq = '25000' self.acemd.timestep = '4' self.acemd.rigidbonds = 'all' self.acemd.hydrogenscale = '4' self.acemd.switching = 'on' self.acemd.switchdist = '7.5' self.acemd.cutoff = '9' self.acemd.exclude = 'scaled1-4' self.acemd.scaling14 = '1.0' self.acemd.langevin = 'on' self.acemd.langevintemp = '300' self.acemd.langevindamping = '0.1' self.acemd.pme = 'on' self.acemd.pmegridspacing = '1.0' self.acemd.fullelectfrequency = '2' self.acemd.energyfreq = '5000' self.acemd.run = '$numsteps' self.acemd.TCL = (''' set numsteps {NUMSTEPS} set fb_refindex {{ {REFINDEX} }} set fb_selindex {{ {SELINDEX} }} set fb_box {{ {BOX} }} set fb_K {KCONST} # ''', ''' proc flatbot1d {x xm xM fb_K} { set f 0 if {$x < $xm} { set f [expr $fb_K*[expr $xm-$x]] } if {$x > $xM} { set f [expr $fb_K*[expr $xM-$x]] } return $f } proc calcforces_init {} { global ref sel fb_refindex fb_selindex berendsenpressure off set ref [addgroup $fb_refindex] set sel [addgroup $fb_selindex] } proc calcforces {} { global ref sel fb_K fb_box loadcoords coords ##FLATBOTTOM if {$fb_K>0} { set r0 $coords($ref) set r1 $coords($sel) set dr [vecsub $r1 $r0] set fx [flatbot1d [lindex $dr 0] [lindex $fb_box 0] [lindex $fb_box 1] $fb_K] set fy [flatbot1d [lindex $dr 1] [lindex $fb_box 2] [lindex $fb_box 3] $fb_K] set fz [flatbot1d [lindex $dr 2] [lindex $fb_box 4] [lindex $fb_box 5] $fb_K] #print "dr: $dr fx: $fx fy: $fy fz: $fz" addforce $sel [list $fx $fy $fz] } } proc calcforces_endstep { } { } ''')
def __init__(self): super().__init__() self._cmdObject('acemd', ':class:`MDEngine <htmd.apps.app.App>` object', 'MD engine', None, Acemd) self._cmdValue( 'numsteps', 'int', 'Number of steps to run the simulations in units of 4fs', 0, TYPE_INT, RANGE_0POS) self._cmdValue('temperature', 'float', 'Temperature of the thermostat in Kelvin', 300, TYPE_FLOAT, RANGE_ANY) self._cmdValue( 'k', 'float', 'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5', 0, TYPE_FLOAT, RANGE_ANY) self._cmdString( 'reference', 'str', 'Reference selection to use as dynamic center of the flatbottom box.', 'none') self._cmdString( 'selection', 'str', 'Selection of atoms to apply the flatbottom potential', 'none') self._cmdList( 'box', 'list', 'Position of the flatbottom box in term of the reference center given as [xmin, xmax, ymin, ymax, zmin, zmax]', [0, 0, 0, 0, 0, 0]) self._cmdBoolean( 'useconstantratio', 'bool', 'For membrane protein simulations set it to true so that the barostat does not modify the xy aspect ratio.', False) self._cmdDict( 'constraints', 'dict', 'A dictionary containing as keys the atomselections of the constraints ' 'and as values the constraint scaling factor. 0 factor means no constraint' ', 1 full constraints and in between values are used for scaling.' ' The order with which the constraints are applied is random, so make ' 'atomselects mutually exclusive to be sure you get the correct constraints.', { 'protein and noh and not name CA': 0.1, 'protein and name CA': 1 }) self.acemd = Acemd() self.acemd.coordinates = None self.acemd.structure = None self.acemd.parameters = None self.acemd.temperature = '$temperature' self.acemd.restart = 'on' self.acemd.restartfreq = '5000' self.acemd.outputname = 'output' self.acemd.xtcfile = 'output.xtc' self.acemd.xtcfreq = '25000' self.acemd.timestep = '4' self.acemd.rigidbonds = 'all' self.acemd.hydrogenscale = '4' self.acemd.switching = 'on' self.acemd.switchdist = '7.5' self.acemd.cutoff = '9' self.acemd.exclude = 'scaled1-4' self.acemd.scaling14 = '1.0' self.acemd.langevin = 'on' self.acemd.langevintemp = '$temperature' self.acemd.langevindamping = '1' self.acemd.pme = 'on' self.acemd.pmegridspacing = '1.0' self.acemd.fullelectfrequency = '2' self.acemd.energyfreq = '1000' self.acemd.constraints = 'on' self.acemd.consref = None self.acemd.constraintscaling = '1.0' self.acemd.berendsenpressure = 'on' self.acemd.berendsenpressuretarget = '1.01325' self.acemd.berendsenpressurerelaxationtime = '800' self.acemd.tclforces = 'on' self.acemd.minimize = '500' self.acemd.run = '$numsteps' self.acemd.TCL = '''