26 double rCut = params.
rCut;
28 throw std::runtime_error(
"ERROR: Real space cutoff of Ewald "
29 "summation cannot be zero.");
50 double const prec)
const
52 double x = sqrt(rCut/2) * prec /
C;
54 throw runtime_error(
"ERROR: Bad Ewald precision settings, try a "
56 return rCut / sqrt(-2 * log(x));
60 double const prec)
const
62 double constexpr acceptError = 1.e-10;
63 double relXError = 1.0;
64 double relYError = 1.0;
65 double y = eta * prec / (sqrt(2) *
C);
67 double kCut = 1.0/eta;
69 while (relXError > acceptError || relYError > acceptError)
72 kCut -= 2 * kCut / (1 + 2*pow(kCut * eta,2.0))
73 * (-1 + sqrt(kCut) * exp(pow(kCut * eta,2.0)/2) * y);
81 relXError = abs((kCut - kCutOld) / kCut);
82 relYError = abs((1/sqrt(kCut)
83 * exp(-pow(kCut * eta,2.0) / 2) - y) / y);
std::size_t getNumAtoms() const
void calculateC(double const qMax)
double calculateEta(double const rCut, double const prec) const
double calculateKCut(double const eta, double const prec) const
bool newCutoffsWerePublished
bool publishedNewCutoffs() override
void calculateParameters(EwaldGlobalSettings const &settings, EwaldStructureData const &sData, EwaldParameters ¶ms) override
bool isEstimateReliable(EwaldGlobalSettings const &settings, EwaldParameters const ¶ms) const override
double fourPiEps
Multiplicative constant .
double rCut
Cutoff in real space.
double eta
Width of the gaussian screening charges.
double kCut
Cutoff in reciprocal space.