hoomd.hpmc.external¶
Overview
Details
External fields for Monte Carlo.
Define \(U_{\mathrm{external},i}\) for use with
hoomd.hpmc.integrate.HPMCIntegrator. Add external
potential instances to your integrator’s
external_potentials list
to apply it during the simulation.
Note
The following class types can not be added to the external_potentials
list. You may set one of these in the
external_potential
attribute.
In HOOMD-blue 5.0.0, field.Harmonic and wall.WallPotential will be
replaced by similar classes that do support external_potentials.
- class hoomd.hpmc.external.External¶
Bases:
External potential base class (HPMC).
External potentials define energetic interaction between particles and external fields in
hoomd.hpmc.integrate.HPMCIntegrator.Note
The base class
Externalimplements common attributes (energy, for example) and may be used in forisinstanceorissubclasschecks.Externalshould not be instantiated directly by users.- property energy¶
Potential energy contributed by this potential \([\mathrm{energy}]\).
Typically:
\[U = \sum_{i=0}^\mathrm{N_particles-1} U_{\mathrm{external},i}\]See
hoomd.hpmc.integratefor the full expression which includes the evaluation over multiple images when the simulation box is small.Example
logger.add(obj=external, quantities=['energy'])
(
Loggable: category=”scalar”)- Type:
- class hoomd.hpmc.external.Linear(default_alpha=None, plane_origin=(0, 0, 0), plane_normal=(0, 1, 0))¶
Bases:
ExternalLinear external potential (HPMC).
- Parameters:
Linearcomputes a linear external potential on all particles in the simulation state:\[U_{\mathrm{external},i} = \alpha_i \cdot \vec{n} \cdot ( \vec{r}_i - \vec{p} )\]where \(\alpha_i\) (
alpha) is the linear energy coefficient , \(\vec{n}\) is the normal vector to the plane (plane_normal), and \(\vec{p}\) is the plane origin (plane_origin):Example
linear = hoomd.hpmc.external.Linear() linear.alpha['A'] = 0.2 simulation.operations.integrator.external_potentials = [linear]
- alpha¶
The linear energy coefficient \(\alpha\) by particle type.
Type:
TypeParameter[tuple[particle_type,particle_type],float]
Modules