lj Class Reference


Detailed Description

Lennard-Jones pair force.

The command pair.lj specifies that a Lennard-Jones type pair force should be added to every non-bonded particle pair in the simulation.

The force $ \vec{F}$ is

\begin{eqnarray*} \vec{F} = & -\nabla V(r) & r < r_{\mathrm{cut}} \\ = & 0 & r \ge r_{\mathrm{cut}} \\ \end{eqnarray*}

where $ V(r) $ is chosen by a mode switch (see set_params())

\begin{eqnarray*} V(r) = & V_{\mathrm{LJ}}(r) & \mathrm{mode\ is\ no\_shift} \\ = & V_{\mathrm{LJ}}(r) - V_{\mathrm{LJ}}(r_{\mathrm{cut}}) & \mathrm{mode\ is\ shift} \\ = & S(r) \cdot V_{\mathrm{LJ}}(r) & \mathrm{mode\ is\ xplor} \\ \end{eqnarray*}

, $ S(r) $ is the XPLOR smoothing function

\begin{eqnarray*} S(r) = & 1 & r < r_{\mathrm{on}} \\ = & \frac{(r_{\mathrm{cut}}^2 - r^2)^2 \cdot (r_{\mathrm{cut}}^2 + 2r^2 - 3r_{\mathrm{on}}^2)}{(r_{\mathrm{cut}}^2 - r_{\mathrm{on}}^2)^3} & r_{\mathrm{on}} \le r \le r_{\mathrm{cut}} \\ = & 0 & r > r_{\mathrm{cut}} \\ \end{eqnarray*}

, with $ r_{\mathrm{on}} = \lambda \cdot r_{\mathrm{cut}} $,

\[ V_{\mathrm{LJ}}(r) = 4 \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \alpha \left( \frac{\sigma}{r} \right)^{6} \right] \]

, and $ \vec{r} $ is the vector pointing from one particle to the other in the pair.

The following coefficients must be set per unique pair of particle types. See pair or the Quick Start Tutorial for information on how to set coefficients.

  • $ \varepsilon $ - epsilon
  • $ \sigma $ - sigma
  • $ \alpha $ - alpha

The following parameters are set globally via set_params()

  • mode - mode (default = "no_shift)
  • $ \lambda $ - xplor_factor (default = 2.0/3.0)

Example:

 lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)

The cuttoff radius $ r_{\mathrm{cut}} $ is set once when pair.lj is specified (see __init__())

Public Member Functions

def __init__
 Specify the Lennard-Jones pair force.
def set_params
 Set parameters controlling the way forces are computed.
def disable
 Disables the force.
def enable
 Enables the force.


Member Function Documentation

def __init__ (   self,
  r_cut 
)

Specify the Lennard-Jones pair force.

Parameters:
r_cut Cutoff radius (see documentation above)
Example:
 lj = pair.lj(r_cut=3.0)
 lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0)

Note:
Pair coefficients for all type pairs in the simulation must be set before it can be started with run()

def disable (   self  )  [inherited]

Disables the force.

Examples:

 force.disable()

Executing the disable command will remove the force from the simulation. Any run() command executed after disabling a force will not calculate or use the force during the simulation. A disabled force can be re-enabled with enable()

To use this command, you must have saved the force in a variable, as shown in this example:

 force = pair.some_force()
 # ... later in the script
 force.disable()

def enable (   self  )  [inherited]

Enables the force.

Examples:

 force.enable()

See disable() for a detailed description.

def set_params (   self,
  mode = None,
  fraction = None 
)

Set parameters controlling the way forces are computed.

Parameters:
mode (if set) Set the mode with which potentials are handled at the cutoff
fraction (if set) Change the fraction of $ r_{\mathrm{cut}} $ at which the XPLOR smoothing starts (default is 2.0/3.0). Only applies of mode is set to "xplor"
valid values for mode are: "none" (the default), "shift", and "xplor"
  • none - No shifting is performed and potentials are abruptly cut off
  • shift - A constant shift is applied to the entire potential so that it is 0 at the cutoff
  • xplor - A smoothing function is applied to gradually decrease both the force and potential to 0 at the cutoff (see above for formulas and more information)

Examples:

 lj.set_params(mode="shift")
 lj.set_params(mode="no_shift")
 lj.set_params(mode="xplor", xplor_factor = 0.5)


Generated on Tue Mar 24 17:40:34 2009 for HOOMD by doxygen 1.5.7.1