ENH: provide setter methods for IOobject read/write options etc.

- simplifies local toggling.

- centralize fileModification static variables into IOobject.
  They were previously scattered between IOobject and regIOobject
This commit is contained in:
Mark Olesen
2021-03-17 11:02:10 +01:00
parent 3ce18cb6e2
commit 9a2a22a03a
85 changed files with 370 additions and 364 deletions

View File

@ -47,7 +47,7 @@
}
else if (rhoType == "field")
{
rhoIO.readOpt() = IOobject::MUST_READ;
rhoIO.readOpt(IOobject::MUST_READ);
rhoPtr.reset
(
@ -102,7 +102,7 @@
}
else if (EType == "field")
{
EHeader.readOpt() = IOobject::MUST_READ;
EHeader.readOpt(IOobject::MUST_READ);
EPtr.reset
(
@ -156,7 +156,7 @@
}
else if (nuType == "field")
{
nuIO.readOpt() = IOobject::MUST_READ;
nuIO.readOpt(IOobject::MUST_READ);
nuPtr.reset
(
new volScalarField

View File

@ -81,7 +81,7 @@ if (thermalStress)
}
else if (CType == "field")
{
CIO.readOpt() = IOobject::MUST_READ;
CIO.readOpt(IOobject::MUST_READ);
CPtr.reset
(
@ -136,7 +136,7 @@ if (thermalStress)
}
else if (kType == "field")
{
rhoKIO.readOpt() = IOobject::MUST_READ;
rhoKIO.readOpt(IOobject::MUST_READ);
rhoKPtr.reset
(
@ -191,7 +191,7 @@ if (thermalStress)
}
else if (alphaType == "field")
{
alphaIO.readOpt() = IOobject::MUST_READ;
alphaIO.readOpt(IOobject::MUST_READ);
alphaPtr.reset
(

View File

@ -89,7 +89,7 @@ void writeAndRead
const IOobject& io,
const label sz,
const word& writeType,
const IOobject::readOption readOpt,
const IOobject::readOption rOpt,
const word& readType
)
{
@ -112,7 +112,7 @@ void writeAndRead
// Read
IOobject readIO(io);
readIO.readOpt() = readOpt;
readIO.readOpt(rOpt);
Pout<< "Reading:"
<< fileHandler().filePath(readIO.objectPath()) << endl;
doRead<Type>(readIO, sz);
@ -134,7 +134,7 @@ void readIfPresent
// Read
Pout<< "Reading:" << fileHandler().filePath(io.objectPath()) << endl;
io.readOpt() = IOobject::READ_IF_PRESENT;
io.readOpt(IOobject::READ_IF_PRESENT);
doRead<Type>(io, sz);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1025,54 +1025,54 @@ int main(int argc, char *argv[])
forAll(scalarFlds, i)
{
scalarFlds[i].rename(scalarNames[i]);
scalarFlds[i].writeOpt() = IOobject::AUTO_WRITE;
scalarFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(vectorFlds, i)
{
vectorFlds[i].rename(vectorNames[i]);
vectorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
vectorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(sphTensorFlds, i)
{
sphTensorFlds[i].rename(sphTensorNames[i]);
sphTensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
sphTensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(symmTensorFlds, i)
{
symmTensorFlds[i].rename(symmTensorNames[i]);
symmTensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
symmTensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(tensorFlds, i)
{
tensorFlds[i].rename(tensorNames[i]);
tensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
tensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
// Surface ones.
forAll(surfScalarFlds, i)
{
surfScalarFlds[i].rename(surfScalarNames[i]);
surfScalarFlds[i].writeOpt() = IOobject::AUTO_WRITE;
surfScalarFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(surfVectorFlds, i)
{
surfVectorFlds[i].rename(surfVectorNames[i]);
surfVectorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
surfVectorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(surfSphericalTensorFlds, i)
{
surfSphericalTensorFlds[i].rename(surfSphTensorNames[i]);
surfSphericalTensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
surfSphericalTensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(surfSymmTensorFlds, i)
{
surfSymmTensorFlds[i].rename(surfSymmTensorNames[i]);
surfSymmTensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
surfSymmTensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
forAll(surfTensorNames, i)
{
surfTensorFlds[i].rename(surfTensorNames[i]);
surfTensorFlds[i].writeOpt() = IOobject::AUTO_WRITE;
surfTensorFlds[i].writeOpt(IOobject::AUTO_WRITE);
}
subsetter.subMesh().write();

View File

@ -1106,12 +1106,12 @@ int main(int argc, char *argv[])
{
Info<< "Not writing inconsistent processor cell decomposition"
<< " map " << cellProcAddressing.filePath() << endl;
cellProcAddressing.writeOpt() = IOobject::NO_WRITE;
cellProcAddressing.writeOpt(IOobject::NO_WRITE);
}
}
else
{
cellProcAddressing.writeOpt() = IOobject::NO_WRITE;
cellProcAddressing.writeOpt(IOobject::NO_WRITE);
}
if (faceProcAddressing.headerOk())
@ -1147,12 +1147,12 @@ int main(int argc, char *argv[])
{
Info<< "Not writing inconsistent processor face decomposition"
<< " map " << faceProcAddressing.filePath() << endl;
faceProcAddressing.writeOpt() = IOobject::NO_WRITE;
faceProcAddressing.writeOpt(IOobject::NO_WRITE);
}
}
else
{
faceProcAddressing.writeOpt() = IOobject::NO_WRITE;
faceProcAddressing.writeOpt(IOobject::NO_WRITE);
}
if (pointProcAddressing.headerOk())
@ -1173,12 +1173,12 @@ int main(int argc, char *argv[])
{
Info<< "Not writing inconsistent processor point decomposition"
<< " map " << pointProcAddressing.filePath() << endl;
pointProcAddressing.writeOpt() = IOobject::NO_WRITE;
pointProcAddressing.writeOpt(IOobject::NO_WRITE);
}
}
else
{
pointProcAddressing.writeOpt() = IOobject::NO_WRITE;
pointProcAddressing.writeOpt(IOobject::NO_WRITE);
}
if (boundaryProcAddressing.headerOk())
@ -1196,12 +1196,12 @@ int main(int argc, char *argv[])
{
Info<< "Not writing inconsistent processor patch decomposition"
<< " map " << boundaryProcAddressing.filePath() << endl;
boundaryProcAddressing.writeOpt() = IOobject::NO_WRITE;
boundaryProcAddressing.writeOpt(IOobject::NO_WRITE);
}
}
else
{
boundaryProcAddressing.writeOpt() = IOobject::NO_WRITE;
boundaryProcAddressing.writeOpt(IOobject::NO_WRITE);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -134,7 +135,7 @@ int main(int argc, char *argv[])
zn = pointLabels;
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.pointZones().writeOpt(IOobject::AUTO_WRITE);
mesh.pointZones().instance() = mesh.facesInstance();
}
@ -261,7 +262,7 @@ int main(int argc, char *argv[])
flipMap.shrink()
);
mesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.faceZones().writeOpt(IOobject::AUTO_WRITE);
mesh.faceZones().instance() = mesh.facesInstance();
}
@ -297,7 +298,7 @@ int main(int argc, char *argv[])
zn = cellLabels;
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.cellZones().writeOpt(IOobject::AUTO_WRITE);
mesh.cellZones().instance() = mesh.facesInstance();
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2016 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,7 +67,7 @@ void interpolateFields
{
tmp<GeoField> scFld = scMesh.interpolate(flds[i]);
GeoField* scFldPtr = scFld.ptr();
scFldPtr->writeOpt() = IOobject::AUTO_WRITE;
scFldPtr->writeOpt(IOobject::AUTO_WRITE);
scFldPtr->store();
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -192,7 +192,7 @@ void subsetVolFields
// Store on subMesh
GeoField* subFld = tSubFld.ptr();
subFld->rename(fld.name());
subFld->writeOpt() = IOobject::AUTO_WRITE;
subFld->writeOpt(IOobject::AUTO_WRITE);
subFld->store();
}
}
@ -246,7 +246,7 @@ void subsetSurfaceFields
// Store on subMesh
GeoField* subFld = tSubFld.ptr();
subFld->rename(fld.name());
subFld->writeOpt() = IOobject::AUTO_WRITE;
subFld->writeOpt(IOobject::AUTO_WRITE);
subFld->store();
}
}
@ -1886,7 +1886,7 @@ int main(int argc, char *argv[])
<< zoneI << ' ' << cellZones[zoneI].name() << endl;
}
}
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.cellZones().writeOpt(IOobject::AUTO_WRITE);
if (!overwrite)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -294,7 +294,7 @@ int main(int argc, char *argv[])
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
IOobject::fileModificationChecking = IOobject::timeStamp;
fileName meshDir = polyMesh::meshSubDir;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -570,7 +570,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
if (pz.size())
{
// Force writing on all processors
procMesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
procMesh.pointZones().writeOpt(IOobject::AUTO_WRITE);
}
}
@ -664,7 +664,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
if (fz.size())
{
// Force writing on all processors
procMesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
procMesh.faceZones().writeOpt(IOobject::AUTO_WRITE);
}
}
@ -728,7 +728,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
if (cz.size())
{
// Force writing on all processors
procMesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
procMesh.cellZones().writeOpt(IOobject::AUTO_WRITE);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -163,8 +163,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
// Create dummy mesh. Only used on procs that don't have mesh.
IOobject noReadIO(io);
noReadIO.readOpt() = IOobject::NO_READ;
noReadIO.writeOpt() = IOobject::AUTO_WRITE;
noReadIO.readOpt(IOobject::NO_READ);
noReadIO.writeOpt(IOobject::AUTO_WRITE);
fvMesh dummyMesh(noReadIO, Zero, false);
// Add patches

View File

@ -648,7 +648,7 @@ void readFields
{
const word& name = masterNames[i];
IOobject& io = *objects[name];
io.writeOpt() = IOobject::AUTO_WRITE;
io.writeOpt(IOobject::AUTO_WRITE);
// Load field (but not oldTime)
readField(io, mesh, i, fields);
@ -714,7 +714,7 @@ void readFields
{
const word& name = masterNames[i];
IOobject& io = *objects[name];
io.writeOpt() = IOobject::AUTO_WRITE;
io.writeOpt(IOobject::AUTO_WRITE);
// Load field (but not oldtime)
readField(io, mesh, i, fields);

View File

@ -26,7 +26,7 @@ label timeIndex = 0;
if (io.typeHeaderOk<IOdictionary>(true, false))
{
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
IOdictionary timeObject(io);
timeObject.readEntry("index", timeIndex);

View File

@ -14,7 +14,7 @@
{
Info<< "new points available" << endl;
// Read new points
io.readOpt() = IOobject::MUST_READ;
io.readOpt(IOobject::MUST_READ);
mesh.movePoints(pointIOField(io));
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -507,7 +507,7 @@ int main(int argc, char *argv[])
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
IOobject::fileModificationChecking = IOobject::timeStamp;
// Get the replacement rules from a dictionary

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -422,7 +422,7 @@ int main(int argc, char *argv[])
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp;
IOobject::fileModificationChecking = IOobject::timeStamp;
instantList timeDirs = timeSelector::select0(runTime, args);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -90,7 +90,7 @@ void MapConsistentVolFields
}
else
{
fieldTargetIOobject.readOpt() = IOobject::NO_READ;
fieldTargetIOobject.readOpt(IOobject::NO_READ);
// Interpolate field
fieldType fieldTarget

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -172,7 +172,7 @@ void MapVolFields
Info<< " creating new field "
<< fieldName << endl;
targetIO.readOpt() = IOobject::NO_READ;
targetIO.readOpt(IOobject::NO_READ);
tmp<fieldType> tfieldTarget
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -261,7 +261,7 @@ int main(int argc, char *argv[])
// Construct distributedTrisurfaceMesh from components
IOobject notReadIO(io);
notReadIO.readOpt() = IOobject::NO_READ;
notReadIO.readOpt(IOobject::NO_READ);
surfMeshPtr.reset(new distributedTriSurfaceMesh(notReadIO, s, dict));
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,7 +32,7 @@ License
#include "PackedList.H"
#include "PstreamReduceOps.H"
#include "OSspecific.H"
#include "regIOobject.H" // for fileModificationSkew symbol
#include "IOobject.H" // for fileModificationSkew symbol
#ifdef _WIN32
#undef FOAM_USE_INOTIFY
@ -410,7 +410,7 @@ void Foam::fileMonitor::checkFiles() const
}
else
{
if (newTime > (oldTime + regIOobject::fileModificationSkew))
if (newTime > (oldTime + IOobject::fileModificationSkew))
{
localState_[watchFd] = MODIFIED;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,7 +32,7 @@ License
#include "PackedList.H"
#include "PstreamReduceOps.H"
#include "OSspecific.H"
#include "regIOobject.H" // for fileModificationSkew symbol
#include "IOobject.H" // for fileModificationSkew symbol
#ifdef FOAM_USE_INOTIFY
#include <unistd.h>
@ -406,7 +406,7 @@ void Foam::fileMonitor::checkFiles() const
}
else
{
if (newTime > (oldTime + regIOobject::fileModificationSkew))
if (newTime > (oldTime + IOobject::fileModificationSkew))
{
localState_[watchFd] = MODIFIED;
}

View File

@ -29,6 +29,7 @@ License
#include "IOobject.H"
#include "Time.H"
#include "Istream.H"
#include "registerSwitch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -72,6 +73,29 @@ Foam::IOobject::fileCheckTypes Foam::IOobject::fileModificationChecking
);
float Foam::IOobject::fileModificationSkew
(
Foam::debug::floatOptimisationSwitch("fileModificationSkew", 30)
);
registerOptSwitch
(
"fileModificationSkew",
float,
Foam::IOobject::fileModificationSkew
);
int Foam::IOobject::maxFileModificationPolls
(
Foam::debug::optimisationSwitch("maxFileModificationPolls", 1)
);
registerOptSwitch
(
"maxFileModificationPolls",
int,
Foam::IOobject::maxFileModificationPolls
);
//! \cond file-scope
namespace Foam
{

View File

@ -229,7 +229,7 @@ protected:
//- with optional meta information.
static void writeHeaderContent
(
dictionary& os,
dictionary& dict,
const IOobject& io,
const word& objectType,
IOstreamOption streamOpt,
@ -246,7 +246,7 @@ public:
TypeName("IOobject");
// Static Data Members
// Static Data
//- Character for scoping object names (':' or '_')
// Change with caution.
@ -255,6 +255,12 @@ public:
//- Type of file modification checking
static fileCheckTypes fileModificationChecking;
//- Time skew (seconds) for file modification checks
static float fileModificationSkew;
//- Max number of times to poll for file modification changes
static int maxFileModificationPolls;
// Static Functions
@ -382,7 +388,7 @@ public:
const objectRegistry& registry,
readOption r=NO_READ,
writeOption w=NO_WRITE,
bool registerObject=true,
bool registerObject = true,
bool globalObject = false
);
@ -455,14 +461,14 @@ public:
//- Should object created with this IOobject be registered?
inline bool registerObject() const noexcept;
//- Should object created with this IOobject be registered?
inline bool& registerObject() noexcept;
//- Change registration preference, return previous value
inline bool registerObject(bool on) noexcept;
//- Is object same for all processors?
inline bool globalObject() const noexcept;
//- Is object same for all processors?
inline bool& globalObject() noexcept;
//- Change global-object status, return previous value
inline bool globalObject(bool on) noexcept;
//- The sizeof (label) in bytes, possibly read from the header
inline unsigned labelByteSize() const noexcept;
@ -492,14 +498,14 @@ public:
//- The read option
inline readOption readOpt() const noexcept;
//- Non-constant access to the read option
inline readOption& readOpt() noexcept;
//- Change the read option, return previous value
inline readOption readOpt(readOption opt) noexcept;
//- The write option
inline writeOption writeOpt() const noexcept;
//- Non-constant access to the write option
inline writeOption& writeOpt() noexcept;
//- Change the write option, return previous value
inline writeOption writeOpt(writeOption opt) noexcept;
// Path components
@ -636,6 +642,25 @@ public:
// Member Operators
void operator=(const IOobject& io);
// Housekeeping
//- Access to the read option
// \deprecated(2021-03) - use readOpt(readOption)
readOption& readOpt() noexcept { return rOpt_; }
//- Access to the write option
// \deprecated(2021-03) - use writeOpt(writeOption)
writeOption& writeOpt() noexcept { return wOpt_; }
//- Access to the register object option
// \deprecated(2021-03) - use registerObject(bool)
bool& registerObject() noexcept { return registerObject_; }
//- Access to the global object option
// \deprecated(2021-03) - use globalObject(bool)
bool& globalObject() noexcept { return globalObject_; }
};

View File

@ -115,9 +115,11 @@ inline bool Foam::IOobject::registerObject() const noexcept
}
inline bool& Foam::IOobject::registerObject() noexcept
inline bool Foam::IOobject::registerObject(bool on) noexcept
{
return registerObject_;
bool old(registerObject_);
registerObject_ = on;
return old;
}
@ -127,9 +129,11 @@ inline bool Foam::IOobject::globalObject() const noexcept
}
inline bool& Foam::IOobject::globalObject() noexcept
inline bool Foam::IOobject::globalObject(bool on) noexcept
{
return globalObject_;
bool old(globalObject_);
globalObject_ = on;
return old;
}
@ -168,9 +172,12 @@ inline Foam::IOobject::readOption Foam::IOobject::readOpt() const noexcept
}
inline Foam::IOobject::readOption& Foam::IOobject::readOpt() noexcept
inline Foam::IOobject::readOption
Foam::IOobject::readOpt(readOption opt) noexcept
{
return rOpt_;
readOption old(rOpt_);
rOpt_ = opt;
return old;
}
@ -180,9 +187,12 @@ inline Foam::IOobject::writeOption Foam::IOobject::writeOpt() const noexcept
}
inline Foam::IOobject::writeOption& Foam::IOobject::writeOpt() noexcept
inline Foam::IOobject::writeOption
Foam::IOobject::writeOpt(writeOption opt) noexcept
{
return wOpt_;
writeOption old(wOpt_);
wOpt_ = opt;
return old;
}

View File

@ -131,8 +131,8 @@ void Foam::unwatchedIOdictionary::addWatch()
bool masterOnly =
global()
&& (
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
);
if (masterOnly && Pstream::parRun())

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -476,7 +476,7 @@ Foam::Time::Time
// Explicitly set read flags on objectRegistry so anything constructed
// from it reads as well (e.g. fvSolution).
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
readOpt(IOobject::MUST_READ_IF_MODIFIED);
setControls();
setMonitoring();
@ -560,7 +560,7 @@ Foam::Time::Time
// Explicitly set read flags on objectRegistry so anything constructed
// from it reads as well (e.g. fvSolution).
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
readOpt(IOobject::MUST_READ_IF_MODIFIED);
setControls();
@ -637,10 +637,10 @@ Foam::Time::Time
// Explicitly set read flags on objectRegistry so anything constructed
// from it reads as well (e.g. fvSolution).
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
readOpt(IOobject::MUST_READ_IF_MODIFIED);
// Since could not construct regIOobject with setting:
controlDict_.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
controlDict_.readOpt(IOobject::MUST_READ_IF_MODIFIED);
setControls();
setMonitoring();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -478,8 +478,8 @@ void Foam::Time::readModifiedObjects()
fileHandler().updateStates
(
(
regIOobject::fileModificationChecking == inotifyMaster
|| regIOobject::fileModificationChecking == timeStampMaster
IOobject::fileModificationChecking == IOobject::inotifyMaster
|| IOobject::fileModificationChecking == IOobject::timeStampMaster
),
Pstream::parRun()
);

View File

@ -113,13 +113,13 @@ public:
//- True if case running with parallel distributed directories
//- (ie. not NFS mounted)
inline bool distributed() const;
inline bool distributed() const noexcept;
//- Return true if this is a processor case
inline bool processorCase() const;
inline bool processorCase() const noexcept;
//- Set processor case status. Return old one
inline bool processorCase(const bool isProcessorCase);
inline bool processorCase(const bool isProcessorCase) noexcept;
//- Return root path
inline const fileName& rootPath() const;

View File

@ -27,23 +27,23 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::TimePaths::distributed() const
inline bool Foam::TimePaths::distributed() const noexcept
{
return distributed_;
}
inline bool Foam::TimePaths::processorCase() const
inline bool Foam::TimePaths::processorCase() const noexcept
{
return processorCase_;
}
inline bool Foam::TimePaths::processorCase(const bool newProcCase)
inline bool Foam::TimePaths::processorCase(bool isProcessorCase) noexcept
{
const bool oldProcCase = processorCase_;
processorCase_ = newProcCase;
return oldProcCase;
bool old(processorCase_);
processorCase_ = isProcessorCase;
return old;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -161,7 +161,7 @@ Foam::functionEntries::codeStream::getFunction
{
const bool create =
Pstream::master()
|| (regIOobject::fileModificationSkew <= 0); // not NFS
|| (IOobject::fileModificationSkew <= 0); // not NFS
if (create)
{
@ -205,7 +205,7 @@ Foam::functionEntries::codeStream::getFunction
if
(
!doingMasterOnlyReading(topDict)
&& regIOobject::fileModificationSkew > 0
&& IOobject::fileModificationSkew > 0
)
{
//- Since the library has only been compiled on the master the
@ -220,8 +220,8 @@ Foam::functionEntries::codeStream::getFunction
for
(
label iter = 0;
iter < regIOobject::maxFileModificationPolls;
iter++
iter < IOobject::maxFileModificationPolls;
++iter
)
{
DebugPout
@ -257,10 +257,10 @@ Foam::functionEntries::codeStream::getFunction
<< " not of same size (" << mySize
<< ") as master ("
<< masterSize << "). Waiting for "
<< regIOobject::fileModificationSkew
<< IOobject::fileModificationSkew
<< " seconds." << endl;
Foam::sleep(regIOobject::fileModificationSkew);
Foam::sleep(IOobject::fileModificationSkew);
// Recheck local size
mySize = Foam::fileSize(libPath);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -175,7 +175,7 @@ void Foam::codedBase::createLibrary
{
bool create =
Pstream::master()
|| (regIOobject::fileModificationSkew <= 0); // not NFS
|| (IOobject::fileModificationSkew <= 0); // not NFS
if (create)
{
@ -206,7 +206,7 @@ void Foam::codedBase::createLibrary
// all processes must wait for compile to finish
if (regIOobject::fileModificationSkew > 0)
if (IOobject::fileModificationSkew > 0)
{
//- Since the library has only been compiled on the master the
// other nodes need to pick this library up through NFS
@ -222,8 +222,8 @@ void Foam::codedBase::createLibrary
for
(
label iter = 0;
iter < regIOobject::maxFileModificationPolls;
iter++
iter < IOobject::maxFileModificationPolls;
++iter
)
{
DebugPout
@ -259,10 +259,10 @@ void Foam::codedBase::createLibrary
<< " not of same size (" << mySize
<< ") as master ("
<< masterSize << "). Waiting for "
<< regIOobject::fileModificationSkew
<< IOobject::fileModificationSkew
<< " seconds." << endl;
Foam::sleep(regIOobject::fileModificationSkew);
Foam::sleep(IOobject::fileModificationSkew);
// Recheck local size
mySize = Foam::fileSize(libPath);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -134,7 +134,7 @@ Foam::objectRegistry::objectRegistry(const IOobject& io, const label nObjects)
dbDir_(parent_.dbDir()/local()/name()),
event_(1)
{
writeOpt() = IOobject::AUTO_WRITE;
writeOpt(IOobject::AUTO_WRITE);
}

View File

@ -31,7 +31,6 @@ License
#include "polyMesh.H"
#include "dictionary.H"
#include "fileOperation.H"
#include "registerSwitch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -40,29 +39,6 @@ namespace Foam
defineTypeNameAndDebug(regIOobject, 0);
}
float Foam::regIOobject::fileModificationSkew
(
Foam::debug::floatOptimisationSwitch("fileModificationSkew", 30)
);
registerOptSwitch
(
"fileModificationSkew",
float,
Foam::regIOobject::fileModificationSkew
);
int Foam::regIOobject::maxFileModificationPolls
(
Foam::debug::optimisationSwitch("maxFileModificationPolls", 1)
);
registerOptSwitch
(
"maxFileModificationPolls",
int,
Foam::regIOobject::maxFileModificationPolls
);
bool Foam::regIOobject::masterOnlyReading = false;
@ -319,8 +295,8 @@ void Foam::regIOobject::addWatch()
bool masterOnly =
global()
&& (
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
);
if (masterOnly && Pstream::parRun())

View File

@ -131,15 +131,11 @@ public:
friend class fileOperations::uncollatedFileOperation;
// Static data
// Static Data
//- Runtime type information
TypeName("regIOobject");
static float fileModificationSkew;
static int maxFileModificationPolls;
// Constructors

View File

@ -45,8 +45,8 @@ bool Foam::regIOobject::readHeaderOk
bool masterOnly =
global()
&& (
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
);
@ -227,8 +227,8 @@ bool Foam::regIOobject::read()
bool masterOnly =
global()
&& (
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
);
// Note: IOstream::binary flag is for all the processor comms. (Only for

View File

@ -98,8 +98,8 @@ bool Foam::regIOobject::writeObject
bool masterOnly =
isGlobal
&& (
regIOobject::fileModificationChecking == timeStampMaster
|| regIOobject::fileModificationChecking == inotifyMaster
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
);
bool osGood = false;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -466,7 +466,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
);
}
this->writeOpt() = IOobject::NO_WRITE;
this->writeOpt(IOobject::NO_WRITE);
}
@ -485,7 +485,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
DebugInFunction
<< "Constructing from tmp" << nl << this->info() << endl;
this->writeOpt() = IOobject::NO_WRITE;
this->writeOpt(IOobject::NO_WRITE);
tgf.clear();
}
@ -827,7 +827,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::storeOldTime() const
if (field0Ptr_->field0Ptr_)
{
field0Ptr_->writeOpt() = this->writeOpt();
field0Ptr_->writeOpt(this->writeOpt());
}
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,7 +33,7 @@ License
#include "IOobject.H"
#include "JobInfo.H"
#include "labelList.H"
#include "regIOobject.H"
#include "IOobject.H"
#include "dynamicCode.H"
#include "simpleObjectRegistry.H"
#include "sigFpe.H"
@ -1540,41 +1540,35 @@ void Foam::argList::parse
{
Info<< "fileModificationChecking : "
<< "Monitoring run-time modified files using "
<< regIOobject::fileCheckTypesNames
<< IOobject::fileCheckTypesNames
[
regIOobject::fileModificationChecking
IOobject::fileModificationChecking
];
if
(
(
regIOobject::fileModificationChecking
== regIOobject::timeStamp
)
|| (
regIOobject::fileModificationChecking
== regIOobject::timeStampMaster
)
IOobject::fileModificationChecking == IOobject::timeStamp
|| IOobject::fileModificationChecking == IOobject::timeStampMaster
)
{
if (regIOobject::maxFileModificationPolls == 1)
if (IOobject::maxFileModificationPolls == 1)
{
Info<< " (fileModificationSkew "
<< regIOobject::fileModificationSkew
<< IOobject::fileModificationSkew
<< ")";
}
else if (regIOobject::maxFileModificationPolls > 1)
else if (IOobject::maxFileModificationPolls > 1)
{
Info<< " (fileModificationSkew "
<< regIOobject::fileModificationSkew
<< IOobject::fileModificationSkew
<< ", maxFileModificationPolls "
<< regIOobject::maxFileModificationPolls
<< IOobject::maxFileModificationPolls
<< ")";
}
else
{
FatalErrorInFunction
<< "Invalid setting for maxFileModificationPolls "
<< regIOobject::maxFileModificationPolls
<< IOobject::maxFileModificationPolls
<< exit(FatalError);
}
}

View File

@ -165,25 +165,16 @@ void Foam::fileOperations::collatedFileOperation::printBanner
}
}
if
(
regIOobject::fileModificationChecking
== regIOobject::inotifyMaster
)
{
WarningInFunction
<< "Resetting fileModificationChecking to inotify" << endl;
}
if
(
regIOobject::fileModificationChecking
== regIOobject::timeStampMaster
)
{
WarningInFunction
<< "Resetting fileModificationChecking to timeStamp" << endl;
}
// if (IOobject::fileModificationChecking == IOobject::timeStampMaster)
// {
// WarningInFunction
// << "Resetting fileModificationChecking to timeStamp" << endl;
// }
// else if (IOobject::fileModificationChecking == IOobject::inotifyMaster)
// {
// WarningInFunction
// << "Resetting fileModificationChecking to inotify" << endl;
// }
}

View File

@ -251,8 +251,8 @@ Foam::fileMonitor& Foam::fileOperation::monitor() const
(
new fileMonitor
(
regIOobject::fileModificationChecking == IOobject::inotify
|| regIOobject::fileModificationChecking == IOobject::inotifyMaster
IOobject::fileModificationChecking == IOobject::inotify
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
)
);
}
@ -379,15 +379,18 @@ Foam::fileOperation::lookupAndCacheProcessorsPath
const bool readDirMasterOnly
(
regIOobject::fileModificationChecking == IOobject::timeStampMaster
|| regIOobject::fileModificationChecking == IOobject::inotifyMaster
Pstream::parRun() && !distributed()
&&
(
IOobject::fileModificationChecking == IOobject::timeStampMaster
|| IOobject::fileModificationChecking == IOobject::inotifyMaster
)
);
// As byproduct of the above selection, we exclude masterUncollated
// from using read/send, but that doesn't matter since that is what
// its own internals for readDir() do anyhow.
// The above selection excludes masterUncollated, which uses inotify or
// timeStamp but provides its own internals for readDir() anyhow.
if (readDirMasterOnly && Pstream::parRun() && !distributed())
if (readDirMasterOnly)
{
// Non-distributed.
// Read on master only and send to subProcs

View File

@ -746,20 +746,16 @@ masterUncollatedFileOperation
<< endl;
}
if (regIOobject::fileModificationChecking == regIOobject::timeStampMaster)
if (IOobject::fileModificationChecking == IOobject::timeStampMaster)
{
if (verbose)
{
WarningInFunction
<< "Resetting fileModificationChecking to timeStamp" << endl;
}
regIOobject::fileModificationChecking = regIOobject::timeStamp;
IOobject::fileModificationChecking = IOobject::timeStamp;
}
else if
(
regIOobject::fileModificationChecking
== regIOobject::inotifyMaster
)
else if (IOobject::fileModificationChecking == IOobject::inotifyMaster)
{
if (verbose)
{
@ -767,7 +763,7 @@ masterUncollatedFileOperation
<< "Resetting fileModificationChecking to inotify"
<< endl;
}
regIOobject::fileModificationChecking = regIOobject::inotify;
IOobject::fileModificationChecking = IOobject::inotify;
}
}
@ -792,20 +788,16 @@ masterUncollatedFileOperation
<< endl;
}
if (regIOobject::fileModificationChecking == regIOobject::timeStampMaster)
if (IOobject::fileModificationChecking == IOobject::timeStampMaster)
{
if (verbose)
{
WarningInFunction
<< "Resetting fileModificationChecking to timeStamp" << endl;
}
regIOobject::fileModificationChecking = regIOobject::timeStamp;
IOobject::fileModificationChecking = IOobject::timeStamp;
}
else if
(
regIOobject::fileModificationChecking
== regIOobject::inotifyMaster
)
else if (IOobject::fileModificationChecking == IOobject::inotifyMaster)
{
if (verbose)
{
@ -813,7 +805,7 @@ masterUncollatedFileOperation
<< "Resetting fileModificationChecking to inotify"
<< endl;
}
regIOobject::fileModificationChecking = regIOobject::inotify;
IOobject::fileModificationChecking = IOobject::inotify;
}
}

View File

@ -624,11 +624,11 @@ bool Foam::fileOperations::uncollatedFileOperation::read
}
// Set flag for e.g. codeStream
const bool oldGlobal = io.globalObject();
io.globalObject() = masterOnly;
const bool oldGlobal = io.globalObject(masterOnly);
// If codeStream originates from dictionary which is
// not IOdictionary we have a problem so use global
const bool oldFlag = regIOobject::masterOnlyReading;
const bool oldMasterOnly = regIOobject::masterOnlyReading;
regIOobject::masterOnlyReading = masterOnly;
// Read file
@ -636,8 +636,8 @@ bool Foam::fileOperations::uncollatedFileOperation::read
io.close();
// Restore flags
io.globalObject() = oldGlobal;
regIOobject::masterOnlyReading = oldFlag;
io.globalObject(oldGlobal);
regIOobject::masterOnlyReading = oldMasterOnly;
if (debug)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017, 2020 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1020,7 +1020,7 @@ void Foam::polyMesh::addZones
pointZones_.set(pI, pz[pI]);
}
pointZones_.writeOpt() = IOobject::AUTO_WRITE;
pointZones_.writeOpt(IOobject::AUTO_WRITE);
}
// Face zones
@ -1034,7 +1034,7 @@ void Foam::polyMesh::addZones
faceZones_.set(fI, fz[fI]);
}
faceZones_.writeOpt() = IOobject::AUTO_WRITE;
faceZones_.writeOpt(IOobject::AUTO_WRITE);
}
// Cell zones
@ -1048,7 +1048,7 @@ void Foam::polyMesh::addZones
cellZones_.set(cI, cz[cI]);
}
cellZones_.writeOpt() = IOobject::AUTO_WRITE;
cellZones_.writeOpt(IOobject::AUTO_WRITE);
}
}
@ -1216,13 +1216,13 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
}
}
points_.writeOpt() = IOobject::AUTO_WRITE;
points_.writeOpt(IOobject::AUTO_WRITE);
points_.instance() = time().timeName();
points_.eventNo() = getEvent();
if (tetBasePtIsPtr_)
{
tetBasePtIsPtr_->writeOpt() = IOobject::AUTO_WRITE;
tetBasePtIsPtr_->writeOpt(IOobject::AUTO_WRITE);
tetBasePtIsPtr_->instance() = time().timeName();
tetBasePtIsPtr_->eventNo() = getEvent();
}

