93 Foam::scalar checkUniformTimeStep(
const scalarField& t)
101 const scalar dT = t[i] - t[i-1];
107 if (
mag(deltaT - dT) > rootSmall)
110 <<
"Unable to process data with a variable time step"
118 <<
"Unable to create FFT with a single value"
128 int main(
int argc,
char *argv[])
135 const word dictName(
"noiseDict");
155 const word graphFormat
178 <<
"Block size N = " << N
179 <<
" is larger than number of data = " << t.size()
183 Info<<
" read " << t.size() <<
" values" <<
nl <<
endl;
186 Info<<
"Creating noise FFT" <<
endl;
187 noiseFFT nfft(checkUniformTimeStep(t),
p);
192 const fileName baseFileName(pDateFileName.lessExt());
203 Info<<
" Creating graph for P(f)" <<
endl;
208 coordSet(
true,
"f [Hz]", Pf.first()),
214 Info<<
" Creating graph for L(f)" <<
endl;
219 coordSet(
true,
"f [Hz]", Lf.first()),
225 Info<<
" Creating graph for Ldelta" <<
endl;
230 coordSet(
true,
"fm [Hz]", Ldelta.first()),
236 Info<<
" Creating graph for Pdelta" <<
endl;
241 coordSet(
true,
"fm [Hz]", Pdelta.first()),
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void size(const label)
Override size to be inconsistent with allocated storage.
virtual Ostream & write(const char)=0
Write character.
An ordered pair of two objects of type <T> with first() and second() elements.
static void noParallel()
Remove the parallel options.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Holds list of sampling positions.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
A class for handling file names.
static const word outputPrefix
Directory prefix.
FFT of the pressure field.
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
Select given write options.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
const dimensionSet dimPressure
Ostream & endl(Ostream &os)
Add newline and flush stream.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::argList args(argc, argv)