40 accumulationBuffer() += (*this)[
b];
44 (*this)[
b] = Field<Type>(bufferLength(), pTraits<Type>::zero);
46 bufferOffsets_[
b] = 0;
65 const label bufferLength,
66 const label bufferingInterval
89 averagesTaken_(bA.averagesTaken()),
90 bufferOffsets_(bA.bufferOffsets())
106 const label nBuffers,
107 const label bufferLength,
108 const label bufferingInterval
111 (*this).setSize(nBuffers + 1);
120 bufferOffsets_.
setSize(nBuffers);
122 forAll(bufferOffsets_, bO)
124 bufferOffsets_[bO] = -bufferingInterval * bO - 1;
135 label bufferToRefill = -1;
141 label& bO = bufferOffsets_[
b];
145 buf[bO] = valuesToAdd[
b];
152 accumulateAndResetBuffer(
b);
157 if (bufferToRefill != -1)
159 FatalErrorIn(
"bufferedAccumulator<Type>::addToBuffers ")
160 <<
"More than one bufferedAccumulator accumulation " 161 <<
"buffer filled at once, this is considered an error." 169 return bufferToRefill;
178 Field<Type> bA = accumulationBuffer()/averagesTaken_;
186 "bufferedAccumulator<Type>::averagedbufferedAccumulator() const" 187 ) <<
"Averaged correlation function requested but averagesTaken = " 189 <<
". Returning empty field." 209 void Foam::bufferedAccumulator<Type>::operator=
219 "bufferedAccumulator<Type>::operator=(const bufferedAccumulator&)" 220 ) <<
"Attempted assignment to self" 226 averagesTaken_ = rhs.averagesTaken();
228 bufferOffsets_ = rhs.bufferOffsets();
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const char *const typeName
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label bufferLength() const
#define WarningIn(functionName)
Report a warning using Foam::Warning.
label addToBuffers(const List< Type > &valuesToAdd)
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
bufferedAccumulator()
Construct null.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
~bufferedAccumulator()
Destructor.
Traits class for primitives.
Field< Type > averaged() const
friend Ostream & operator(Ostream &, const bufferedAccumulator< Type > &)
void setSizes(const label nBuffers, const label bufferLength, const label bufferingInterval)