BUG: renumberMesh: Checking for cellProcAddressing after deleting it.

This is part of #340.
This commit is contained in:
mattijs
2016-12-14 17:21:56 +00:00
parent a3ef5cd137
commit 4f4b1d76c4

View File

@ -778,7 +778,8 @@ int main(int argc, char *argv[])
mesh.facesInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
labelList(0)
);
@ -791,7 +792,8 @@ int main(int argc, char *argv[])
mesh.facesInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
labelList(0)
);
@ -803,7 +805,8 @@ int main(int argc, char *argv[])
mesh.pointsInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
labelList(0)
);
@ -815,7 +818,8 @@ int main(int argc, char *argv[])
mesh.pointsInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
labelList(0)
);
@ -1088,11 +1092,9 @@ int main(int argc, char *argv[])
mesh.updateMesh(map);
// Update proc maps
if
(
cellProcAddressing.headerOk()
&& cellProcAddressing.size() == mesh.nCells()
)
if (cellProcAddressing.headerOk())
{
if (cellProcAddressing.size() == mesh.nCells())
{
Info<< "Renumbering processor cell decomposition map "
<< cellProcAddressing.name() << endl;
@ -1102,11 +1104,16 @@ int main(int argc, char *argv[])
UIndirectList<label>(cellProcAddressing, map().cellMap())
);
}
if
(
faceProcAddressing.headerOk()
&& faceProcAddressing.size() == mesh.nFaces()
)
else
{
Info<< "Not writing inconsistent processor cell decomposition"
<< " map " << cellProcAddressing.filePath() << endl;
cellProcAddressing.writeOpt() = IOobject::NO_WRITE;
}
}
if (faceProcAddressing.headerOk())
{
if (faceProcAddressing.size() == mesh.nFaces())
{
Info<< "Renumbering processor face decomposition map "
<< faceProcAddressing.name() << endl;
@ -1132,11 +1139,16 @@ int main(int argc, char *argv[])
}
}
}
if
(
pointProcAddressing.headerOk()
&& pointProcAddressing.size() == mesh.nPoints()
)
else
{
Info<< "Not writing inconsistent processor face decomposition"
<< " map " << faceProcAddressing.filePath() << endl;
faceProcAddressing.writeOpt() = IOobject::NO_WRITE;
}
}
if (pointProcAddressing.headerOk())
{
if (pointProcAddressing.size() == mesh.nPoints())
{
Info<< "Renumbering processor point decomposition map "
<< pointProcAddressing.name() << endl;
@ -1146,6 +1158,22 @@ int main(int argc, char *argv[])
UIndirectList<label>(pointProcAddressing, map().pointMap())
);
}
else
{
Info<< "Not writing consistent processor point decomposition"
<< " map " << pointProcAddressing.filePath() << endl;
pointProcAddressing.writeOpt() = IOobject::NO_WRITE;
}
}
if (boundaryProcAddressing.headerOk())
{
if (boundaryProcAddressing.size() != mesh.boundaryMesh().size())
{
Info<< "Not writing consistent processor patch decomposition"
<< " map " << boundaryProcAddressing.filePath() << endl;
boundaryProcAddressing.writeOpt() = IOobject::NO_WRITE;
}
}
@ -1262,91 +1290,17 @@ int main(int argc, char *argv[])
Info<< "Writing mesh to " << mesh.facesInstance() << endl;
// Remove old procAddressing files
processorMeshes::removeFiles(mesh);
// Remove refinement data
hexRef8::removeFiles(mesh);
// Update sets
topoSet::updateMesh(mesh.facesInstance(), map(), cellSets);
topoSet::updateMesh(mesh.facesInstance(), map(), faceSets);
topoSet::updateMesh(mesh.facesInstance(), map(), pointSets);
mesh.write();
if (cellProcAddressing.headerOk())
{
cellProcAddressing.instance() = mesh.facesInstance();
if (cellProcAddressing.size() == mesh.nCells())
{
cellProcAddressing.write();
}
else
{
// procAddressing file no longer valid. Delete it.
const fileName fName(cellProcAddressing.filePath());
if (fName.size())
{
Info<< "Deleting inconsistent processor cell decomposition"
<< " map " << fName << endl;
rm(fName);
}
}
}
if (faceProcAddressing.headerOk())
{
faceProcAddressing.instance() = mesh.facesInstance();
if (faceProcAddressing.size() == mesh.nFaces())
{
faceProcAddressing.write();
}
else
{
const fileName fName(faceProcAddressing.filePath());
if (fName.size())
{
Info<< "Deleting inconsistent processor face decomposition"
<< " map " << fName << endl;
rm(fName);
}
}
}
if (pointProcAddressing.headerOk())
{
pointProcAddressing.instance() = mesh.facesInstance();
if (pointProcAddressing.size() == mesh.nPoints())
{
pointProcAddressing.write();
}
else
{
const fileName fName(pointProcAddressing.filePath());
if (fName.size())
{
Info<< "Deleting inconsistent processor point decomposition"
<< " map " << fName << endl;
rm(fName);
}
}
}
if (boundaryProcAddressing.headerOk())
{
boundaryProcAddressing.instance() = mesh.facesInstance();
if (boundaryProcAddressing.size() == mesh.boundaryMesh().size())
{
boundaryProcAddressing.write();
}
else
{
const fileName fName(boundaryProcAddressing.filePath());
if (fName.size())
{
Info<< "Deleting inconsistent processor patch decomposition"
<< " map " << fName << endl;
rm(fName);
}
}
}
if (writeMaps)
{
// For debugging: write out region