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

@ -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);