diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 375922d43..10e04d493 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -68,7 +68,8 @@ void Foam::polyMesh::calcDirections() const if (isA(boundaryMesh()[patchi])) { nEmptyPatches++; - emptyDirVec += sum(cmptMag(boundaryMesh()[patchi].faceAreas())); + emptyDirVec += + sum(cmptMag(boundaryMesh()[patchi].faceAreas())); } else if (isA(boundaryMesh()[patchi])) { @@ -339,7 +340,7 @@ Foam::polyMesh::polyMesh ), points ), - // To be re-sliced later. HJ, 19/oct/2008 + // To be re-sliced later. HJ, 19/Oct/2008 points_(allPoints_, allPoints_.size()), allFaces_ ( @@ -354,7 +355,7 @@ Foam::polyMesh::polyMesh ), faces ), - // To be re-sliced later. HJ, 19/oct/2008 + // To be re-sliced later. HJ, 19/Oct/2008 faces_(allFaces_, allFaces_.size()), owner_ ( @@ -500,7 +501,7 @@ Foam::polyMesh::polyMesh ), points ), - // To be re-sliced later. HJ, 19/oct/2008 + // To be re-sliced later. HJ, 19/Oct/2008 points_(allPoints_, allPoints_.size()), allFaces_ ( diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index a411696cc..4b4226aac 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -293,6 +293,13 @@ public: void setInstance(const fileName&); + //- Set motion write option + void setMotionWriteOpt(IOobject::writeOption); + + //- Set topological write option + void setTopoWriteOpt(IOobject::writeOption); + + // Access //- Return all points, including inactive ones diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index 07dbd3f35..306aea267 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -40,29 +40,48 @@ void Foam::polyMesh::setInstance(const fileName& inst) << "Resetting file instance to " << inst << endl; } - allPoints_.writeOpt() = IOobject::AUTO_WRITE; allPoints_.instance() = inst; - - allFaces_.writeOpt() = IOobject::AUTO_WRITE; allFaces_.instance() = inst; - - owner_.writeOpt() = IOobject::AUTO_WRITE; owner_.instance() = inst; - - neighbour_.writeOpt() = IOobject::AUTO_WRITE; neighbour_.instance() = inst; - - boundary_.writeOpt() = IOobject::AUTO_WRITE; boundary_.instance() = inst; - - pointZones_.writeOpt() = IOobject::AUTO_WRITE; pointZones_.instance() = inst; - - faceZones_.writeOpt() = IOobject::AUTO_WRITE; faceZones_.instance() = inst; - - cellZones_.writeOpt() = IOobject::AUTO_WRITE; cellZones_.instance() = inst; + + setMotionWriteOpt(IOobject::AUTO_WRITE); + setTopoWriteOpt(IOobject::AUTO_WRITE); +} + +void Foam::polyMesh::setMotionWriteOpt(IOobject::writeOption wOpt) +{ + if (debug) + { + Info<< "void polyMesh::setMotionWriteOpt(IOobject::writeOption) " + << "Setting motion writeOpt to " << wOpt << endl; + } + + allPoints_.writeOpt() = wOpt; +} + + +void Foam::polyMesh::setTopoWriteOpt(IOobject::writeOption wOpt) +{ + if (debug) + { + Info<< "void polyMesh::setTopoWriteOpt(IOobject::writeOption) " + << "Setting topo writeOpt to " << wOpt << endl; + } + + allFaces_.writeOpt() = wOpt; + owner_.writeOpt() = wOpt; + neighbour_.writeOpt() = wOpt; + boundary_.writeOpt() = wOpt; + + pointZones_.writeOpt() = wOpt; + faceZones_.writeOpt() = wOpt; + cellZones_.writeOpt() = wOpt; + }