Water bulk

Bulk water can be packed using the pack_water method implemented in molecular-builder. The functionality is based on Packmol. Make sure that Packmol installed before using the function.

First, a geometry where the water should be packed has to be defined. Most of the geometries available in molecular-builder (but not all of them) are supported by Packmol, including:

  • SphereGeometry

  • CubeGeometry

  • BoxGeometry

  • PlaneGeometry

  • CylinderGeometry

  • EllipsoidGeometry

  • OctahedronGeometry

  • DodecahedronGeometry

  • TriclinicCellGeometry

Then, the geometry is sent into pack_water using the geometry argument. Below, an example where 2000 water molecules are packed into a box of dimensions (100Å, 50Å, 50Å) is given.


from molecular_builder import pack_water, write
from molecular_builder.geometry import BoxGeometry

geometry = BoxGeometry((50, 25, 25), (100, 50, 50))
atoms = pack_water(nummol=2000, geometry=geometry)

write(atoms, "box.data")
write(atoms, "box.png", camera_dir=[1, 2, -1])
examples/water_bulk/box.png