Environment¶
Classes for the solvent environment overlay
Cavity¶
-
class Cavity : public mrcpp::RepresentableFunction<3>¶
Interlocking spheres cavity centered on the nuclei of the molecule. The Cavity class represents the following function Fosso-Tande2013.
\[\begin{split} C(\mathbf{r}) = 1 - \prod^N_{i=1} (1-C_i(\mathbf{r})) \\ C_i(\mathbf{r}) = 1 - \frac{1}{2}\left( 1 + \textrm{erf}\left(\frac{|\mathbf{r} - \mathbf{r}_i| - R_i}{\sigma_i}\right) \right) \end{split}\]where \(\mathbf{r}\) is the coordinate of a point in 3D space, \(\mathbf{r}_i\) is the coordinate of the i-th nucleus, \(R_i\) is the radius of the i-th sphere, and \(\sigma_i\) is the width of the transition between the inside and outside of the cavity. The transition has a sigmoidal shape, such that the boundary is a smooth function instead of sharp boundaries often seen in other continuum models. This function is \(1\) inside and \(0\) outside the cavity.
The radii are computed as:
\[ R_{i} = \alpha_{i} R_{0,i} + \beta_{i}\sigma_{i} \]where:
\(R_{0,i}\) is the atomic radius. By default, the van der Waals radius.
\(\alpha_{i}\) is a scaling factor. By default, 1.1
\(\beta_{i}\) is a width scaling factor. By default, 0.5
\(\sigma_{i}\) is the width. By default, 0.2
Public Functions
-
Cavity(const std::vector<mrcpp::Coord<3>> &coords, const std::vector<double> &R, const std::vector<double> &alphas, const std::vector<double> &betas, const std::vector<double> &sigmas)¶
Initializes the members of the class and constructs the analytical gradient vector of the Cavity.
-
Cavity(const std::vector<mrcpp::Coord<3>> &coords, const std::vector<double> &R, double sigma)¶
Initializes the members of the class and constructs the analytical gradient vector of the Cavity.
This CTOR applies a single width factor to the cavity and does not modify the radii. That is, in the formula:
\[ R_{i} = \alpha_{i} R_{0,i} + \beta_{i}\sigma_{i} \]for every atom \(i\), \(\alpha_{i} = 1.0\) and \(\beta_{i} = 0.0\).
-
double evalf(const mrcpp::Coord<3> &r) const override¶
Evaluates the value of the cavity at a 3D point \(\mathbf{r}\).
Protected Attributes
-
std::vector<double> radii_0¶
Contains the unscaled radius of each sphere in #Center.
-
std::vector<double> alphas¶
The radius scaling factor for each sphere.
-
std::vector<double> betas¶
The width scaling factor for each sphere.
-
std::vector<double> sigmas¶
The width for each sphere.
-
std::vector<double> radii¶
Contains the radius of each sphere in #Center. \(R_i = \alpha_{i} R_{0,i} + \beta_{i}\sigma_{i}\).
-
std::vector<mrcpp::Coord<3>> centers¶
Contains each of the spheres centered on the nuclei of the Molecule.
-
auto gradCavity(const mrcpp::Coord<3> &r, int index, const std::vector<mrcpp::Coord<3>> ¢ers, const std::vector<double> &radii, const std::vector<double> &widths) -> double¶
Constructs a single element of the gradient of the Cavity.
This constructs the analytical partial derivative of the Cavity \(C\) with respect to \(x\), \(y\) or \(z\) coordinates and evaluates it at a point \(\mathbf{r}\). This is given for \(x\) by
\[ \frac{\partial C\left(\mathbf{r}\right)}{\partial x} = \left(1 - C{\left(\mathbf{r} \right)}\right) \sum_{i=1}^{N} - \frac{\left(x-{x}_{i}\right)e^{- \frac{\operatorname{s_{i}}^{2}{\left(\mathbf{r} \right)}}{\sigma^{2}}}} {\sqrt{\pi}\sigma\left(0.5 \operatorname{erf}{\left(\frac{\operatorname{s_{i}}{\left(\mathbf{r} \right)}}{\sigma} \right)} + 0.5\right) \left| \mathbf{r} - \mathbf{r}_{i} \right|} \]where the subscript \(i\) is the index related to each sphere in the cavity, and \(\operatorname{s}\) is the signed normal distance from the surface of each sphere.- Parameters
r – The coordinates of a test point in 3D space.
index – An integer that defines the variable of differentiation (0->x, 1->z and 2->z).
centers – A vector containing the coordinates of the centers of the spheres in the cavity.
radii – A vector containing the radii of the spheres.
width – A double value describing the width of the transition at the boundary of the spheres.
- Returns
A double number which represents the value of the differential (w.r.t. x, y or z) at point r.
Permittivity¶
-
class Permittivity : public mrcpp::RepresentableFunction<3>¶
Permittivity function related to a substrate molecule and a solvent continuum. The Permittivity class represents the following function Fosso-Tande2013
\[ \epsilon(\mathbf{r}) = \epsilon_{in}\exp\left(\left(\log\frac{\epsilon_{out}}{\epsilon_{in}} \right) \left(1 - C(\mathbf{r})\right)\right) \]where \(\mathbf{r}\) is the coordinate of a point in 3D space, \( C \) is the cavity function of the substrate, and \(\epsilon_{in}\) and \( \epsilon_{out} \) are the dielectric constants describing, respectively, the permittivity inside and outside the cavity of the substrate.Public Functions
-
Permittivity(const Cavity cavity, double epsilon_in, double epsilon_out, std::string formulation)¶
Standard constructor. Initializes the cavity, epsilon_in and epsilon_out with the input parameters.
- Parameters
cavity – interlocking spheres of Cavity class.
epsilon_in – permittivity inside the cavity.
epsilon_out – permittivity outside the cavity.
formulation – Decides which formulation of the Permittivity function to implement, only exponential available as of now.
-
double evalf(const mrcpp::Coord<3> &r) const override¶
Evaluates Permittivity at a point in 3D space with respect to the state of inverse.
-
inline auto getCoordinates() const¶
Calls the Cavity::getCoordinates() method of the cavity instance.
-
inline auto getRadii() const¶
Calls the Cavity::getRadii() method of the cavity instance.
-
inline auto getEpsIn() const¶
Returns the value of epsilon_in.
-
inline auto getEpsOut() const¶
Returns the value of epsilon_out.
-
inline std::string getFormulation() const¶
Returns the formulation.
-
void printParameters() const¶
Print parameters.
-
Permittivity(const Cavity cavity, double epsilon_in, double epsilon_out, std::string formulation)¶
SCRF¶
-
class SCRF¶
class that performs the computation of the ReactionPotential, named Self Consistent Reaction Field.
Private Members
-
mrcpp::FunctionTreeVector<3> d_cavity¶
Vector containing the 3 partial derivatives of the cavity function.
-
mrcpp::FunctionTreeVector<3> d_cavity¶