Exemple #1
0
    def _attach(self):

        sim = self._simulation
        if self.manifold_constraint is None:
            if isinstance(sim.device, hoomd.device.CPU):
                self._cpp_obj = _md.TwoStepBD(sim.state._cpp_sys_def,
                                              sim.state._get_group(self.filter),
                                              self.kT)
            else:
                self._cpp_obj = _md.TwoStepBDGPU(sim.state._cpp_sys_def,
                                                 sim.state._get_group(self.filter),
                                                 self.kT)
        else:
            self._attach_constraint(sim)

            if isinstance(sim.device, hoomd.device.CPU):
                my_class = getattr(_md, 'TwoStepRATTLEBD' + self.manifold_constraint.__class__.__name__)
            else:
                my_class = getattr(_md, 'TwoStepRATTLEBD' + self.manifold_constraint.__class__.__name__ + 'GPU')

            self._cpp_obj = my_class(sim.state._cpp_sys_def,
                                     sim.state._get_group(self.filter),
                                     self.manifold_constraint._cpp_obj,
                                     self.kT, self.tolerance)

        # Attach param_dict and typeparam_dict
        super()._attach()
Exemple #2
0
    def _attach(self):

        sim = self._simulation
        if isinstance(sim.device, hoomd.device.CPU):
            self._cpp_obj = _md.TwoStepBD(sim.state._cpp_sys_def,
                                          sim.state._get_group(self.filter),
                                          self.kT, False, False)
        else:
            self._cpp_obj = _md.TwoStepBDGPU(sim.state._cpp_sys_def,
                                             sim.state._get_group(self.filter),
                                             self.kT, False, False)

        # Attach param_dict and typeparam_dict
        super()._attach()
Exemple #3
0
    def _attach(self):

        # initialize the reflected c++ class
        sim = self._simulation
        if isinstance(sim.device, hoomd.device.CPU):
            self._cpp_obj = _md.TwoStepBD(sim.state._cpp_sys_def,
                                          sim.state._get_group(self.filter),
                                          self.kT, self.seed)
        else:
            self._cpp_obj = _md.TwoStepBDGPU(sim.state._cpp_sys_def,
                                             sim.state._get_group(self.filter),
                                             self.kT, self.seed)

        # Attach param_dict and typeparam_dict
        super()._attach()