Compute Hellmann-Feynman forces on all atoms. More...
#include <init.hpp>
Static Public Member Functions | |
| static std::pair< std::vector< Vector3D >, AtomicForcesContributions > | compute_forces (const NormConservingPlanewaveKohnShamSCFState &scf_state, const std::string &dispersion_correction="none", bool disable_symmetry=false) |
|
inlinestatic |
Compute all Hellmann-Feynman force contributions from the converged SCF state.
Extracts crystal, planewave_basis, kpoint_grid, and projector_overlap_coefficients from the state. Returns (AtomicForcesResult, AtomicForcesContributions).
The summed forces are averaged over the crystal's space group unless disable_symmetry is set, in which case they are returned as computed – the run used no symmetry anywhere else either (InputData::disable_symmetry).
1b. Dispersion forces – geometry-only, independent of the electronic structure, so no pool reduction is needed below. The factory resolves the scheme ("none" contributes exact zeros), so no per-scheme branching happens here.
Nonlocal KB projector and DFT+U (Hubbard) forces depend on wavefunctions: each pool accumulates only its subset of k-points, so a global sum is required. Within a pool whose ranks split the plane waves, both calculators sum their overlaps across the pool before multiplying them, so every rank of a pool holds the same complete value here and this sum counts each pool once.
Ewald, local, core-correction, and augmentation forces are computed from the complete crystal structure or density (available on every rank), so they give the same value on all ranks and must NOT be reduced.
Definition at line 57 of file init.hpp.
References q3::NormConservingPlanewaveForceCalculator::compute(), q3::EwaldForceCalculator::compute(), q3::create_dispersion_calculator(), q3::PlanewaveKohnShamSCFState::crystal_structure, q3::PlanewaveKohnShamSCFState::execution_policy, q3::NormConservingPlanewaveBasis::has_nonlinear_core_correction(), q3::NormConservingPlanewaveKohnShamQuantumSystem::has_ultrasoft(), q3::NormConservingPlanewaveKohnShamSCFState::hubbard_manifolds, q3::PlanewaveKohnShamSCFState::kpoint_grid, q3::PlanewaveKohnShamSCFState::planewave_basis, q3::NormConservingPlanewaveKohnShamSCFState::projector_overlap_coefficients, q3::NormConservingPlanewaveKohnShamQuantumSystem::pseudopotential_basis(), q3::NormConservingPlanewaveKohnShamSCFState::quantum_system(), and q3::execution::PlanewaveExecutionPolicy::reduce_vector().
Referenced by q3::SelfConsistentFieldFlavor::run_calculation(), and q3::bindings::SCFSolver::solve().