Commit 3a374bf3 authored by mattijs's avatar mattijs
Browse files

ENH: polyMesh: do not switch on auto-write. Fixes #1147.

parent c143c3a3
......@@ -16,6 +16,7 @@ if (args.found("dry-run") || args.found("dry-run-write"))
if (args.found("dry-run-write"))
{
// Using saWriteNow triggers function objects execute(), write()
meshPtr->setInstance(runTime.constant());
runTime.stopAt(Foam::Time::saWriteNow);
}
else
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -374,8 +374,8 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::AUTO_WRITE
IOobject::NO_READ,
io.writeOpt()
),
std::move(points)
),
......@@ -387,8 +387,8 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::AUTO_WRITE
IOobject::NO_READ,
io.writeOpt()
),
std::move(faces)
),
......@@ -400,8 +400,8 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::AUTO_WRITE
IOobject::NO_READ,
io.writeOpt()
),
std::move(owner)
),
......@@ -413,8 +413,8 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::AUTO_WRITE
IOobject::NO_READ,
io.writeOpt()
),
std::move(neighbour)
),
......@@ -427,8 +427,8 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::AUTO_WRITE
IOobject::NO_READ,
io.writeOpt()
),
*this,
polyPatchList()
......@@ -447,7 +447,7 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
*this,
......@@ -461,7 +461,7 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
*this,
......@@ -475,7 +475,7 @@ Foam::polyMesh::polyMesh
instance(),
meshSubDir,
*this,
io.readOpt(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
*this,
......@@ -526,7 +526,7 @@ Foam::polyMesh::polyMesh
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
io.writeOpt()
),
std::move(points)
),
......@@ -539,7 +539,7 @@ Foam::polyMesh::polyMesh
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
io.writeOpt()
),
std::move(faces)
),
......@@ -552,7 +552,7 @@ Foam::polyMesh::polyMesh
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
io.writeOpt()
),
0
),
......@@ -565,7 +565,7 @@ Foam::polyMesh::polyMesh
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
io.writeOpt()
),
0
),
......@@ -579,7 +579,7 @@ Foam::polyMesh::polyMesh
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
io.writeOpt()
),
*this,
0
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -399,7 +399,11 @@ public:
const fileName& facesInstance() const;
//- Set the instance for mesh files
void setInstance(const fileName&);
void setInstance
(
const fileName& instance,
const IOobject::writeOption wOpt = IOobject::AUTO_WRITE
);
// Access
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -29,40 +29,44 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::polyMesh::setInstance(const fileName& inst)
void Foam::polyMesh::setInstance
(
const fileName& inst,
const IOobject::writeOption wOpt
)
{
if (debug)
{
InfoInFunction << "Resetting file instance to " << inst << endl;
}
points_.writeOpt() = IOobject::AUTO_WRITE;
points_.writeOpt() = wOpt;
points_.instance() = inst;
faces_.writeOpt() = IOobject::AUTO_WRITE;
faces_.writeOpt() = wOpt;
faces_.instance() = inst;
owner_.writeOpt() = IOobject::AUTO_WRITE;
owner_.writeOpt() = wOpt;
owner_.instance() = inst;
neighbour_.writeOpt() = IOobject::AUTO_WRITE;
neighbour_.writeOpt() = wOpt;
neighbour_.instance() = inst;
boundary_.writeOpt() = IOobject::AUTO_WRITE;
boundary_.writeOpt() = wOpt;
boundary_.instance() = inst;
pointZones_.writeOpt() = IOobject::AUTO_WRITE;
pointZones_.writeOpt() = wOpt;
pointZones_.instance() = inst;
faceZones_.writeOpt() = IOobject::AUTO_WRITE;
faceZones_.writeOpt() = wOpt;
faceZones_.instance() = inst;
cellZones_.writeOpt() = IOobject::AUTO_WRITE;
cellZones_.writeOpt() = wOpt;
cellZones_.instance() = inst;
if (tetBasePtIsPtr_.valid())
{
tetBasePtIsPtr_->writeOpt() = IOobject::AUTO_WRITE;
tetBasePtIsPtr_->writeOpt() = wOpt;
tetBasePtIsPtr_->instance() = inst;
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -379,6 +379,10 @@ void Foam::singleCellFvMesh::agglomerateMesh
);
}
}
// Make sure we don't start dumping mesh every timestep (since
// resetPrimitives sets AUTO_WRITE)
setInstance(time().constant(), IOobject::NO_WRITE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment