예제 #1
0
    def __init__(self, _version=_config["acemdversion"]):
        if _version == 2:
            raise RuntimeError("Equilibration v3 only supports _version=3")

        super().__init__()
        self._arg(
            "acemd",
            ":class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>` object",
            "Acemd class object",
            None,
            val.Object([Acemd2, Acemd]),
        )
        self._arg(
            "runtime",
            "float",
            "Running time of the simulation.",
            25000,
            val.Number(float, "0POS"),
        )
        self._arg(
            "timeunits",
            "str",
            "Units for time arguments. Can be 'steps', 'ns' etc.",
            "steps",
            val.String(),
        )
        self._arg(
            "temperature",
            "float",
            "Temperature of the thermostat in Kelvin",
            300,
            val.Number(float, "ANY"),
        )
        self._arg(
            "useconstantratio",
            "bool",
            "For membrane protein simulations set it to true so that the barostat "
            "does not modify the xy aspect ratio.",
            False,
            val.Boolean(),
        )
        self._arg(
            "restraintsteps",
            "int",
            "Number of initial steps to apply restraints in units of 4fs. Defaults "
            "to half the simulation time.",
            None,
            val.Number(int, "ANY"),
        )
        self._arg(
            "restraints",
            "list",
            "A list of restraint objects. If None will apply defaultEquilRestraints decaying over half the runtime. If no restraints are required set to empty list []."
            "See :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and"
            ":class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`)",
            None,
            val.Object(_Restraint),
            nargs="*",
        )

        self.acemd = Acemd()
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = "on"
        self.acemd.trajectoryfile = "output.xtc"
        self.acemd.trajectoryperiod = 25000
        self.acemd.timestep = 4
        self.acemd.switching = "on"
        self.acemd.switchdistance = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = "on"
        self.acemd.thermostatdamping = 1
        self.acemd.pme = "on"
        self.acemd.barostat = "on"
        self.acemd.barostatpressure = 1.01325
        self.acemd.minimize = 500
예제 #2
0
    def __init__(self, _version=2):
        super().__init__()
        self._version = _version
        self._arg(
            'acemd',
            ':class:`Acemd2 <htmd.apps.acemd.Acemd>` or :class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>`'
            ' object', 'Acemd class object', None, val.Object([Acemd2, Acemd]))
        self._arg('runtime', 'float', 'Running time of the simulation.', 25000,
                  val.Number(float, '0POS'))
        self._arg('timeunits', 'str',
                  'Units for runtime. Can be \'steps\', \'ns\' etc.', 'steps',
                  val.String())
        self._arg('temperature', 'float',
                  'Temperature of the thermostat in Kelvin', 300,
                  val.Number(float, 'ANY'))
        self._arg(
            'fb_k', 'float',
            'Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5',
            0, val.Number(float, 'ANY'))
        self._arg(
            'fb_reference', 'str',
            'Reference selection to use as dynamic center of the flatbottom box.',
            'none', val.String())
        self._arg('fb_selection', 'str',
                  'Selection of atoms to apply the flatbottom potential',
                  'none', val.String())
        self._arg(
            '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],
            val.Number(float, 'ANY'),
            nargs=6)
        self._arg(
            'useconstantratio', 'bool',
            'For membrane protein simulations set it to true so that the barostat '
            'does not modify the xy aspect ratio.', False, val.Boolean())
        self._arg(
            'useconstraints', 'bool',
            'Apply constraints to the production simulation, defined by the '
            'constraints parameter', False, val.Boolean())
        self._arg(
            'constraints', 'dict',
            'A dictionary of atomselections and values of the constraint to be '
            'applied (in kcal/mol/A^2). Atomselects must be mutually exclusive.',
            {}, val.Dictionary(key_type=str))
        self._arg(
            'adaptive', 'bool',
            'Set to True if making production runs for adaptive sampling.',
            False, val.Boolean())
        self._arg(
            'restraints',
            'list',
            'A list of restraint objects. Only works with {}(_version=3),'
            'see :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and'
            ':class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`'
            ')'.format(self.__class__.__name__),
            None,
            val.Object(_Restraint),
            nargs='*')

        if self._version == 2:
            self.acemd = Acemd2()
            self.acemd.binindex = None
            self.acemd.binvelocities = None
            self.acemd.bincoordinates = 'output.coor'
            self.acemd.extendedsystem = 'output.xsc'
            self.acemd.coordinates = None
            self.acemd.structure = None
            self.acemd.parameters = None
            self.acemd.temperature = None
            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 = None
            self.acemd.langevindamping = '0.1'
            self.acemd.pme = 'on'
            self.acemd.pmegridspacing = '1.0'
            self.acemd.fullelectfrequency = '2'
            self.acemd.energyfreq = '5000'
            self.acemd.consref = None
            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 { } { }
