94 Foam::scalar checkUniformTimeStep(
const scalarField& t)
102 const scalar dT = t[i] - t[i-1];
108 if (
mag(deltaT - dT) > rootSmall)
111 <<
"Unable to process data with a variable time step"
119 <<
"Unable to create FFT with a single value"
129 int main(
int argc,
char *argv[])
136 const word dictName(
"noiseDict");
156 const word graphFormat
177 <<
"Block size N = " << N
178 <<
" is larger than number of data = " << t.size()
182 Info<<
" read " << t.size() <<
" values" <<
nl <<
endl;
185 Info<<
"Creating noise FFT" <<
endl;
186 noiseFFT nfft(checkUniformTimeStep(t),
p);
191 const fileName baseFileName(pDateFileName.lessExt());
202 Info<<
" Creating graph for P(f)" <<
endl;
207 coordSet(
true,
"f [Hz]", Pf.first()),
213 Info<<
" Creating graph for L(f)" <<
endl;
218 coordSet(
true,
"f [Hz]", Lf.first()),
224 Info<<
" Creating graph for Ldelta" <<
endl;
229 coordSet(
true,
"fm [Hz]", Ldelta.first()),
235 Info<<
" Creating graph for Pdelta" <<
endl;
240 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,.
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::argList args(argc, argv)