# md.methods.rattle#

Overview

 MethodRATTLE Base class RATTLE integration method. Brownian Brownian dynamics with RATTLE constraint. DisplacementCapped Newtonian dynamics with a cap on the maximum displacement per time step. Langevin Langevin dynamics with RATTLE constraint. NVE NVE Integration via Velocity-Verlet with RATTLE constraint. OverdampedViscous Overdamped viscous dynamics with RATTLE constraint.

Details

MD integration methods with manifold constraints.

class hoomd.md.methods.rattle.Brownian(filter, kT, manifold_constraint, tolerance=1e-06)#

Brownian dynamics with RATTLE constraint.

Parameters:
• filter (hoomd.filter.filter_like) – Subset of particles to apply this method to.

• kT (hoomd.variant.variant_like) – Temperature of the simulation $$[\mathrm{energy}]$$.

• manifold_constraint (hoomd.md.manifold.Manifold) – Manifold constraint.

• tolerance (float) – Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Brownian uses the same integrator as hoomd.md.methods.Brownian, which follows the overdamped Langevin equations of motion with the additional force term $$- \lambda \vec{F}_\mathrm{M}$$. The force $$\vec{F}_\mathrm{M}$$ keeps the particles on the manifold constraint, where the Lagrange multiplier $$\lambda$$ is calculated via the RATTLE algorithm. For more details about Brownian dynamics see hoomd.md.methods.Brownian.

Examples of using manifold_constraint:

sphere = hoomd.md.manifold.Sphere(r=10)
brownian_rattle = hoomd.md.methods.rattle.Brownian(
filter=hoomd.filter.All(), kT=0.2, manifold_constraint=sphere,
seed=1)
integrator = hoomd.md.Integrator(dt=0.001, methods=[brownian_rattle],
forces=[lj])

filter#

Subset of particles to apply this method to.

Type:

hoomd.filter.filter_like

kT#

Temperature of the simulation $$[\mathrm{energy}]$$.

Type:

hoomd.variant.Variant

manifold_constraint#

Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.

Type:

hoomd.md.manifold.Manifold

tolerance#

Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Type:

float

gamma#

The drag coefficient for each particle type $$[\mathrm{mass} \cdot \mathrm{time}^{-1}]$$.

Type:

TypeParameter[ particle type, float ]

gamma_r#

The rotational drag coefficient tensor for each particle type $$[\mathrm{time}^{-1}]$$.

Type:

TypeParameter[particle type,[float, float , float]]

class hoomd.md.methods.rattle.DisplacementCapped(filter: , maximum_displacement: , manifold_constraint: Manifold, tolerance: float = 1e-06)#

Newtonian dynamics with a cap on the maximum displacement per time step.

Integration is via a maximum displacement capped Velocity-Verlet with RATTLE constraint. This class is useful to relax a simulation on a manifold.

Warning

This method does not conserve energy or momentum.

Parameters:
• filter (hoomd.filter.filter_like) – Subset of particles on which to apply this method.

• maximum_displacement (hoomd.variant.variant_like) – The maximum displacement allowed for a particular timestep $$[\mathrm{length}]$$.

• manifold_constraint (hoomd.md.manifold.Manifold) – Manifold constraint.

• tolerance (float, optional) – Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

DisplacementCapped performs constant volume simulations as described in hoomd.md.methods.DisplacementCapped. In addition the particles are constrained to a manifold by using the RATTLE algorithm.

Examples:

sphere = hoomd.md.manifold.Sphere(r=10)
relax_rattle = hoomd.md.methods.rattle.DisplacementCapped(
filter=hoomd.filter.All(), maximum_displacement=0.01,
manifold=sphere)
integrator = hoomd.md.Integrator(
dt=0.005, methods=[relax_rattle], forces=[lj])

filter#

Subset of particles on which to apply this method.

Type:

hoomd.filter.filter_like

maximum_displacement#

The maximum displacement allowed for a particular timestep $$[\mathrm{length}]$$.

Type:

hoomd.variant.variant_like

manifold_constraint#

Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.

Type:

hoomd.md.manifold.Manifold

tolerance#

Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Type:

float

class hoomd.md.methods.rattle.Langevin(filter, kT, manifold_constraint, tally_reservoir_energy=False, tolerance=1e-06)#

Langevin dynamics with RATTLE constraint.

Parameters:
• filter (hoomd.filter.filter_like) – Subset of particles to apply this method to.

• kT (hoomd.variant.variant_like) – Temperature of the simulation $$[\mathrm{energy}]$$.

• manifold_constraint (hoomd.md.manifold.Manifold) – Manifold constraint.

• tally_reservoir_energy (bool) – If true, the energy exchange between the thermal reservoir and the particles is tracked. Total energy conservation can then be monitored by adding langevin_reservoir_energy_groupname to the logged quantities. Defaults to False $$[\mathrm{energy}]$$.

• tolerance (float) – Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Translational degrees of freedom

