Added I/O control

This commit is contained in:
Hrvoje Jasak 2011-02-17 20:25:55 +00:00
parent b41a24d8d2
commit 86eab93fa1
3 changed files with 46 additions and 19 deletions

View file

@ -68,7 +68,8 @@ void Foam::polyMesh::calcDirections() const
if (isA<emptyPolyPatch>(boundaryMesh()[patchi])) if (isA<emptyPolyPatch>(boundaryMesh()[patchi]))
{ {
nEmptyPatches++; nEmptyPatches++;
emptyDirVec += sum(cmptMag(boundaryMesh()[patchi].faceAreas())); emptyDirVec +=
sum(cmptMag(boundaryMesh()[patchi].faceAreas()));
} }
else if (isA<wedgePolyPatch>(boundaryMesh()[patchi])) else if (isA<wedgePolyPatch>(boundaryMesh()[patchi]))
{ {
@ -339,7 +340,7 @@ Foam::polyMesh::polyMesh
), ),
points points
), ),
// To be re-sliced later. HJ, 19/oct/2008 // To be re-sliced later. HJ, 19/Oct/2008
points_(allPoints_, allPoints_.size()), points_(allPoints_, allPoints_.size()),
allFaces_ allFaces_
( (
@ -354,7 +355,7 @@ Foam::polyMesh::polyMesh
), ),
faces faces
), ),
// To be re-sliced later. HJ, 19/oct/2008 // To be re-sliced later. HJ, 19/Oct/2008
faces_(allFaces_, allFaces_.size()), faces_(allFaces_, allFaces_.size()),
owner_ owner_
( (
@ -500,7 +501,7 @@ Foam::polyMesh::polyMesh
), ),
points points
), ),
// To be re-sliced later. HJ, 19/oct/2008 // To be re-sliced later. HJ, 19/Oct/2008
points_(allPoints_, allPoints_.size()), points_(allPoints_, allPoints_.size()),
allFaces_ allFaces_
( (

View file

@ -293,6 +293,13 @@ public:
void setInstance(const fileName&); void setInstance(const fileName&);
//- Set motion write option
void setMotionWriteOpt(IOobject::writeOption);
//- Set topological write option
void setTopoWriteOpt(IOobject::writeOption);
// Access // Access
//- Return all points, including inactive ones //- Return all points, including inactive ones

View file

@ -40,29 +40,48 @@ void Foam::polyMesh::setInstance(const fileName& inst)
<< "Resetting file instance to " << inst << endl; << "Resetting file instance to " << inst << endl;
} }
allPoints_.writeOpt() = IOobject::AUTO_WRITE;
allPoints_.instance() = inst; allPoints_.instance() = inst;
allFaces_.writeOpt() = IOobject::AUTO_WRITE;
allFaces_.instance() = inst; allFaces_.instance() = inst;
owner_.writeOpt() = IOobject::AUTO_WRITE;
owner_.instance() = inst; owner_.instance() = inst;
neighbour_.writeOpt() = IOobject::AUTO_WRITE;
neighbour_.instance() = inst; neighbour_.instance() = inst;
boundary_.writeOpt() = IOobject::AUTO_WRITE;
boundary_.instance() = inst; boundary_.instance() = inst;
pointZones_.writeOpt() = IOobject::AUTO_WRITE;
pointZones_.instance() = inst; pointZones_.instance() = inst;
faceZones_.writeOpt() = IOobject::AUTO_WRITE;
faceZones_.instance() = inst; faceZones_.instance() = inst;
cellZones_.writeOpt() = IOobject::AUTO_WRITE;
cellZones_.instance() = inst; 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;
} }