40 const label tZeroBufferSize
43 sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaTValue());
45 sampleInterval_ = sampleSteps_*mesh_.time().deltaTValue();
47 label bufferLength(ceil(duration_/sampleInterval_));
49 duration_ = bufferLength*sampleInterval_;
51 label bufferingInterval(ceil(averagingInterval_/sampleInterval_));
53 averagingInterval_ = bufferingInterval*sampleInterval_;
55 label nBuffers(ceil(duration_/averagingInterval_));
84 const label tZeroBufferSize
103 const polyMesh&
mesh,
104 const label tZeroBufferSize,
105 const scalar duration,
106 const scalar sampleInterval,
107 const scalar averagingInterval
110 bufferedAccumulator<scalar>(),
113 sampleInterval_(sampleInterval),
114 averagingInterval_(averagingInterval)
135 if (measurandFieldSize() != currentValues.size())
138 <<
"Trying to supply a Field of length"
139 << currentValues.size()
140 <<
" to calculate the correlation function. "
141 <<
"Expecting a Field of length "
142 << measurandFieldSize() <<
nl
148 forAll(tZeroBuffers_, tZB)
150 scalar& cFSum = cFSums[tZB];
152 const Field<Type>& tZeroBuffer = tZeroBuffers_[tZB];
156 const Type& tZeroBufferValue = tZeroBuffer[cV];
158 const Type& currentValue = currentValues[cV];
169 cFSum /= (measurandFieldSize()*currentValues[0].size());
172 label bufferToRefill = addToBuffers(cFSums);
174 if (bufferToRefill != -1)
176 tZeroBuffers_[bufferToRefill] = currentValues;
184 const Type& currentValue
187 if (measurandFieldSize() != 1)
190 <<
"Trying to supply a single value to calculate the correlation "
191 <<
"function. Expecting a Field of length "
192 << measurandFieldSize()
196 calculateCorrelationFunction(Field<Type>(1, currentValue));
205 scalar cFIntegral = 0.0;
207 for (
label v = 0; v < averageCF.size() - 1; v++)
212 *(averageCF[v+1] + averageCF[v]);