32 double sum(0.0), err(0.0), tempVal, tempSum;
34 for (
int i = 0; i < n; ++i) {
35 tempVal = rg[i] - err;
36 tempSum = sum + tempVal;
37 err = tempSum - sum - tempVal;
41 return (sum / ((
double)rg.
capacity()));
Field of real double precision values on an FFT mesh.
File input/output operations and format conversions for fields.
Prdc::Cpu::RField< D > const & rgrid() const
Get the field in r-grid format.
double rGridAverage() const override
Calculate the average value of the rgrid_ member.
int capacity() const
Return allocated size.
Fields and FFTs for periodic boundary conditions (CPU)
Periodic fields and crystallography.
Real periodic fields, SCFT and PS-FTS (CPU).
PSCF package top-level namespace.