Exemple #1
0
    def __init__(self, config_: Config, old_sampler_state=None):
        """

        :param systemLoader:
        :param config:
        """
        self._times = None
        self.config = config_
        self.logger = make_message_writer(self.config.verbose, self.__class__.__name__)
        if self.config.systemloader.system is None:
            self.system = self.config.systemloader.get_system(self.config.parameters.createSystem)
            self.topology = self.config.systemloader.topology
            positions, velocities = self.config.systemloader.get_positions(), None

        else:
            self.system = self.config.systemloader.system
            self.topology = self.config.systemloader.topology
            positions, velocities = self.config.systemloader.get_positions(), None

        self.topology = self.config.systemloader.topology
        self.explicit = self.config.systemloader.explicit

        integrator = integrators.GeodesicBAOABIntegrator(temperature=self.config.parameters.integrator_params['temperature'],
                                                    timestep=self.config.parameters.integrator_params['timestep'],
                                                    collision_rate=self.config.parameters.integrator_params[
                                                        'collision_rate'],
                                                    constraint_tolerance=self.config.parameters.integrator_setConstraintTolerance)
        self.simulation = app.Simulation(self.topology, self.system, integrator,
                                         self.config.parameters.platform, self.config.parameters.platform_config)
        self.simulation.context.setPositions(self.config.systemloader.positions)
        self.simulation.minimizeEnergy(self.config.parameters.minMaxIters)
        self.simulation.context.setVelocitiesToTemperature(self.config.parameters.integrator_params['temperature'])
Exemple #2
0
 def _get_default_integrator(temperature):
     """Return a new instance of the default integrator."""
     # Use a likely-to-be-used Integrator.
     return integrators.GeodesicBAOABIntegrator(temperature=temperature)