Ejemplo n.º 1
0
    def box(self):
        """hoomd.Box: The current simulation box.

        Editing the box directly is not allowed. For example
        ``state.box.scale(1.1)`` would not scale the state's box. To set the
        state's box to a new box ``state.box = new_box`` must be used.
        """
        b = Box._from_cpp(self._cpp_sys_def.getParticleData().getGlobalBox())
        return Box.from_box(b)
Ejemplo n.º 2
0
    def box(self):
        """hoomd.Box: A copy of the current simulation box.

        Note:
            The `box` property cannot be set. Call `set_box` to set a new
            simulation box.
        """
        b = Box._from_cpp(self._cpp_sys_def.getParticleData().getGlobalBox())
        return Box.from_box(b)
Ejemplo n.º 3
0
    def get_box(self, timestep):
        """Get the box for a given timestep.

        Args:
            timestep (int): The timestep to use for determining the resized
                box.

        Returns:
            Box: The box used at the given timestep.
        """
        if self._attached:
            timestep = int(timestep)
            if timestep < 0:
                raise ValueError("Timestep must be a non-negative integer.")
            return Box._from_cpp(self._cpp_obj.get_current_box(timestep))
        else:
            return None