md.methods.rattle¶
Overview
Base class RATTLE integration method. |
|
Brownian dynamics with RATTLE constraint. |
|
Newtonian dynamics with a cap on the maximum displacement per time step. |
|
Langevin dynamics with RATTLE constraint. |
|
NVE Integration via Velocity-Verlet with RATTLE constraint. |
|
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, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0))¶
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
default_gamma (float) – Default drag coefficient for all particle types \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).
default_gamma_r ([
float
,float
,float
]) – Default rotational drag coefficient tensor for all particles \([\mathrm{time}^{-1}]\).
Brownian
uses the same integrator ashoomd.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 seehoomd.md.methods.Brownian
.Example
sphere = hoomd.md.manifold.Sphere(r=5) brownian_rattle = hoomd.md.methods.rattle.Brownian( filter=hoomd.filter.All(), kT=1.5, manifold_constraint=sphere, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0)) simulation.operations.integrator.methods = [brownian_rattle]
- filter¶
Subset of particles to apply this method to.
- Type:
- kT¶
Temperature of the simulation \([\mathrm{energy}]\).
- Type:
- manifold_constraint¶
Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.
- 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:
- class hoomd.md.methods.rattle.DisplacementCapped(filter: ParticleFilter | CustomFilter, maximum_displacement: Variant | float, 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 inhoomd.md.methods.DisplacementCapped
. In addition the particles are constrained to a manifold by using the RATTLE algorithm.Example
sphere = hoomd.md.manifold.Sphere(r=5) relax_rattle = hoomd.md.methods.rattle.DisplacementCapped( filter=hoomd.filter.All(), maximum_displacement=0.01, manifold_constraint=sphere) simulation.operations.integrator.methods = [relax_rattle]
- filter¶
Subset of particles on which to apply this method.
- Type:
- maximum_displacement¶
The maximum displacement allowed for a particular timestep \([\mathrm{length}]\).
- manifold_constraint¶
Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.
- class hoomd.md.methods.rattle.Langevin(filter, kT, manifold_constraint, tally_reservoir_energy=False, tolerance=1e-06, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0))¶
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
default_gamma (float) – Default drag coefficient for all particle types \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).
default_gamma_r ([
float
,float
,float
]) – Default rotational drag coefficient tensor for all particles \([\mathrm{time}^{-1}]\).
Translational degrees of freedom
Langevin
uses the same integrator ashoomd.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 seehoomd.md.methods.Langevin
.Use
Brownian
if your system is not underdamped.Example
sphere = hoomd.md.manifold.Sphere(r=5) langevin_rattle = hoomd.md.methods.rattle.Langevin( filter=hoomd.filter.All(), kT=1.5, manifold_constraint=sphere, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0)) simulation.operations.integrator.methods = [langevin_rattle]
- filter¶
Subset of particles to apply this method to.
- Type:
- kT¶
Temperature of the simulation \([\mathrm{energy}]\).
- Type:
- manifold_constraint¶
Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.
- 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:
- 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, 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 inhoomd.md.methods.ConstantVolume
without any thermostat. In addition the particles are constrained to a manifold by using the RATTLE algorithm.Example
sphere = hoomd.md.manifold.Sphere(r=5) nve_rattle = hoomd.md.methods.rattle.NVE( filter=hoomd.filter.All(), manifold_constraint=sphere) simulation.operations.integrator.methods = [nve_rattle]
- filter¶
Subset of particles on which to apply this method.
- Type:
- manifold_constraint¶
Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.
- class hoomd.md.methods.rattle.OverdampedViscous(filter, manifold_constraint, tolerance=1e-06, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0))¶
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
default_gamma (float) – Default drag coefficient for all particle types \([\mathrm{mass} \cdot \mathrm{time}^{-1}]\).
default_gamma_r ([
float
,float
,float
]) – Default rotational drag coefficient tensor for all particles \([\mathrm{time}^{-1}]\).
OverdampedViscous
uses the same integrator ashoomd.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 seehoomd.md.methods.OverdampedViscous
.Example
sphere = hoomd.md.manifold.Sphere(r=5) odv_rattle = hoomd.md.methods.rattle.OverdampedViscous( filter=hoomd.filter.All(), manifold_constraint=sphere, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0)) simulation.operations.integrator.methods = [odv_rattle]
- filter¶
Subset of particles to apply this method to.
- Type:
- manifold_constraint¶
Manifold constraint which is used by and as a trigger for the RATTLE algorithm of this method.
- 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: