|
occ
|
Classes | |
| struct | Surface |
Functions | |
| Surface | solvent_surface (const Vec &radii, const IVec &atomic_numbers, const Mat3N &positions, double solvent_radius_angs=0.0, bool axis_aligned=true, double smoothing_width_bohr=0.0, int angular_points=146) |
| Build an atom-centered Lebedev cavity surface. | |
| IVec | nearest_atom_index (const Mat3N &atom_positions, const Mat3N &element_centers) |
| double | cavity_volume (const Surface &surface, const Mat3N &atom_positions) |
| Volume (Bohr³) enclosed by a discretised cavity, via the divergence theorem: | |
| double occ::solvent::surface::cavity_volume | ( | const Surface & | surface, |
| const Mat3N & | atom_positions | ||
| ) |
Volume (Bohr³) enclosed by a discretised cavity, via the divergence theorem:
V = ⅓ ∮ (r − O)·n̂ dA ≈ ⅓ Σ_i a_i (r_i − O)·n̂_i
The outward normal at element i is radial about its parent atom, n̂_i = (r_i − R_{atom_i}) / |r_i − R_{atom_i}|; O is a single fixed origin (the atom centroid), which the identity requires.
Exact in the continuum limit for a closed surface, so the discrete sum converges with grid refinement.
| IVec occ::solvent::surface::nearest_atom_index | ( | const Mat3N & | atom_positions, |
| const Mat3N & | element_centers | ||
| ) |
| Surface occ::solvent::surface::solvent_surface | ( | const Vec & | radii, |
| const IVec & | atomic_numbers, | ||
| const Mat3N & | positions, | ||
| double | solvent_radius_angs = 0.0, |
||
| bool | axis_aligned = true, |
||
| double | smoothing_width_bohr = 0.0, |
||
| int | angular_points = 146 |
||
| ) |
Build an atom-centered Lebedev cavity surface.
axis_aligned = true (default) preserves the legacy behaviour of pre-rotating the molecule into its principal-axes frame before placing the Lebedev grid — fine for energy-only callers (SMD HF/DFT pipeline). For analytical gradients, set axis_aligned = false so each cavity point sits rigidly on its parent atom; otherwise the global rotation chain ∂axes/∂R breaks the frozen-cavity assumption in cosmo::gradient.
solvent_radius_angs is the probe radius for the solvent-excluded construction: points are laid down at r_i + probe, masked against the other atoms' r_k + probe spheres, then projected back inward by probe so the surviving surface sits at r_i. A probe of 0 gives a plain union of vdW spheres; the COSMO-RS convention is 1.3 Å.
smoothing_width_bohr > 0 it is ignored, since the smooth weight must be reconstructible from surface.vertices alone and an inward projection would break that.smoothing_width_bohr = 0 (default) uses the legacy boolean mask (point is either fully included or fully dropped). With smoothing_width_bohr > 0, each cavity point gets a continuous weight in [0, 1]:
weight_j = Π_{k ≠ atom_j} smoothstep(|r_j − R_k|, r_k, w)
smoothstep(d, t, w) = ½ (1 + erf((d − t)/w))
Distances are measured between the post-shift cavity vertex and atom centres so the gradient code can reconstruct the same weights from surface.vertices and atom radii. Areas are multiplied by the weight and points whose weight falls below 1e-10 are dropped. This makes the cavity, and any energy derived from it, C∞ with respect to atomic positions — required for clean analytical gradients. angular_points selects the Lebedev order used per atom, rounded up to the nearest available level. The default of 146 is adequate for energies; σ-profiles need considerably more, since each histogram bin has to be populated by enough segments to be smooth.