Skip to content

Commit f77cc0d

Browse files
authored
Update SU2_CFD/src/output/tools/CWindowingTools.cpp
1 parent dd9d9a6 commit f77cc0d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

SU2_CFD/src/output/tools/CWindowingTools.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ void CWindowedAverage::addValue(su2double valIn, unsigned long curTimeIter,unsig
8989
}
9090

9191
su2double CWindowedAverage::UpdateCachedSum(unsigned long windowWidth) const {
92-
su2double weightedSum = 0.;
93-
// Handle square window
94-
if (windowingFunctionId == WINDOW_FUNCTION::SQUARE) return val * static_cast<su2double>(windowWidth);
95-
// Handle non-trivial windows
96-
// At this point new samples are not yet added. Therefore: values.size()=windowWidth-1
97-
for (unsigned long curTimeIter = 0; curTimeIter < values.size(); curTimeIter++) {
98-
// integrate over all but the last timestep-bin
99-
weightedSum += values[curTimeIter] * GetWndWeight(windowingFunctionId, curTimeIter, windowWidth);
100-
}
101-
return weightedSum;
92+
// Handle square window
93+
if (windowingFunctionId == WINDOW_FUNCTION::SQUARE) return val * static_cast<su2double>(windowWidth);
94+
// Handle non-trivial windows
95+
// At this point new samples are not yet added. Therefore: values.size()=windowWidth-1
96+
su2double weightedSum = 0.0;
97+
for (unsigned long curTimeIter = 0; curTimeIter < values.size(); curTimeIter++) {
98+
// integrate over all but the last timestep-bin
99+
weightedSum += values[curTimeIter] * GetWndWeight(windowingFunctionId, curTimeIter, windowWidth);
100+
}
101+
return weightedSum;
102102
}
103103

104104

0 commit comments

Comments
 (0)