Langevin uses the same integrator as hoomd.md.methods.Langevin, which follows the Langevin equations of motion with the additional force term $$- \lambda \vec{F}_\mathrm{M}$$. The force $$\vec{F}_\mathrm{M}$$ keeps the particles on the manifold constraint, where the Lagrange multiplier $$\lambda$$ is calculated via the RATTLE algorithm. For more details about Langevin dynamics see hoomd.md.methods.Langevin.

Use Brownian if your system is not underdamped.

Example:

sphere = hoomd.md.manifold.Sphere(r=10)
langevin_rattle = hoomd.md.methods.rattle.Langevin(
filter=hoomd.filter.All(), kT=0.2, manifold_constraint=sphere,
seed=1)

filter#

Subset of particles to apply this method to.

Type:

hoomd.filter.filter_like

kT#

Temperature of the simulation $$[\mathrm{energy}]$$.

Type:

hoomd.variant.Variant

manifold_constraint#

Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.

Type:

hoomd.md.manifold.Manifold

tolerance#

Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Type:

float

gamma#

The drag coefficient for each particle type $$[\mathrm{mass} \cdot \mathrm{time}^{-1}]$$.

Type:

TypeParameter[ particle type, float ]

gamma_r#

The rotational drag coefficient tensor for each particle type $$[\mathrm{time}^{-1}]$$.

Type:

TypeParameter[particle type,[float, float , float]]

class hoomd.md.methods.rattle.MethodRATTLE(manifold_constraint, tolerance)#

Base class RATTLE integration method.

Provides common methods for all integration methods which implement the RATTLE algorithm to constrain particles to a manifold surface.

Warning

The particles should be initialised close to the implicit surface of the manifold. Even though the particles are mapped to the set surface automatically, the mapping can lead to small inter-particle distances and, hence, large forces between particles!

Note

Users should use the subclasses and not instantiate MethodRATTLE directly.

class hoomd.md.methods.rattle.NVE(filter, manifold_constraint, tolerance=1e-06)#

NVE Integration via Velocity-Verlet with RATTLE constraint.

Parameters:
• filter (hoomd.filter.filter_like) – Subset of particles on which to apply this method.

• manifold_constraint (hoomd.md.manifold.Manifold) – Manifold constraint.

• tolerance (float) – Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

NVE performs constant volume, constant energy simulations as described in hoomd.md.methods.ConstantVolume without any thermostat. In addition the particles are constrained to a manifold by using the RATTLE algorithm.

Examples:

sphere = hoomd.md.manifold.Sphere(r=10)
nve_rattle = hoomd.md.methods.rattle.NVE(
filter=hoomd.filter.All(),maifold=sphere)
integrator = hoomd.md.Integrator(
dt=0.005, methods=[nve_rattle], forces=[lj])

filter#

Subset of particles on which to apply this method.

Type:

hoomd.filter.filter_like

manifold_constraint#

Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.

Type:

hoomd.md.manifold.Manifold

tolerance#

Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Type:

float

class hoomd.md.methods.rattle.OverdampedViscous(filter, manifold_constraint, tolerance=1e-06)#

Overdamped viscous dynamics with RATTLE constraint.

Parameters:
• filter (hoomd.filter.filter_like) – Subset of particles to apply this method to.

• manifold_constraint (hoomd.md.manifold.Manifold) – Manifold constraint.

• tolerance (float) – Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

OverdampedViscous uses the same integrator as hoomd.md.methods.OverdampedViscous, with the additional force term $$- \lambda \vec{F}_\mathrm{M}$$. The force $$\vec{F}_\mathrm{M}$$ keeps the particles on the manifold constraint, where the Lagrange multiplier $$\lambda$$ is calculated via the RATTLE algorithm. For more details about overdamped viscous dynamics see hoomd.md.methods.OverdampedViscous.

Examples of using manifold_constraint:

sphere = hoomd.md.manifold.Sphere(r=10)
odv_rattle = hoomd.md.methods.rattle.OverdampedViscous(
filter=hoomd.filter.All(), manifold_constraint=sphere, seed=1)
integrator = hoomd.md.Integrator(
dt=0.001, methods=[odv_rattle], forces=[lj])

filter#

Subset of particles to apply this method to.

Type:

hoomd.filter.filter_like

manifold_constraint#

Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.

Type:

hoomd.md.manifold.Manifold

tolerance#

Defines the tolerated error particles are allowed to deviate from the manifold in terms of the implicit function. The units of tolerance match that of the selected manifold’s implicit function. Defaults to 1e-6

Type:

float

gamma#

The drag coefficient for each particle type $$[\mathrm{mass} \cdot \mathrm{time}^{-1}]$$.

Type:

TypeParameter[ particle type, float ]

gamma_r#

The rotational drag coefficient tensor for each particle type $$[\mathrm{time}^{-1}]$$.

Type:

TypeParameter[particle type,[float, float , float]]