# md.force¶

Overview

 Force Defines a force in HOOMD-blue. Active Active force.

Details

Apply forces to particles.

class hoomd.md.force.Force

Defines a force in HOOMD-blue.

Pair, angle, bond, and other forces are subclasses of this class.

Note

Force is the base class for all loggable forces. Users should not instantiate this class directly.

Initializes some loggable quantities.

property energies
The energies

for all particles.

(Loggable: category=”particle”)

Type

(N_particles, ) numpy.ndarray of numpy.float64

property energy

Sum of the energy of the whole system.

(Loggable: category=”scalar”)

Type

float

property forces
The forces

for all particles.

(Loggable: category=”particle”)

Type

(N_particles, 3) numpy.ndarray of numpy.float64

property torques
The torque

for all particles.

(Loggable: category=”particle”)

Type

(N_particles, 3) numpy.ndarray of numpy.float64

property virials
The virial

for all particles.

(Loggable: category=”particle”)

Type

(N_particles, ) numpy.ndarray of numpy.float64

class hoomd.md.force.Active(filter, rotation_diff=0.1)

Active force.

filter

Subset of particles on which to apply active forces.

Type

hoomd.filter

rotation_diff

rotational diffusion constant, $$D_r$$, for all particles in the group.

Type

float

active_force

active force vector in reference to the orientation of a particle. It is defined per particle type and stays constant during the simulation.

Type

tuple

active_torque

active torque vector in reference to the orientation of a particle. It is defined per particle type and stays constant during the simulation.

Type

tuple

Active specifies that an active force should be added to all particles. Obeys $$\delta {\bf r}_i = \delta t v_0 \hat{p}_i$$, where $$v_0$$ is the active velocity. In 2D $$\hat{p}_i = (\cos \theta_i, \sin \theta_i)$$ is the active force vector for particle $$i$$ and the diffusion of the active force vector follows $$\delta \theta / \delta t = \sqrt{2 D_r / \delta t} \Gamma$$, where $$D_r$$ is the rotational diffusion constant, and the gamma function is a unit-variance random variable, whose components are uncorrelated in time, space, and between particles. In 3D, $$\hat{p}_i$$ is a unit vector in 3D space, and diffusion follows $$\delta \hat{p}_i / \delta t = \sqrt{2 D_r / \delta t} \Gamma (\hat{p}_i (\cos \theta - 1) + \hat{p}_r \sin \theta)$$, where $$\hat{p}_r$$ is an uncorrelated random unit vector. The persistence length of an active particle’s path is $$v_0 / D_r$$. The rotational diffusion is applied to the orientation vector/quaternion of each particle. This implies that both the active force and the active torque vectors in the particle frame stay constant during the simulation. Hence, the active forces in the system frame are composed of the forces in particle frame and the current orientation of the particle.

Examples:

all = filter.All()
active = hoomd.md.force.Active(
filter=hoomd.filter.All(), rotation_diff=0.01
)
active.active_force['A','B'] = (1,0,0)
active.active_torque['A','B'] = (0,0,0)