View File

@ -40,33 +40,33 @@ void Foam::polyMesh::setInstance
{
DebugInFunction << "Resetting file instance to " << inst << endl;
points_.writeOpt() = wOpt;
points_.writeOpt(wOpt);
points_.instance() = inst;
faces_.writeOpt() = wOpt;
faces_.writeOpt(wOpt);
faces_.instance() = inst;
owner_.writeOpt() = wOpt;
owner_.writeOpt(wOpt);
owner_.instance() = inst;
neighbour_.writeOpt() = wOpt;
neighbour_.writeOpt(wOpt);
neighbour_.instance() = inst;
boundary_.writeOpt() = wOpt;
boundary_.writeOpt(wOpt);
boundary_.instance() = inst;
pointZones_.writeOpt() = wOpt;
pointZones_.writeOpt(wOpt);
pointZones_.instance() = inst;
faceZones_.writeOpt() = wOpt;
faceZones_.writeOpt(wOpt);
faceZones_.instance() = inst;
cellZones_.writeOpt() = wOpt;
cellZones_.writeOpt(wOpt);
cellZones_.instance() = inst;
if (tetBasePtIsPtr_)
{
tetBasePtIsPtr_->writeOpt() = wOpt;
tetBasePtIsPtr_->writeOpt(wOpt);
tetBasePtIsPtr_->instance() = inst;
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,14 +60,14 @@ Foam::IOobject Foam::combustionModel::createIOobject
if (io.typeHeaderOk<IOdictionary>(true))
{
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
io.readOpt() = IOobject::NO_READ;
return io;
io.readOpt(IOobject::NO_READ);
}
return io;
}

View File

@ -2558,7 +2558,7 @@ void Foam::ccm::reader::addFaceZones
++nZone;
}
mesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.faceZones().writeOpt(IOobject::AUTO_WRITE);
warnDuplicates("faceZones", mesh.faceZones().names());
}