''')
        elif self._version == 3:
            self.acemd = Acemd()
            self.acemd.binvelocities = None
            self.acemd.bincoordinates = 'output.coor'
            self.acemd.extendedsystem = 'output.xsc'
            self.acemd.coordinates = None
            self.acemd.structure = None
            self.acemd.parameters = None
            self.acemd.restart = 'on'
            self.acemd.trajectoryfile = 'output.xtc'
            self.acemd.trajectoryfreq = 25000
            self.acemd.timestep = 4
            self.acemd.switching = 'on'
            self.acemd.switchdist = 7.5
            self.acemd.cutoff = 9
            self.acemd.thermostat = 'on'
            self.acemd.thermostatdamping = 0.1
            self.acemd.pme = 'on'
        else:
            raise ValueError(
                '_version can not be {}. Choose either 2 or 3.'.format(
                    self._version))
예제 #3
0
    def __init__(self):
        super().__init__()
        self._arg(
            "acemd",
            ":class:`Acemd <htmd.mdengine.acemd.acemd.Acemd>`"
            " object",
            "Acemd class object",
            None,
            val.Object(Acemd),
        )
        self._arg(
            "runtime",
            "float",
            "Running time of the simulation.",
            25000,
            val.Number(float, "0POS"),
        )
        self._arg(
            "timeunits",
            "str",
            "Units for runtime. Can be 'steps', 'ns' etc.",
            "steps",
            val.String(),
        )
        self._arg(
            "temperature",
            "float",
            "Temperature of the thermostat in Kelvin",
            300,
            val.Number(float, "ANY"),
        )
        self._arg(
            "fb_k",
            "float",
            "Force constant of the flatbottom potential in kcal/mol/A^2. E.g. 5",
            0,
            val.Number(float, "ANY"),
        )
        self._arg(
            "fb_reference",
            "str",
            "Reference selection to use as dynamic center of the flatbottom box.",
            "none",
            val.String(),
        )
        self._arg(
            "fb_selection",
            "str",
            "Selection of atoms to apply the flatbottom potential",
            "none",
            val.String(),
        )
        self._arg(
            "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],
            val.Number(float, "ANY"),
            nargs=6,
        )
        self._arg(
            "useconstantratio",
            "bool",
            "For membrane protein simulations set it to true so that the barostat "
            "does not modify the xy aspect ratio.",
            False,
            val.Boolean(),
        )
        self._arg(
            "useconstraints",
            "bool",
            "Apply constraints to the production simulation, defined by the "
            "constraints parameter",
            False,
            val.Boolean(),
        )
        self._arg(
            "constraints",
            "dict",
            "A dictionary of atomselections and values of the constraint to be "
            "applied (in kcal/mol/A^2). Atomselects must be mutually exclusive.",
            {},
            val.Dictionary(key_type=str),
        )
        self._arg(
            "adaptive",
            "bool",
            "Set to True if making production runs for adaptive sampling.",
            False,
            val.Boolean(),
        )
        self._arg(
            "restraints",
            "list",
            "A list of restraint objects."
            "See :class:`AtomRestraint <htmd.mdengine.acemd.acemd.AtomRestraint>` and"
            ":class:`GroupRestraint <htmd.mdengine.acemd.acemd.GroupRestraint>`"
            ")",
            None,
            val.Object(_Restraint),
            nargs="*",
        )

        self.acemd = Acemd()
        self.acemd.binvelocities = None
        self.acemd.bincoordinates = "output.coor"
        self.acemd.extendedsystem = "output.xsc"
        self.acemd.coordinates = None
        self.acemd.structure = None
        self.acemd.parameters = None
        self.acemd.restart = "on"
        self.acemd.trajectoryfile = "output.xtc"
        self.acemd.trajectoryperiod = 25000
        self.acemd.timestep = 4
        self.acemd.switching = "on"
        self.acemd.switchdistance = 7.5
        self.acemd.cutoff = 9
        self.acemd.thermostat = "on"
        self.acemd.thermostatdamping = 0.1
        self.acemd.pme = "on"