LeesEdwardsBoxDeformer

class hoomd.md.deform.LeesEdwardsBoxDeformer(shear_rate, max_tilt=0.5)

Bases: BoxDeformer

Box deformation with Lees-Edwards boundary conditions.

Parameters:
  • shear_rate (float) – Shear rate [time−1][\mathrm{time}^{-1}].

  • max_tilt (float) – Maximum allowed value of the box tilt factor xy before a box flip is performed. It must be positive. Defaults to 0.5.

LeesEdwardsBoxDeformer applies Lees-Edwards boundary conditions to impose a homogeneous shear flow in the simulation box by manipulating the box tilt factor xy.

The box tilt deforms as

xy(t)=xy(0)+γ˙ t,xy(t) = xy(0) + \dot{\gamma} \, t,

where γ˙\dot{\gamma} is the imposed shear rate.

This produces a linear velocity profile

vx(y)=γ˙yv_x(y) = \dot{\gamma} y

corresponding to a simple shear flow in the x-direction, with gradient in the y-direction.

The max_tilt parameter controls when the simulation box is flipped to avoid excessive skew. When |xy| > max_tilt, the box is flipped (remapped by a lattice vector) to bring the tilt back into the range [-max_tilt, max_tilt].

Box flipping and particle remap is mathematically equivalent to the original sheared system and does not affect the dynamics or measured properties, but it improves numerical stability and avoids highly distorted boxes.

Note

  • Values of max_tilt around 0.5 are commonly used and provide a good balance between minimizing remapping frequency and avoiding extreme box distortions.

  • Smaller values lead to more frequent flips, while larger values may result in highly skewed boxes that can impact computational performance.

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...

Members inherited from BoxDeformer:

Members defined in LeesEdwardsBoxDeformer:

max_tilt

Maximum allowed tilt before remapping.

Type:

float

shear_rate

Imposed shear rate [time−1][\mathrm{time}^{-1}].

Type:

float

Example

Create the deformer and attach it to the Integrator.

deformer = hoomd.md.deform.LeesEdwardsBoxDeformer(
    shear_rate=0.01,
    max_tilt=0.5,
)
integrator = hoomd.md.Integrator(dt=0.005, deformer=deformer)