Detailed Description
CMM coarse-grain model pair force.
The command pair.cgcmm specifies that a special version of Lennard-Jones type pair force should be added to every non-bonded particle pair in the simulation. This potential version is used in the CMM coarse grain model and uses a combination of Lennard-Jones potentials with different exponent pairs between different atom pairs.
Reference [5] describes the CGCMM implementation details in HOOMD-blue. Cite it if you utilize the CGCMM potential in your work.
The force \( \vec{F}\) is
\begin{eqnarray*} \vec{F} = & -\nabla V_{\mathrm{LJ}}(r) & r < r_{\mathrm{cut}} \\ = & 0 & r \ge r_{\mathrm{cut}} \\ \end{eqnarray*}
with being either
\[ V_{\mathrm{LJ}}(r) = 4 \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \alpha \left( \frac{\sigma}{r} \right)^{6} \right] \]
, or
\[ V_{\mathrm{LJ}}(r) = \frac{27}{4} \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{9} - \alpha \left( \frac{\sigma}{r} \right)^{6} \right] \]
, or
\[ V_{\mathrm{LJ}}(r) = \frac{3\sqrt{3}}{2} \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \alpha \left( \frac{\sigma}{r} \right)^{4} \right] \]
, and \( \vec{r} \) being 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 hoomd_script.pair or the Quick Start Tutorial for information on how to set coefficients.
- \( \varepsilon \) -
epsilon(in units of energy) - \( \sigma \) -
sigma(in units of distance) - \( \alpha \) -
alpha(unitless) - exponents, the choice of LJ-exponents, currently supported are 12-6, 9-6, and 12-4.
We support three keyword variants 124 (native), lj12_4 (LAMMPS), LJ12-4 (MPDyn)
Example:
cg.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0, alpha=1.0, exponents='LJ12-6') cg.pair_coeff.set('W', 'W', epsilon=3.7605, sigma=1.285588, alpha=1.0, exponents='lj12_4') cg.pair_coeff.set('OA', 'OA', epsilon=1.88697479, sigma=1.09205882, alpha=1.0, exponents='96')
For more information on setting pair coefficients, including examples with wildcards, see pair_coeff.set().
The cutoff radius \( r_{\mathrm{cut}} \) is set once when pair.cg is specified (see __init__())
Public Member Functions | |
| def | __init__ |
| Specify the CG-CMM Lennard-Jones pair force. | |
| def | disable |
| Disables the force. | |
| def | benchmark |
| Benchmarks the force computation. | |
| def | enable |
| Enables the force. | |
Constructor & Destructor Documentation
| def __init__ | ( | self, | |
| r_cut | |||
| ) |
Specify the CG-CMM Lennard-Jones pair force.
- Parameters:
-
r_cut Cuttoff radius (see documentation above) (in distance units)
Example:
cg1 = pair.cgcmm(r_cut=3.0) cg1.pair_coeff.set('A', 'A', epsilon=0.5, sigma=1.0, alpha=1.0, exponents='lj12_4')
- Note:
- Pair coefficients for all type pairs in the simulation must be set before it can be started with run()
Member Function Documentation
| def benchmark | ( | self, | |
| n | |||
| ) | [inherited] |
Benchmarks the force computation.
- Parameters:
-
n Number of iterations to average the benchmark over
Examples:
t = force.benchmark(n = 100)
The value returned by benchmark() is the average time to perform the force computation, in milliseconds. The benchmark is performed by taking the current positions of all particles in the simulation and repeatedly calculating the forces on them. Thus, you can benchmark different situations as you need to by simply running a simulation to achieve the desired state before running benchmark().
- Note:
- There is, however, one subtle side effect. If the benchmark() command is run directly after the particle data is initialized with an init command, then the results of the benchmark will not be typical of the time needed during the actual simulation. Particles are not reordered to improve cache performance until at least one time step is performed. Executing run(1) before the benchmark will solve this problem.
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
t = force.benchmark(n = 100)
| def disable | ( | self, | |
log = False |
|||
| ) | [inherited] |
Disables the force.
- Parameters:
-
log Set to True if you plan to continue logging the potential energy associated with this force.
Examples:
force.disable()
force.disable(log=True)
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()
By setting log to True, the values of the force can be logged even though the forces are not applied in the simulation. For forces that use cutoff radii, setting log=True will cause the correct r_cut values to be used throughout the simulation, and therefore possibly drive the neighbor list size larger than it otherwise would be. If log is left False, the potential energy associated with this force will not be available for logging.
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() force.disable(log=True)
| def enable | ( | self | ) | [inherited] |
Enables the force.
Examples:
force.enable()
See disable() for a detailed description.

