43 accumulationBuffer() += (*this)[
b];
47 (*this)[
b] = Field<Type>(bufferLength(),
Zero);
49 bufferOffsets_[
b] = 0;
68 const label bufferLength,
69 const label bufferingInterval
88 const bufferedAccumulator<Type>& bA
91 List<Field<Type>>(static_cast<List<Field<Type>>>(bA)),
92 averagesTaken_(bA.averagesTaken()),
93 bufferOffsets_(bA.bufferOffsets())
109 const label nBuffers,
110 const label bufferLength,
111 const label bufferingInterval
114 (*this).setSize(nBuffers + 1);
123 bufferOffsets_.setSize(nBuffers);
125 forAll(bufferOffsets_, bO)
127 bufferOffsets_[bO] = -bufferingInterval * bO - 1;
135 const List<Type>& valuesToAdd
138 label bufferToRefill = -1;
140 for (label
b = 0;
b < nBuffers();
b++)
142 Field<Type>& buf((*
this)[
b]);
144 label& bO = bufferOffsets_[
b];
148 buf[bO] = valuesToAdd[
b];
153 if (bO == bufferLength())
155 accumulateAndResetBuffer(
b);
160 if (bufferToRefill != -1)
163 <<
"More than one bufferedAccumulator accumulation "
164 <<
"buffer filled at once, this is considered an error."
172 return bufferToRefill;
181 Field<Type> bA = accumulationBuffer()/averagesTaken_;
188 <<
"Averaged correlation function requested but averagesTaken = "
190 <<
". Returning empty field."
201 accumulationBuffer() = Field<Type>(bufferLength(),
Zero);
220 List<Field<Type>>::operator=(rhs);
224 bufferOffsets_ = rhs.bufferOffsets();