def test_LennardJonesPair():

    # just touch a bunch of stuff to make sure the work

    testsys = LennardJonesPair()
    assert hasattr(testsys, 'mdtraj_topology')
    assert hasattr(testsys, 'topology')
    assert hasattr(testsys, 'system')
    assert hasattr(testsys, 'positions')
    assert hasattr(testsys, 'receptor_indices')
    assert hasattr(testsys, 'ligand_indices')
Exemplo n.º 2
0
    def __init__(self):

        # must set this here since we need it to generate the state,
        # will get called again in the superclass method
        self.getState_kwargs = dict(GET_STATE_KWARG_DEFAULTS)
        if self.GET_STATE_KWARGS is not None:
            self.getState_kwargs.update(self.GET_STATE_KWARGS)

        test_sys = LennardJonesPair()

        init_state = self.make_state(test_sys.system, test_sys.positions)

        super().__init__(
            distance=PairDistance(),
            init_state=init_state,
            system=test_sys.system,
            topology=test_sys.topology,
        )
Exemplo n.º 3
0
def create_sim():

    test_sys = LennardJonesPair()

    integrator = omm.LangevinIntegrator(300.0*unit.kelvin,
                                        1/unit.picosecond,
                                        0.002*unit.picoseconds)

    init_state = gen_sim_state(test_sys.positions, test_sys.system, integrator)

    platform = omm.Platform.getPlatformByName('CPU')

    simulation = omma.Simulation(
        test_sys.topology,
        test_sys.system,
        integrator,
        platform=platform,
    )

    simulation.context.setState(init_state)

    return simulation
Exemplo n.º 4
0
        import simtk.unit as unit

        from openmm_systems.test_systems import LennardJonesPair

        from wepy.resampling.resamplers.resampler import NoResampler
        from wepy.runners.openmm import OpenMMRunner, gen_walker_state
        from wepy.walker import Walker
        from wepy.sim_manager import Manager

        from wepy.work_mapper.mapper import Mapper
        # from wepy.work_mapper.thread import ThreadMapper


    # use a ready made system for OpenMM MD simulation
    with start_action(action_type="Instantiate test system"):
        test_sys = LennardJonesPair()

    with start_action(action_type="Gen Runner"):
        integrator = omm.LangevinIntegrator(300.0*unit.kelvin,
                                            1/unit.picosecond,
                                            0.002*unit.picoseconds)

        init_state = gen_walker_state(test_sys.positions, test_sys.system, integrator)

        runner = OpenMMRunner(test_sys.system, test_sys.topology, integrator,
                              platform='Reference')

    # a trivial resampler which does nothing
    with start_action(action_type="Instantiate Resampler"):
        resampler = NoResampler()
Exemplo n.º 5
0
def lj_omm_sys():
    return LennardJonesPair()