ENH: noise functionality robustness improvements

This commit is contained in:
Andrew Heather
2016-08-18 15:24:13 +01:00
parent 9fb439bb46
commit 16b516bba3
2 changed files with 21 additions and 5 deletions

View File

@ -127,11 +127,14 @@ void Foam::noiseFFT::octaveBandInfo
fBandIDs = bandIDs.toc();
if (fc.size())
{
// Remove the last centre frequency (beyond upper frequency limit)
fc.remove();
fCentre.transfer(fc);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -494,8 +494,21 @@ void surfaceNoise::calculate()
octave13FreqCentre
);
List<scalarField> surfPSD13f(octave13BandIDs.size() - 1);
List<scalarField> surfPrms13f2(octave13BandIDs.size() - 1);
label bandSize = 0;
if (octave13BandIDs.empty())
{
WarningInFunction
<< "Ocatve band calculation failed (zero sized). "
<< "please check your input data"
<< endl;
}
else
{
bandSize = octave13BandIDs.size() - 1;
}
List<scalarField> surfPSD13f(bandSize);
List<scalarField> surfPrms13f2(bandSize);
forAll(surfPSD13f, freqI)
{
surfPSD13f[freqI].setSize(nLocalFace);