Class EvaluatorPairForceShiftedLJ#
Defined in File EvaluatorInversePower.hpp
Class Documentation#
-
class EvaluatorPairForceShiftedLJ#
Class for evaluating the force shifted LJ pair potential.
This evaluator is a variant of the Lennard-Jones pair potential, for which the force goes smoothly to zero at \( r = r_{\mathrm{cut}} \). EvaluatorPairForceShiftedLJ evaluates the function:
, where\[ V(r) = V_{LJ}(r) + \Delta V(r) \]is the standard Lennard-Jones pair potential and\[ V_{\mathrm{LJ}}(r) = 4 \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \left( \frac{\sigma}{r} \right)^{6} \right] \]. The constant value \( -\frac{1}{r} \frac{\partial V}{\partial r}(r_{\mathrm{cut}}) \) is subtracted from force_divr . The two parameters lj1 and lj2 are the same as for the (non-force-shifted) LJ potential.\[ \Delta V(r) = -(r - r_{\mathrm{cut}}) \frac{\partial V_{\mathrm{LJ}}}{\partial r}(r_{\mathrm{cut}}) \]Public Types
-
typedef EvaluatorPairLJ::param_type param_type#
Define the parameter type used by this pair potential evaluator.
Public Functions
- DEVICE inline EvaluatorPairForceShiftedLJ(
- Scalar _rsq,
- Scalar _rcutsq,
- const param_type &_params
Constructs the pair potential evaluator.
- Parameters:
_rsq – Squared distance between the particles
_rcutsq – Squared distance at which the potential and the force go to 0
_params – Per type pair parameters of this potential
-
DEVICE inline void setDiameter(Scalar di, Scalar dj)#
Accept the optional diameter values.
- Parameters:
di – Diameter of particle i
dj – Diameter of particle j
-
DEVICE inline void setCharge(Scalar qi, Scalar qj)#
Accept the optional diameter values.
- Parameters:
qi – Charge of particle i
qj – Charge of particle j
- DEVICE inline bool evalForceAndEnergy( )#
Evaluate the force and energy.
Note
There is no need to check if rsq < rcutsq in this method. Cutoff tests are performed in PotentialPair.
- Parameters:
force_divr – Output parameter to write the computed force divided by r.
pair_eng – Output parameter to write the computed pair energy
energy_shift – If true, the potential must be shifted so that V(r) is continuous at the cutoff
- Returns:
True if they are evaluated or false if they are not because we are beyond the cutoff
-
inline std::string getShapeSpec() const#
-
typedef EvaluatorPairLJ::param_type param_type#