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
is
where
is chosen by a mode switch (see set_params())
,
is the XPLOR smoothing function
, with
,
, and
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.
- epsilon
- sigma
- alpha
The following parameters are set globally via set_params()
- mode - mode (default = "no_shift)
- 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
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)
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] |
| 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
at which the XPLOR smoothing starts (default is 2.0/3.0). Only applies of mode is set to "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
1.5.7.1


