ENH: Writing cellCentres to polyMesh dir and optional reading.

This commit is contained in:
graham
2010-10-14 18:02:22 +01:00
parent d0ab427bb3
commit df58543799
4 changed files with 15 additions and 11 deletions

View File

@ -96,16 +96,20 @@ int main(int argc, char *argv[])
IOobject IOobject
( (
"cellCentres", "cellCentres",
runTime.constant(), mesh.pointsInstance(),
polyMesh::meshSubDir,
runTime, runTime,
IOobject::MUST_READ, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
if (overrideCCs.headerOk())
{
Info<< "Read " << overrideCCs.size() << " cell centres" << endl; Info<< "Read " << overrideCCs.size() << " cell centres" << endl;
mesh.overrideCellCentres(overrideCCs); mesh.overrideCellCentres(overrideCCs);
}
// Reconstruct globalMeshData // Reconstruct globalMeshData
mesh.globalData(); mesh.globalData();

View File

@ -167,7 +167,7 @@ Foam::label Foam::checkTopology
if (nOneCells > 0) if (nOneCells > 0)
{ {
Info<< " <<Writing " << nOneCells Info<< " <<Writing " << nOneCells
<< " cells with with single non-boundary face to set " << " cells with with zero or one non-boundary face to set "
<< oneCells.name() << oneCells.name()
<< endl; << endl;
oneCells.instance() = mesh.pointsInstance(); oneCells.instance() = mesh.pointsInstance();
@ -179,7 +179,7 @@ Foam::label Foam::checkTopology
if (nTwoCells > 0) if (nTwoCells > 0)
{ {
Info<< " <<Writing " << nTwoCells Info<< " <<Writing " << nTwoCells
<< " cells with with single non-boundary face to set " << " cells with with two non-boundary faces to set "
<< twoCells.name() << twoCells.name()
<< endl; << endl;
twoCells.instance() = mesh.pointsInstance(); twoCells.instance() = mesh.pointsInstance();

View File

@ -96,14 +96,13 @@ void Foam::conformalVoronoiMesh::calcDualMesh
indexDualVertices(points, boundaryPts); indexDualVertices(points, boundaryPts);
{ {
// No-risk face filtering to get rid of zero area faces and // Ideally requires a no-risk face filtering to get rid of zero area
// establish if the mesh can be produced at all to the // faces and establish if the mesh can be produced at all to the
// specified criteria // specified criteria
Info<< nl << "Merging close points" << endl; Info<< nl << "Merging close points" << endl;
// There is no guarantee that a merge of close points is // There is no guarantee that a merge of close points is no-risk
// no-risk, but it seems to work using 1e-4 as the mergeClosenessCoeff
mergeCloseDualVertices(points, boundaryPts); mergeCloseDualVertices(points, boundaryPts);
} }

View File

@ -275,7 +275,8 @@ void Foam::conformalVoronoiMesh::writeMesh
IOobject IOobject
( (
"cellCentres", "cellCentres",
instance, mesh.pointsInstance(),
fvMesh::meshSubDir,
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE