Time: Removed graphFormat
setFormat no longer defaults to the value of graphFormat optionally set in controlDict and must be set in the functionObject dictionary. boundaryFoam, financialFoam and pdfPlot still require a graphFormat entry in controlDict but this is now read directly rather than by Time.
This commit is contained in:
@ -82,7 +82,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (runTime.writeTime())
|
||||
{
|
||||
setWriter::New(runTime.graphFormat())->write
|
||||
setWriter::New(runTime.controlDict().lookup("graphFormat"))->write
|
||||
(
|
||||
runTime.globalPath()
|
||||
/functionObjects::writeFile::outputPrefix
|
||||
|
||||
@ -408,11 +408,7 @@ bool Foam::functionObjects::populationBalanceSizeDistribution::read
|
||||
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
formatterPtr_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ const volSymmTensorField R
|
||||
|
||||
runTime.write();
|
||||
|
||||
setWriter::New(runTime.graphFormat())->write
|
||||
setWriter::New(runTime.controlDict().lookup("graphFormat"))->write
|
||||
(
|
||||
runTime.globalPath()
|
||||
/functionObjects::writeFile::outputPrefix
|
||||
|
||||
@ -6,7 +6,4 @@ label sampleFrequency(propsDict.lookup<label>("sampleFrequency"));
|
||||
|
||||
label maxPositions(propsDict.lookup<label>("maxPositions"));
|
||||
|
||||
word setFormat
|
||||
(
|
||||
propsDict.lookupOrDefault<word>("setFormat", runTime.graphFormat())
|
||||
);
|
||||
word setFormat(propsDict.lookup<word>("setFormat"));
|
||||
|
||||
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
x[i] = xMin + i*(xMax - xMin)/(nIntervals - 1);
|
||||
}
|
||||
|
||||
setWriter::New(runTime.graphFormat())->write
|
||||
setWriter::New(runTime.controlDict().lookup("graphFormat"))->write
|
||||
(
|
||||
pdfPath,
|
||||
args.executable(),
|
||||
|
||||
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
|
||||
// Graph format
|
||||
const word graphFormat
|
||||
(
|
||||
dict.lookupOrDefault<word>("graphFormat", runTime.graphFormat())
|
||||
dict.lookupOrDefault<word>("graphFormat", "raw")
|
||||
);
|
||||
|
||||
Info<< "Reading data file" << endl;
|
||||
|
||||
@ -385,7 +385,6 @@ Foam::Time::Time
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_
|
||||
@ -484,7 +483,6 @@ Foam::Time::Time
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_(*this, enableFunctionObjects)
|
||||
@ -550,7 +548,6 @@ Foam::Time::Time
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_(*this, enableFunctionObjects)
|
||||
@ -611,7 +608,6 @@ Foam::Time::Time
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_(*this, enableFunctionObjects)
|
||||
|
||||
@ -190,9 +190,6 @@ private:
|
||||
//- Default output compression
|
||||
IOstream::compressionType writeCompression_;
|
||||
|
||||
//- Default graph format
|
||||
word graphFormat_;
|
||||
|
||||
//- Is temporary object cache enabled
|
||||
mutable bool cacheTemporaryObjects_;
|
||||
|
||||
@ -301,12 +298,6 @@ public:
|
||||
return writeCompression_;
|
||||
}
|
||||
|
||||
//- Default graph format
|
||||
const word& graphFormat() const
|
||||
{
|
||||
return graphFormat_;
|
||||
}
|
||||
|
||||
//- Supports re-reading
|
||||
const Switch& runTimeModifiable() const
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -202,7 +202,6 @@ void Foam::Time::readDict()
|
||||
}
|
||||
}
|
||||
|
||||
controlDict_.readIfPresent("graphFormat", graphFormat_);
|
||||
controlDict_.readIfPresent("runTimeModifiable", runTimeModifiable_);
|
||||
|
||||
userTime_->read(controlDict_);
|
||||
|
||||
@ -71,11 +71,7 @@ bool Foam::functionObjects::histogram::read(const dictionary& dict)
|
||||
min_ = dict.lookupOrDefault<scalar>("min", 0);
|
||||
dict.lookup("nBins") >> nBins_;
|
||||
|
||||
formatterPtr_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -245,11 +245,7 @@ bool Foam::functionObjects::layerAverage::read(const dictionary& dict)
|
||||
|
||||
fields_ = dict.lookup<wordList>("fields");
|
||||
|
||||
formatter_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatter_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
calcLayers();
|
||||
|
||||
|
||||
@ -658,11 +658,7 @@ bool Foam::functionObjects::patchCutLayerAverage::read(const dictionary& dict)
|
||||
)
|
||||
];
|
||||
|
||||
formatter_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatter_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
nOptimiseIter_ = dict.lookupOrDefault("nOptimiseIter", 2);
|
||||
|
||||
|
||||
@ -371,11 +371,7 @@ bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict)
|
||||
dict.lookup("nBins") >> nBins_;
|
||||
dict.lookup("fields") >> fields_;
|
||||
|
||||
formatterPtr_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -181,11 +181,7 @@ bool Foam::functionObjects::streamlines::read(const dictionary& dict)
|
||||
dict.subDict("seedSampleSet")
|
||||
);
|
||||
|
||||
formatterPtr_ = setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat()),
|
||||
dict
|
||||
);
|
||||
formatterPtr_ = setWriter::New(dict.lookup("setFormat"), dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -108,18 +108,7 @@ Foam::SizeDistribution<CloudType>::SizeDistribution
|
||||
:
|
||||
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
|
||||
nPoints_(dict.lookup<label>("nPoints")),
|
||||
formatter_
|
||||
(
|
||||
setWriter::New
|
||||
(
|
||||
dict.lookupOrDefault
|
||||
(
|
||||
"setFormat",
|
||||
owner.mesh().time().graphFormat()
|
||||
),
|
||||
dict
|
||||
)
|
||||
)
|
||||
formatter_(setWriter::New(dict.lookup("setFormat"), dict))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ void writeEk
|
||||
|
||||
autoPtr<setWriter> writer
|
||||
(
|
||||
setWriter::New(U.time().graphFormat())
|
||||
setWriter::New(U.time().controlDict().lookup("graphFormat"))
|
||||
);
|
||||
|
||||
writer->write
|
||||
|
||||
@ -145,10 +145,7 @@ bool Foam::functionObjects::sampledSets::read(const dictionary& dict)
|
||||
|
||||
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
||||
|
||||
const word writeType
|
||||
(
|
||||
dict.lookupOrDefault("setFormat", time_.graphFormat())
|
||||
);
|
||||
const word writeType(dict.lookup("setFormat"));
|
||||
|
||||
// Define the set formatter
|
||||
formatter_ = setWriter::New(writeType, dict);
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -42,8 +42,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -42,8 +42,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -44,7 +44,5 @@ timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -42,8 +42,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -42,8 +42,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
@ -43,8 +43,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
@ -43,8 +43,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
@ -44,8 +44,6 @@ timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
graphFormat raw;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user