Commit 40ed1952 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: noise models - enable the use of environment variables in input file names. Fixes #285

parent b9d5e5ba
......@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
(
IOobject
(
dictName,
dictName.expand(),
runTime,
IOobject::MUST_READ
)
......
......@@ -46,6 +46,11 @@ addToRunTimeSelectionTable(noiseModel, surfaceNoise, dictionary);
void surfaceNoise::initialise(const dictionary& dict)
{
dict.lookup("inputFile") >> inputFileName_;
inputFileName_.expand();
dict.readIfPresent("fftWriteInterval", fftWriteInterval_);
label nAvailableTimes = 0;
// All reading performed on the master processor only
......@@ -418,13 +423,13 @@ Foam::scalar surfaceNoise::surfaceAverage
surfaceNoise::surfaceNoise(const dictionary& dict)
:
noiseModel(dict),
inputFileName_(dict.lookup("inputFile")),
inputFileName_("unknown-inputFile"),
pIndex_(0),
times_(),
deltaT_(0),
startTimeIndex_(0),
nFace_(0),
fftWriteInterval_(dict.lookupOrDefault("fftWriteInterval", 1))
fftWriteInterval_(1)
{
initialise(dict);
}
......
......@@ -116,7 +116,7 @@ protected:
// Protected Data
//- Input file name
const fileName inputFileName_;
fileName inputFileName_;
//- Index of pressure field in reader field list
label pIndex_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment