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