|
| static AnisotropicResult | anisotropic_repulsion (const Vec3 &pos_a, const Vec3 &pos_b, const Vec3 &axis_a, const Vec3 &axis_b, const AnisotropicRepulsionParams ¶ms) |
| | Compute anisotropic Born-Mayer repulsion energy, forces, and axis torques.
|
| |
| static double | lennard_jones_energy (double r, const LennardJonesParams ¶ms) |
| | Compute Lennard-Jones energy: V(r) = 4ε[(σ/r)^12 - (σ/r)^6].
|
| |
| static double | lennard_jones_derivative (double r, const LennardJonesParams ¶ms) |
| | Compute first derivative: dV/dr = 24ε/r[(σ/r)^6 - 2(σ/r)^12].
|
| |
| static double | lennard_jones_second_derivative (double r, const LennardJonesParams ¶ms) |
| | Compute second derivative: d²V/dr² = 24ε/r²[26(σ/r)^12 - 7(σ/r)^6].
|
| |
| static EnergyAndDerivatives | lennard_jones_all (double r, const LennardJonesParams ¶ms) |
| | Compute Lennard-Jones energy and both derivatives (more efficient).
|
| |
| static double | buckingham_energy (double r, const BuckinghamParams ¶ms) |
| | Compute Buckingham energy: V(r) = A*exp(-B*r) - C/r^6.
|
| |
| static double | buckingham_derivative (double r, const BuckinghamParams ¶ms) |
| | Compute first derivative: dV/dr = -A*B*exp(-B*r) + 6C/r^7.
|
| |
| static double | buckingham_second_derivative (double r, const BuckinghamParams ¶ms) |
| | Compute second derivative: d²V/dr² = A*B²*exp(-B*r) - 42C/r^8.
|
| |
| static EnergyAndDerivatives | buckingham_all (double r, const BuckinghamParams ¶ms) |
| | Compute Buckingham energy and both derivatives (more efficient).
|
| |
| static Vec3 | derivative_to_force (double dE_dr, const Vec3 &r_vec) |
| | Convert radial derivative to force vector.
|
| |
| static ForceAndHessian | compute_force_hessian (const Vec3 &r_A, const Vec3 &r_B, double dE_dr, double d2E_dr2) |
| | Compute force vectors and Hessian matrices for both sites.
|
| |
Class for computing short-range pairwise interactions.
Provides implementations of Lennard-Jones and Buckingham potentials with analytical first and second derivatives. These are commonly used in molecular mechanics and molecular dynamics simulations.
All functions are static and thread-safe. The class provides:
- Individual energy/derivative calculations
- Combined calculations (more efficient when all are needed)
- Transformation from scalar derivatives to vector forces and Hessians
Usage example:
(r_B - r_A).norm(), lj_params);
r_A, r_B, result.first_derivative, result.second_derivative);
static ForceAndHessian compute_force_hessian(const Vec3 &r_A, const Vec3 &r_B, double dE_dr, double d2E_dr2)
Compute force vectors and Hessian matrices for both sites.
static EnergyAndDerivatives lennard_jones_all(double r, const LennardJonesParams ¶ms)
Compute Lennard-Jones energy and both derivatives (more efficient).
Eigen::Vector3d Vec3
Definition linear_algebra.h:64
Parameters for the Lennard-Jones 12-6 potential.
Definition short_range.h:24
double epsilon
Well depth (energy units)
Definition short_range.h:25
| static ForceAndHessian occ::mults::ShortRangeInteraction::compute_force_hessian |
( |
const Vec3 & |
r_A, |
|
|
const Vec3 & |
r_B, |
|
|
double |
dE_dr, |
|
|
double |
d2E_dr2 |
|
) |
| |
|
static |
Compute force vectors and Hessian matrices for both sites.
For a central potential V(r) between sites A and B, computes:
- Forces: F_A = -(dV/dr) * (r_vec/r), F_B = -F_A
- Hessians: H_ij = d²V/dx_i dx_j
The Hessian for a central potential has two terms:
- Curvature term: (d²V/dr²) * (r_i/r) * (r_j/r)
- Angular term: (dV/dr/r) * [δ_ij - (r_i/r)(r_j/r)]
The resulting Hessian satisfies:
- H_AB = -H_AA (from symmetry)
- H_BB = H_AA (from symmetry)
- H_AA + H_AB + H_BA + H_BB = 0 (translational invariance)
- Parameters
-
| r_A | Position of site A |
| r_B | Position of site B |
| dE_dr | First derivative dV/dr |
| d2E_dr2 | Second derivative d²V/dr² |
- Returns
- Structure containing forces and Hessians