|
occ
|
Self-consistent reaction-field engine — owns the cavity, the COSMO/CPCM pre-factored response, and (optionally) the SMD CDS cavity. More...
#include <reaction_field.h>
Public Member Functions | |
| ReactionFieldEngine (Options opts={}) | |
| void | initialize (const Mat3N &atom_positions_bohr, const IVec &atomic_numbers) |
Build the cavity, pre-factor the COSMO A matrix, and (if include_cds) pre-evaluate the CDS branch. | |
| void | solve_asc (const Vec &phi_at_cavity) |
Eulerian: solve A σ = −f(ε)·φ_cavity. | |
| void | update_from_atom_charges (const Vec &atom_charges) |
| Atom-resolved: from input atomic charges, compute φ = B·q, σ = G·q, V_atom = J_solv·q, E_es = ½ q·V_atom. | |
| double | energy () const |
| Total cached solvation energy: E_es + E_cds. | |
| double | energy_es () const |
| double | energy_cds () const |
| const Vec & | atom_potential () const |
| Cached per-atom screening potential V_atom (Hartree, length = natom). | |
| const Vec & | surface_charges () const |
| Cached apparent surface charges σ on the ES cavity. | |
| SolvationSurfaces | surfaces () const |
| Per-element decomposition of the latest update. | |
| Mat3N | gradient () const |
| Frozen-cavity analytical gradient (Hartree/Bohr, 3 × natom). | |
| const occ::solvent::surface::Surface & | es_cavity () const |
| const occ::solvent::surface::Surface & | cds_cavity () const |
| size_t | num_es_surface_points () const |
| size_t | num_cds_surface_points () const |
| const Mat & | B () const |
| const Mat & | G () const |
| const Mat & | J_solv () const |
| double | dielectric () const |
| double | f_epsilon () const |
| const Options & | options () const |
| const occ::solvent::SMDSolventParameters & | smd_parameters () const |
| const Vec & | es_atom_radii () const |
| ES cavity radii (Bohr) used at initialize(). Empty before initialize(). | |
| const Vec & | cds_energy_elements () const |
| Per-element CDS energy (Hartree). | |
Self-consistent reaction-field engine — owns the cavity, the COSMO/CPCM pre-factored response, and (optionally) the SMD CDS cavity.
Provides both an atom-resolved API (q → V_atom, used by xTB) and an Eulerian API (φ at cavity → σ, used by HF/DFT).
Lifecycle:
Options,initialize(atoms, Z) to build the cavity and factor A,update_from_atom_charges(q) OR solve_asc(phi),energy(), surfaces(), gradient() reflect the latest update.gradient() is the frozen-cavity analytical gradient (plus FD CDS when include_cds). It requires an atom-resolved update (it goes through the SCC's Mulliken charges); calling it after a pure Eulerian solve returns an empty matrix.
|
explicit |
|
inline |
Cached per-atom screening potential V_atom (Hartree, length = natom).
Empty until the first atom-resolved update.
|
inline |
|
inline |
|
inline |
Per-element CDS energy (Hartree).
Length = ncav_cds; empty if include_cds == false. Stable across update* calls (geometry-only).
|
inline |
|
inline |
Total cached solvation energy: E_es + E_cds.
(E_cds = 0 when include_cds == false.)
|
inline |
|
inline |
|
inline |
ES cavity radii (Bohr) used at initialize(). Empty before initialize().
|
inline |
|
inline |
|
inline |
| Mat3N occ::scrf::ReactionFieldEngine::gradient | ( | ) | const |
Frozen-cavity analytical gradient (Hartree/Bohr, 3 × natom).
Requires a prior update_from_atom_charges(q) — returns an empty matrix otherwise. When include_cds, adds an FD CDS contribution on top.
| void occ::scrf::ReactionFieldEngine::initialize | ( | const Mat3N & | atom_positions_bohr, |
| const IVec & | atomic_numbers | ||
| ) |
Build the cavity, pre-factor the COSMO A matrix, and (if include_cds) pre-evaluate the CDS branch.
Idempotent on geometry change — call again whenever atoms move.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void occ::scrf::ReactionFieldEngine::solve_asc | ( | const Vec & | phi_at_cavity | ) |
Eulerian: solve A σ = −f(ε)·φ_cavity.
Caches σ and φ so energy_es() / surfaces() reflect the result. Does NOT compute V_atom — use the atom-resolved path for that.
|
inline |
Cached apparent surface charges σ on the ES cavity.
Length = ncav_es. Empty before the first update.
| SolvationSurfaces occ::scrf::ReactionFieldEngine::surfaces | ( | ) | const |
Per-element decomposition of the latest update.
Coulomb branch is populated whenever there has been an update; CDS branch is populated when include_cds (and reflects the cavity at initialize(), i.e. geometry-only).
| void occ::scrf::ReactionFieldEngine::update_from_atom_charges | ( | const Vec & | atom_charges | ) |
Atom-resolved: from input atomic charges, compute φ = B·q, σ = G·q, V_atom = J_solv·q, E_es = ½ q·V_atom.
Updates all cached state; subsequent energy(), surfaces(), and gradient() reflect this update.