Loading...
Searching...
No Matches
q3::D3BJDispersionCalculator Class Reference

#include <d3bj.hpp>

+ Inheritance diagram for q3::D3BJDispersionCalculator:

Public Member Functions

 D3BJDispersionCalculator (const Crystal &crystal_structure)
 
Real compute_energy () const override
 Total D3(BJ) dispersion energy correction, in Rydberg.
 
DispersionGradients compute_gradients () const override
 
std::string name () const override
 
- Public Member Functions inherited from q3::DispersionCalculator
virtual ~DispersionCalculator ()=default
 

Detailed Description

Definition at line 43 of file d3bj.hpp.

Constructor & Destructor Documentation

◆ D3BJDispersionCalculator()

q3::D3BJDispersionCalculator::D3BJDispersionCalculator ( const Crystal &  crystal_structure)
inlineexplicit

Definition at line 45 of file d3bj.hpp.

Member Function Documentation

◆ compute_energy()

Real q3::D3BJDispersionCalculator::compute_energy ( ) const
inlineoverridevirtual

Total D3(BJ) dispersion energy correction, in Rydberg.

convert_from_crystal_to_cartesian() returns positions in units of alat, not Bohr – project through the Bohr-scaled lattice matrix directly instead.

Periodic-image shifts covering the van der Waals cutoff sphere (QE default: cutoff_squared = 9000 Bohr^2), precomputed once for the whole pair sum – see enumerate_image_shifts().

Unordered-pair (i<j) contributions are counted once; the self-pair (i==i) periodic-image sum double-counts every image with its mirror translation, hence 0.5.

Implements q3::DispersionCalculator.

Definition at line 53 of file d3bj.hpp.

References q3::Crystal::atomic_number(), q3::Crystal::element(), q3::Crystal::fractional_position(), q3::Crystal::lattice_vectors_bohr(), q3::Crystal::number_of_atoms(), q3::dispersion::r2r4_by_atomic_number(), q3::dispersion::rcov_by_atomic_number(), q3::Vector3D::x, q3::Vector3D::y, and q3::Vector3D::z.

◆ compute_gradients()

DispersionGradients q3::D3BJDispersionCalculator::compute_gradients ( ) const
inlineoverridevirtual

Analytical gradients of the D3(BJ) dispersion energy (forces and stress; units and sign conventions documented on DispersionGradients).

Two coupled mechanisms contribute, mirroring compute_energy() exactly:

  1. Direct: r_ij appears explicitly in 1/(r^6+R0^6) and 1/(r^8+R0^8).
  2. Indirect: C6_ij depends on CN_i and CN_j (interpolate_c6), and each coordination number is itself a smooth sum over ALL of that atom's neighbors – so a displaced neighbor changes C6_ij even for pairs it is not directly part of. Handled via a standard two-pass algorithm: pass 1 walks the same (C6, C8) pair loop as compute_energy() and accumulates dE/dCN_i per atom; pass 2 walks the same neighbor loop as compute_coordination_numbers() and applies the chain rule through dCN_i/dR.

g_i = dE/dCN_i, accumulated across every (C6, C8) pair atom i takes part in (either role, including its own self-pair).

Direct term: d(1/(r^6+R0^6))/dR and d(1/(r^8+R0^8))/dR, expressed sqrt-free via r^2 (matching compute_energy()).

Force: F_i = -dE/dR_i. Self-pair separations are pure lattice vectors (position-independent), so the two increments below cancel automatically for atom_i==atom_j without any special-casing – they still contribute to stress below, since the cell shape does move them.

PASS 2: chain rule through dCN_i/dR, walking the identical neighbor loop as compute_coordination_numbers().

d(logistic)/dr = -k1*(ratio/r)*L*(1-L); CN decreases as atoms move apart, so this is negative.

Implements q3::DispersionCalculator.

Definition at line 371 of file d3bj.hpp.

References q3::Crystal::atomic_number(), q3::Crystal::cell_volume(), q3::Crystal::element(), q3::Crystal::fractional_position(), q3::Crystal::lattice_vectors_bohr(), q3::Crystal::number_of_atoms(), q3::dispersion::r2r4_by_atomic_number(), q3::dispersion::rcov_by_atomic_number(), q3::Vector3D::x, q3::Vector3D::y, and q3::Vector3D::z.

◆ name()

std::string q3::D3BJDispersionCalculator::name ( ) const
inlineoverridevirtual

Scheme name as accepted by the input ("none", "d3bj", ...). Reporting code uses name() != "none" to decide whether to print dispersion rows.

Implements q3::DispersionCalculator.

Definition at line 48 of file d3bj.hpp.


The documentation for this class was generated from the following file: