ddCOSMO Surface Area Incorrect
The surface area written into the xtb.cosmo file is wrong for any overlapping spheres.
Example: Surface area (Ang^2) of O2 from distance 0 to 4 Angs in 0.01 Ang steps (default):
It is discontinuous and qualitatively wrong. One would expect a nearly linear growth from a to 2a. This is correct, e.g., with ALPB.
The respective routine misses the inclusion of the switching function ui (via self%ddCosmo%ui(ig, iat)); with inclusion (swi), however, the surface area is still incorrect.
The respective implementation in our tblite ddx development branch delivers the correct result.
Small addon: These are some surface areas calculated with numsa (uses SwiG discretization):
Update: While the originally reported steps in the surface area are a bug, the smoothed variant should be correct:
- On the one hand, there is an issue in the dd scheme that is being worked on (https://github.com/ddsolvation/ddX/issues/165), and
- on the other, the dd-scheme or discretization of the cavity is not meant to reproduce the "correct" surface area (with a finite switching) of the overlapping spheres.
However: In the case one does not use a switching function (i.e. a step function), it does reproduce a meaningful surface area without, of course, the differentiability. For something like CPCM-X, that does not have a gradient, this would not be an issue but would require a rework/re-parameterization.