mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: noise models - enable the use of environment variables in input file names. Fixes #285
This commit is contained in:
@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user