View File

@ -73,7 +73,7 @@ void Foam::meshReader::addFaceZones(polyMesh& mesh) const
nZone++;
}
mesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.faceZones().writeOpt(IOobject::AUTO_WRITE);
warnDuplicates("faceZones", mesh.faceZones().names());
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -499,7 +499,7 @@ void Foam::cellTable::addCellZones
)
);
}
czMesh.writeOpt() = IOobject::AUTO_WRITE;
czMesh.writeOpt(IOobject::AUTO_WRITE);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -101,8 +101,8 @@ bool Foam::dynamicMotionSolverListFvMesh::init(const bool doInit)
if (dEntry.isDict())
{
IOobject io(ioDict);
io.readOpt() = IOobject::NO_READ;
io.writeOpt() = IOobject::AUTO_WRITE;
io.readOpt(IOobject::NO_READ);
io.writeOpt(IOobject::AUTO_WRITE);
io.rename(dEntry.dict().dictName());
IOdictionary IOsolverDict

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -116,7 +116,7 @@ bool Foam::dynamicMultiMotionSolverFvMesh::init(const bool doInit)
}
IOobject io(dynDict);
io.readOpt() = IOobject::NO_READ;
io.readOpt(IOobject::NO_READ);
motionPtr_.set
(

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,9 +56,9 @@ SimplifiedDynamicFvMesh
// Workaround to read fvSchemes and fvSolution after setting NO_READ
// when creating the mesh
{
fvSchemes::readOpt() = IOobject::MUST_READ;
fvSchemes::readOpt(IOobject::MUST_READ);
fvSchemes::read();
fvSolution::readOpt() = IOobject::MUST_READ;
fvSolution::readOpt(IOobject::MUST_READ);
fvSolution::read();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,9 +42,9 @@ Foam::fvMeshSubsetProxy::zeroGradientField
)
{
IOobject io(df);
io.readOpt() = IOobject::NO_READ;
io.writeOpt() = IOobject::NO_WRITE;
io.registerObject() = false;
io.readOpt(IOobject::NO_READ);
io.writeOpt(IOobject::NO_WRITE);
io.registerObject(false);
auto tfield = tmp<GeometricField<Type, fvPatchField, volMesh>>::New
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -519,11 +519,11 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
meshIO.instance() = facesInstance;
if (masterOnlyReading && !Pstream::master())
{
meshIO.readOpt() = IOobject::NO_READ;
meshIO.readOpt(IOobject::NO_READ);
}
else
{
meshIO.readOpt() = IOobject::READ_IF_PRESENT;
meshIO.readOpt(IOobject::READ_IF_PRESENT);
}
@ -537,9 +537,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
// (correctly) does no longer so below code explicitly addFvPatches
// using the separately read boundary file.
const regIOobject::fileCheckTypes oldCheckType =
regIOobject::fileModificationChecking;
regIOobject::fileModificationChecking = regIOobject::timeStamp;
const IOobject::fileCheckTypes oldCheckType =
IOobject::fileModificationChecking;
IOobject::fileModificationChecking = IOobject::timeStamp;
//- Points
@ -612,7 +612,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
);
fvMesh& mesh = *meshPtr;
regIOobject::fileModificationChecking = oldCheckType;
IOobject::fileModificationChecking = oldCheckType;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -145,7 +145,7 @@ Foam::codedPoints0MotionSolver::redirectMotionSolver() const
constructDict.set("motionSolver", name_);
IOobject io(*this);
io.readOpt() = IOobject::NO_READ;
io.readOpt(IOobject::NO_READ);
redirectMotionSolverPtr_ = motionSolver::New
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -217,7 +217,7 @@ void Foam::points0MotionSolver::updateMesh(const mapPolyMesh& mpm)
// points0 changed - set to write and check-in to database
points0_.rename("points0");
points0_.writeOpt() = IOobject::AUTO_WRITE;
points0_.writeOpt(IOobject::AUTO_WRITE);
points0_.instance() = time().timeName();
points0_.checkIn();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,7 +54,7 @@ Foam::IOobject Foam::motionSolver::stealRegistration
// De-register if necessary
const_cast<IOdictionary&>(dict).checkOut();
}
io.registerObject() = true;
io.registerObject(true);
return io;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1990,7 +1990,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory)
{
if (readHistory)
{
history_.readOpt() = IOobject::READ_IF_PRESENT;
history_.readOpt(IOobject::READ_IF_PRESENT);
if (history_.typeHeaderOk<refinementHistory>(true))
{
history_.read();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2017 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -241,7 +241,7 @@ void Foam::hexRef8Data::sync(const IOobject& io)
if (hasCellLevel && !cellLevelPtr_)
{
IOobject rio(io, "cellLevel");
rio.readOpt() = IOobject::NO_READ;
rio.readOpt(IOobject::NO_READ);
cellLevelPtr_.reset
(
new labelIOList(rio, labelList(mesh.nCells(), Zero))
@ -252,7 +252,7 @@ void Foam::hexRef8Data::sync(const IOobject& io)
if (hasPointLevel && !pointLevelPtr_)
{
IOobject rio(io, "pointLevel");
rio.readOpt() = IOobject::NO_READ;
rio.readOpt(IOobject::NO_READ);
pointLevelPtr_.reset
(
new labelIOList(rio, labelList(mesh.nPoints(), Zero))
@ -268,7 +268,7 @@ void Foam::hexRef8Data::sync(const IOobject& io)
if (!level0EdgePtr_)
{
IOobject rio(io, "level0Edge");
rio.readOpt() = IOobject::NO_READ;
rio.readOpt(IOobject::NO_READ);
level0EdgePtr_.reset
(
new uniformDimensionedScalarField
@ -284,7 +284,7 @@ void Foam::hexRef8Data::sync(const IOobject& io)
if (hasHistory && !refHistoryPtr_)
{
IOobject rio(io, "refinementHistory");
rio.readOpt() = IOobject::NO_READ;
rio.readOpt(IOobject::NO_READ);
refHistoryPtr_.reset(new refinementHistory(rio, mesh.nCells(), true));
}
}

View File

@ -239,7 +239,7 @@ void Foam::polyTopoChanger::update(const mapPolyMesh& m)
// Force the mesh modifiers to auto-write. This allows us to
// preserve the current state of modifiers corresponding with
// the mesh.
writeOpt() = IOobject::AUTO_WRITE;
writeOpt(IOobject::AUTO_WRITE);
instance() = mesh_.time().timeName();
}
@ -294,7 +294,7 @@ void Foam::polyTopoChanger::addTopologyModifiers
set(tmI, tm[tmI]);
}
writeOpt() = IOobject::AUTO_WRITE;
writeOpt(IOobject::AUTO_WRITE);
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -62,8 +62,7 @@ Foam::IOobject Foam::fa::options::createIOobject
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
@ -76,15 +75,15 @@ Foam::IOobject Foam::fa::options::createIOobject
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
io.readOpt() = IOobject::NO_READ;
return io;
io.readOpt(IOobject::NO_READ);
}
}
return io;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1121,7 +1121,7 @@ Foam::faMesh::S00() const
S0()
);
S0Ptr_->writeOpt() = IOobject::AUTO_WRITE;
S0Ptr_->writeOpt(IOobject::AUTO_WRITE);
}
return *S00Ptr_;

View File

@ -15,8 +15,8 @@ if (mesh.dynamic())
// - set to READ_IF_PRESENT and AUTO_WRITE to simplify dpdt correction
// by meshPhi
dpdtHeader.readOpt() = IOobject::READ_IF_PRESENT;
dpdtHeader.writeOpt() = IOobject::AUTO_WRITE;
dpdtHeader.readOpt(IOobject::READ_IF_PRESENT);
dpdtHeader.writeOpt(IOobject::AUTO_WRITE);
}
else
{
@ -28,5 +28,5 @@ volScalarField dpdt(dpdtHeader, fvc::ddt(p));
if (!thermo.dpdt())
{
dpdt == dimensionedScalar(dpdt.dimensions(), Zero);
dpdt.writeOpt() = IOobject::NO_WRITE;
dpdt.writeOpt(IOobject::NO_WRITE);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2020 PCOpt/NTUA
Copyright (C) 2020 FOSS GP
-------------------------------------------------------------------------------
@ -53,16 +53,16 @@ Foam::IOobject Foam::IOMRFZoneList::createIOobject
{
Info<< "Creating MRF zone list from " << io.name() << endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
Info<< "No MRF models present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
return io;
io.readOpt(IOobject::NO_READ);
}
return io;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -63,8 +63,7 @@ Foam::IOobject Foam::fv::options::createIOobject
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
@ -77,15 +76,15 @@ Foam::IOobject Foam::fv::options::createIOobject
<< io.instance()/io.name() << nl
<< endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
return io;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
io.readOpt() = IOobject::NO_READ;
return io;
io.readOpt(IOobject::NO_READ);
}
}
return io;
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2014 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,13 +50,13 @@ Foam::IOobject Foam::IOporosityModelList::createIOobject
{
Info<< "Creating porosity model list from " << io.name() << nl << endl;
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
}
else
{
Info<< "No porosity models present" << nl << endl;
io.readOpt() = IOobject::NO_READ;
io.readOpt(IOobject::NO_READ);
}
return io;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -252,7 +252,7 @@ const Foam::volScalarField::Internal& Foam::fvMesh::V00() const
// If V00 is used then V0 should be stored for restart
V0Ptr_->writeOpt() = IOobject::AUTO_WRITE;
V0Ptr_->writeOpt(IOobject::AUTO_WRITE);
}
return *V00Ptr_;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -467,9 +467,9 @@ Foam::simplifiedMeshes::columnFvMesh::columnFvMesh
// Workaround to read fvSchemes and fvSolution after setting NO_READ
// when creating the mesh
{
fvSchemes::readOpt() = IOobject::MUST_READ;
fvSchemes::readOpt(IOobject::MUST_READ);
fvSchemes::read();
fvSolution::readOpt() = IOobject::MUST_READ;
fvSolution::readOpt(IOobject::MUST_READ);
fvSolution::read();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -61,8 +61,8 @@ void Foam::functionObjects::nearWallFields::createFields
sflds.setSize(sz+1);
IOobject io(fld);
io.readOpt() = IOobject::NO_READ;
io.writeOpt() = IOobject::NO_WRITE;
io.readOpt(IOobject::NO_READ);
io.writeOpt(IOobject::NO_WRITE);
io.rename(sampleFldName);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -614,7 +614,7 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor
if (log)
{
indicator_.writeOpt() = IOobject::AUTO_WRITE;
indicator_.writeOpt(IOobject::AUTO_WRITE);
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -130,7 +130,7 @@ bool Foam::ensightOutput::writeCloudField
// Handle this by READ_IF_PRESENT instead.
IOobject fieldObj(io);
fieldObj.readOpt() = IOobject::READ_IF_PRESENT;
fieldObj.readOpt(IOobject::READ_IF_PRESENT);
IOField<Type> field(fieldObj);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -331,7 +331,7 @@ Foam::PDRblock::innerMesh(const IOobject& io) const
IOobject iomesh(io);
iomesh.writeOpt() = IOobject::AUTO_WRITE;
iomesh.writeOpt(IOobject::AUTO_WRITE);
auto meshPtr = autoPtr<polyMesh>::New
(

View File

@ -186,8 +186,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::makeMesh
// ~~~~~~~~~~~~~~~
//IOobject noReadIO(io);
//noReadIO.readOpt() = IOobject::NO_READ;
//noReadIO.writeOpt() = IOobject::AUTO_WRITE;
//noReadIO.readOpt(IOobject::NO_READ);
//noReadIO.writeOpt(IOobject::AUTO_WRITE);
newMeshPtr.reset
(
new Type

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -341,7 +341,7 @@ Foam::IOobject Foam::topoSet::findIOobject
if (!io.typeHeaderOk<topoSet>(false) && disallowGenericSets != 0)
{
DebugInfo<< "Setting no read for set " << name << endl;
io.readOpt() = IOobject::NO_READ;
io.readOpt(IOobject::NO_READ);
}
return io;
@ -389,10 +389,7 @@ Foam::topoSet::topoSet(const IOobject& obj, const word& wantedType)
(
readOpt() == IOobject::MUST_READ
|| readOpt() == IOobject::MUST_READ_IF_MODIFIED
|| (
readOpt() == IOobject::READ_IF_PRESENT
&& headerOk()
)
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
if (readStream(wantedType).good())
@ -420,10 +417,7 @@ Foam::topoSet::topoSet
(
readOpt() == IOobject::MUST_READ
|| readOpt() == IOobject::MUST_READ_IF_MODIFIED
|| (
readOpt() == IOobject::READ_IF_PRESENT
&& headerOk()
)
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
if (readStream(wantedType).good())

View File

@ -298,7 +298,7 @@ void variablesSet::renameTurbulenceField
if (!mesh.foundObject<VolFieldType>(baseName))
{
autoPtr<VolFieldType> baseCopy(new VolFieldType(baseField));
baseCopy().IOobject::writeOpt() = baseField.writeOpt();
baseCopy().IOobject::writeOpt(baseField.writeOpt());
baseCopy().rename(baseName);
regIOobject::store(baseCopy);
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -555,7 +555,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::voxelMeshSearch::makeMesh
//Info<< "Creating polyMesh" << endl;
IOobject polyIO(io);
polyIO.readOpt() = IOobject::NO_READ;
polyIO.readOpt(IOobject::NO_READ);
polyMesh mesh
(
//IOobject
@ -587,7 +587,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::voxelMeshSearch::makeMesh
io.name()
);
IOobject fvIO(io);
fvIO.readOpt() = IOobject::MUST_READ;
fvIO.readOpt(IOobject::MUST_READ);
return autoPtr<fvMesh>::New(fvIO);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2018 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -205,7 +206,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
),
K_(nullptr)
{
phi_.writeOpt() = IOobject::AUTO_WRITE;
phi_.writeOpt(IOobject::AUTO_WRITE);
correctKinematics();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2018 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -205,7 +205,7 @@ Foam::phaseSystem::phaseSystem
}
// Write phi
phi_.writeOpt() = IOobject::AUTO_WRITE;
phi_.writeOpt(IOobject::AUTO_WRITE);
// Blending methods
forAllConstIter(dictionary, subDict("blending"), iter)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -88,8 +88,8 @@ void Foam::Detail::MeshedSurfaceIOAllocator::setWriteOption
IOobject::writeOption wOpt
)
{
points_.writeOpt() = wOpt;
faces_.writeOpt() = wOpt;
points_.writeOpt(wOpt);
faces_.writeOpt(wOpt);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,9 +49,9 @@ void Foam::surfMesh::setInstance
void Foam::surfMesh::setWriteOption(IOobject::writeOption wOpt)
{
writeOpt() = wOpt;
writeOpt(wOpt);
Allocator::setWriteOption(wOpt);
surfZones_.writeOpt() = wOpt;
surfZones_.writeOpt(wOpt);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -111,7 +111,7 @@ Foam::TDACChemistryModel<ReactionThermo, ThermoType>::TDACChemistryModel
if (!header.typeHeaderOk<volScalarField>(true))
{
composition.setInactive(i);
this->Y()[i].writeOpt() = IOobject::NO_WRITE;
this->Y()[i].writeOpt(IOobject::NO_WRITE);
}
}
}
@ -883,7 +883,7 @@ Foam::scalar Foam::TDACChemistryModel<ReactionThermo, ThermoType>::solve
{
if (composition.active(i))
{
this->Y()[i].writeOpt() = IOobject::AUTO_WRITE;
this->Y()[i].writeOpt(IOobject::AUTO_WRITE);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd
Copyright (C) 2018-2021 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -246,7 +246,7 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
// Reset the MUST_READ flag
IOobject noReadHeader(IHeader);
noReadHeader.readOpt() = IOobject::NO_READ;
noReadHeader.readOpt(IOobject::NO_READ);
ILambda_.set
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,12 +72,12 @@ Foam::IOobject Foam::radiation::radiationModel::createIOobject
if (io.typeHeaderOk<IOdictionary>(true))
{
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
io.readOpt(IOobject::MUST_READ_IF_MODIFIED);
return io;
}
else
{
io.readOpt() = IOobject::NO_READ;
io.readOpt(IOobject::NO_READ);
return io;
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -139,7 +139,7 @@ void Foam::linearValveFvMesh::addZonesAndModifiers()
true // Attach-detach action
)
);
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
topoChanger_.writeOpt(IOobject::AUTO_WRITE);
// Write mesh
write();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -168,7 +168,7 @@ void Foam::mixerFvMesh::addZonesAndModifiers()
slidingInterface::INTEGRAL
)
);
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
topoChanger_.writeOpt(IOobject::AUTO_WRITE);
write();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 IH-Cantabria
Copyright (C) 2016-2017 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -294,7 +294,7 @@ Foam::waveModel::waveModel
bool Foam::waveModel::readDict(const dictionary& overrideDict)
{
readOpt() = IOobject::READ_IF_PRESENT;
readOpt(IOobject::READ_IF_PRESENT);
if (headerOk())
{
IOdictionary::regIOobject::read();