def walls(self, wall_list): if self._walls is wall_list: return self._walls = hoomd.wall._WallsMetaList(wall_list, _to_md_cpp_wall) if self._attached: self._walls._sync({ hoomd.wall.Sphere: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Sphere)), hoomd.wall.Cylinder: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Cylinder)), hoomd.wall.Plane: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Plane)), })
def empty_collection(self, mode): self._wall_collection = _md.WallCollection._unsafe_create() get_array_view = getattr(self._wall_collection, f"get_{mode}_list") if self._cpp_view: return get_array_view() return _ArrayViewWrapper(get_array_view)
def _attach(self): if isinstance(self._simulation.device, hoomd.device.CPU): cls = getattr(_md, self._cpp_class_name) else: cls = getattr(_md, self._cpp_class_name + "GPU") self._cpp_obj = cls(self._simulation.state._cpp_sys_def) self._walls._sync({ hoomd.wall.Sphere: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Sphere)), hoomd.wall.Cylinder: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Cylinder)), hoomd.wall.Plane: _ArrayViewWrapper( _WallArrayViewFactory(self._cpp_obj, hoomd.wall.Plane)), }) super()._attach()