htmd.membranebuilder.ljfluid module#

htmd.membranebuilder.ljfluid.distributeLipids(boxsize, resnames, sigmas, cutoff, mass=39.9 Da, epsilon=0.238 kcal/mol, switch_width=3.4 A, forbidden_xy=None, forbidden_radii=None, platform_name=None)#

Distribute lipid heads on a 2D plane using a short LJ-fluid simulation.

Lipid heads are modeled as Lennard-Jones spheres whose sigma values are chosen to reproduce the target area-per-lipid in a hexagonally packed monolayer. A Halton-sequence initial placement is followed by an OpenMM Verlet simulation that relaxes the heads into a physical arrangement. Obstacles (e.g. solute footprint atoms) can be provided to exclude lipids from a forbidden XY region.

Parameters:
  • boxsize (list | ndarray) – Periodic box dimensions [Lx, Ly, Lz] in Angstroms. The Z extent is used only to define the OpenMM box; lipids are confined to z=0.

  • resnames (list) – Residue names for each lipid particle. Length determines the number of particles.

  • sigmas (ndarray) – Per-particle LJ sigma values in Angstroms. Length must match resnames.

  • cutoff (float) – Lennard-Jones cutoff distance in Angstroms.

  • mass (openmm.unit.Quantity, optional) – Particle mass. Defaults to argon mass (39.9 amu).

  • epsilon (openmm.unit.Quantity, optional) – LJ well depth. Defaults to argon epsilon (0.238 kcal/mol).

  • switch_width (openmm.unit.Quantity, optional) – LJ switching function width. Defaults to 3.4 Angstroms (argon).

  • forbidden_xy (ndarray | None) – XY coordinates of obstacle atoms, shape (K, 2). Halton candidates inside any obstacle disk are excluded before the LJ simulation.

  • forbidden_radii (ndarray | None) – Per-obstacle exclusion radii in Angstroms, shape (K,). Required when forbidden_xy is provided.

  • platform_name (str | None) – OpenMM platform name. If None, OpenMM selects the fastest available platform.

Return type:

tuple

Returns:

  • final_positions (numpy.ndarray) – Post-LJ-simulation XY head positions for each lipid, shape (N, 3), in the caller’s coordinate frame.

  • initial_positions (numpy.ndarray) – Pre-simulation Halton-filtered positions, shape (N, 3).