md.methods.rattle

Overview

MethodRATTLE

Base class RATTLE integration method.

Brownian

Brownian dynamics with RATTLE constraint.

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, alpha=None)

Brownian dynamics with RATTLE constraint.

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

  • kT (hoomd.variant.Variant or float) – Temperature of the simulation \([\mathrm{energy}]\).

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

  • alpha (float) – When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter. Defaults to None \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\).

  • 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, alpha=1.0)
integrator = hoomd.md.Integrator(dt=0.001, methods=[brownian_rattle],
forces=[lj])
filter

Subset of particles to apply this method to.

Type

hoomd.filter.ParticleFilter

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

alpha

When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\). Defaults to None.

Type

float

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 can be directly set instead of the ratio of particle diameter (\(\gamma = \alpha d_i\)). The type of gamma parameter is either positive float or zero \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).

Type

TypeParameter[ particle type, float ]

gamma_r

The rotational drag coefficient can be set. The type of gamma_r parameter is a tuple of three float. The type of each element of tuple is either positive float or zero \([\mathrm{force} \cdot \mathrm{length} \cdot \mathrm{radian}^{-1} \cdot \mathrm{time}^{-1}]\).

Type

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

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

Langevin dynamics with RATTLE constraint.

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

  • kT (hoomd.variant.Variant or float) – Temperature of the simulation \([\mathrm{energy}]\).

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

  • alpha (float) – When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\). Defaults to None.

  • 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.

Examples:

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, alpha=1.0)

Examples of using gamma or gamma_r on drag coefficient:

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, alpha=1.0)
filter

Subset of particles to apply this method to.

Type

hoomd.filter.ParticleFilter

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

alpha

When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\). Defaults to None.

Type

float

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 can be directly set instead of the ratio of particle diameter (\(\gamma = \alpha d_i\)). The type of gamma parameter is either positive float or zero \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).

Type

TypeParameter[ particle type, float ]

gamma_r

The rotational drag coefficient can be set. The type of gamma_r parameter is a tuple of three float. The type of each element of tuple is either positive float or zero \([\mathrm{mass} \cdot \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!

See Also: * Paquay and Kusters 2016

Note

Users should use the subclasses and not instantiate MethodRATTLE directly.

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

NVE Integration via Velocity-Verlet with RATTLE constraint.

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

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

  • limit (None or float) – Enforce that no particle moves more than a distance of a limit in a single time step. Defaults to None

  • 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.NVE. 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.ParticleFilter

manifold_constraint

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

Type

hoomd.md.manifold.Manifold

limit

Enforce that no particle moves more than a distance of a limit in a single time step. Defaults to None

Type

None or float

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, alpha=None)

Overdamped viscous dynamics with RATTLE constraint.

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

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

  • alpha (float) – When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter. Defaults to None \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\).

  • 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,
    alpha=1.0)
integrator = hoomd.md.Integrator(
    dt=0.001, methods=[odv_rattle], forces=[lj])
filter

Subset of particles to apply this method to.

Type

hoomd.filter.ParticleFilter

manifold_constraint

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

Type

hoomd.md.manifold.Manifold

alpha

When set, use \(\alpha d_i\) for the drag coefficient where \(d_i\) is particle diameter \([\mathrm{mass} \cdot \mathrm{length}^{-1} \cdot \mathrm{time}^{-1}]\). Defaults to None.

Type

float

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 can be directly set instead of the ratio of particle diameter (\(\gamma = \alpha d_i\)). The type of gamma parameter is either positive float or zero \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).

Type

TypeParameter[ particle type, float ]

gamma_r

The rotational drag coefficient can be set. The type of gamma_r parameter is a tuple of three float. The type of each element of tuple is either positive float or zero \([\mathrm{force} \cdot \mathrm{length} \cdot \mathrm{radian}^{-1} \cdot \mathrm{time}^{-1}]\).

Type

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