|
votca 2026-dev
|
Induced charges and dipoles of a polar region with charge-response segments (Thole segments may be mixed in). More...
#include <chargeresponsesolver.h>

Classes | |
| struct | Info |
| struct | SiteRef |
| struct | Coupling |
| struct | SegmentBlock |
Public Member Functions | |
| ChargeResponseSolver (std::vector< PolarSegment > &segments, const eeInteractor &interactor) | |
| Info | Solve (double tolerance, Index max_iter, bool use_previous) |
| double | InternalChargeEnergy () const |
| Index | size () const |
| Eigen::VectorXd | Apply (const Eigen::VectorXd &y) const |
| Eigen::MatrixXd | DenseOperator () const |
| Eigen::MatrixXd | ApplyMhalf (const Eigen::MatrixXd &X) const |
| M^1/2 X for a matrix of unknown-space columns. | |
| Index | ChargeIndex (Index k) const |
| Index | NumCharges () const |
Private Member Functions | |
| Coupling | PairCoupling (Index a, Index b) const |
| Eigen::VectorXd | ApplyT (const Eigen::VectorXd &x) const |
| Eigen::VectorXd | ApplyMhalf (const Eigen::VectorXd &x, bool inverse) const |
| Eigen::VectorXd | Sources () const |
| Eigen::VectorXd | ReadFromSites () const |
| void | WriteToSites (const Eigen::VectorXd &x) |
Private Attributes | |
| std::vector< PolarSegment > & | segments_ |
| const eeInteractor & | interactor_ |
| std::vector< SiteRef > | sites_ |
| Index | nq_ = 0 |
| Index | dim_ = 0 |
| std::vector< SegmentBlock > | blocks_ |
| std::vector< Eigen::Matrix3d > | alpha_sqrt_ |
| std::vector< Eigen::Matrix3d > | alpha_inv_sqrt_ |
Induced charges and dipoles of a polar region with charge-response segments (Thole segments may be mixed in).
Unknowns x = (dq of the charge-response sites, mu of all sites), sources c = (-phi, E) from the potentials and fields accumulated in the sites (Phi + Phi_noE, -(V + V_noE)), M = blockdiag(Pi of each charge-response segment, alpha of each site). With T the couplings of the induced charges and dipoles ((T x)_q = induced potential, (T x)_mu = minus the induced field; nothing inside a charge-response segment, the Thole couplings inside a Thole segment):
x = M (c - T x) <=> (1 + M^1/2 T M^1/2) y = M^1/2 c, x = M^1/2 y,
solved by conjugate gradients on the symmetric operator. The null space of Pi (charge conservation) is handled by M^1/2. The kernels are those of eeInteractor (FillDipoleInteraction, GaussianKernel).
Definition at line 53 of file chargeresponsesolver.h.
| votca::xtp::ChargeResponseSolver::ChargeResponseSolver | ( | std::vector< PolarSegment > & | segments, |
| const eeInteractor & | interactor ) |
Definition at line 51 of file chargeresponsesolver.cc.
| Eigen::VectorXd votca::xtp::ChargeResponseSolver::Apply | ( | const Eigen::VectorXd & | y | ) | const |
Definition at line 220 of file chargeresponsesolver.cc.
| Eigen::MatrixXd votca::xtp::ChargeResponseSolver::ApplyMhalf | ( | const Eigen::MatrixXd & | X | ) | const |
M^1/2 X for a matrix of unknown-space columns.
Definition at line 190 of file chargeresponsesolver.cc.
|
private |
Definition at line 204 of file chargeresponsesolver.cc.
|
private |
Definition at line 107 of file chargeresponsesolver.cc.
Index of the induced charge of site k (the sites of all segments in order) among the unknowns, -1 for a Thole site; dipole of site k at NumCharges() + 3 k.
Definition at line 87 of file chargeresponsesolver.h.
| Eigen::MatrixXd votca::xtp::ChargeResponseSolver::DenseOperator | ( | ) | const |
The operator 1 + M^1/2 T M^1/2 as a dense matrix (for many right-hand sides at once, EnvironmentScreening).
Definition at line 148 of file chargeresponsesolver.cc.
| double votca::xtp::ChargeResponseSolver::InternalChargeEnergy | ( | ) | const |
1/2 dq^T Pi^+ dq summed over the charge-response segments, the internal energy of the induced charges (that of the dipoles is in PolarSite::InternalEnergy).
Definition at line 304 of file chargeresponsesolver.cc.
|
inline |
Definition at line 88 of file chargeresponsesolver.h.
|
private |
Definition at line 80 of file chargeresponsesolver.cc.
|
private |
Definition at line 236 of file chargeresponsesolver.cc.
|
inline |
Definition at line 74 of file chargeresponsesolver.h.
| ChargeResponseSolver::Info votca::xtp::ChargeResponseSolver::Solve | ( | double | tolerance, |
| Index | max_iter, | ||
| bool | use_previous ) |
Solves and writes dq and mu to the sites. With use_previous the induced values in the sites are the initial guess, else the response without couplings.
Definition at line 258 of file chargeresponsesolver.cc.
|
private |
Definition at line 224 of file chargeresponsesolver.cc.
|
private |
Definition at line 248 of file chargeresponsesolver.cc.
|
private |
Definition at line 130 of file chargeresponsesolver.h.
|
private |
Definition at line 129 of file chargeresponsesolver.h.
|
private |
Definition at line 127 of file chargeresponsesolver.h.
|
private |
Definition at line 118 of file chargeresponsesolver.h.
|
private |
Definition at line 115 of file chargeresponsesolver.h.
|
private |
Definition at line 117 of file chargeresponsesolver.h.
|
private |
Definition at line 114 of file chargeresponsesolver.h.
|
private |
Definition at line 116 of file chargeresponsesolver.h.