mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: renumberMesh: Checking for cellProcAddressing after deleting it.
This is part of #340.
This commit is contained in:
@ -778,7 +778,8 @@ int main(int argc, char *argv[])
|
|||||||
mesh.facesInstance(),
|
mesh.facesInstance(),
|
||||||
polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
labelList(0)
|
labelList(0)
|
||||||
);
|
);
|
||||||
@ -791,7 +792,8 @@ int main(int argc, char *argv[])
|
|||||||
mesh.facesInstance(),
|
mesh.facesInstance(),
|
||||||
polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
labelList(0)
|
labelList(0)
|
||||||
);
|
);
|
||||||
@ -803,7 +805,8 @@ int main(int argc, char *argv[])
|
|||||||
mesh.pointsInstance(),
|
mesh.pointsInstance(),
|
||||||
polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
labelList(0)
|
labelList(0)
|
||||||
);
|
);
|
||||||
@ -815,7 +818,8 @@ int main(int argc, char *argv[])
|
|||||||
mesh.pointsInstance(),
|
mesh.pointsInstance(),
|
||||||
polyMesh::meshSubDir,
|
polyMesh::meshSubDir,
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::READ_IF_PRESENT
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
labelList(0)
|
labelList(0)
|
||||||
);
|
);
|
||||||
@ -1088,11 +1092,9 @@ int main(int argc, char *argv[])
|
|||||||
mesh.updateMesh(map);
|
mesh.updateMesh(map);
|
||||||
|
|
||||||
// Update proc maps
|
// Update proc maps
|
||||||
if
|
if (cellProcAddressing.headerOk())
|
||||||
(
|
{
|
||||||
cellProcAddressing.headerOk()
|
if (cellProcAddressing.size() == mesh.nCells())
|
||||||
&& cellProcAddressing.size() == mesh.nCells()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Info<< "Renumbering processor cell decomposition map "
|
Info<< "Renumbering processor cell decomposition map "
|
||||||
<< cellProcAddressing.name() << endl;
|
<< cellProcAddressing.name() << endl;
|
||||||
@ -1102,11 +1104,16 @@ int main(int argc, char *argv[])
|
|||||||
UIndirectList<label>(cellProcAddressing, map().cellMap())
|
UIndirectList<label>(cellProcAddressing, map().cellMap())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if
|
else
|
||||||
(
|
{
|
||||||
faceProcAddressing.headerOk()
|
Info<< "Not writing inconsistent processor cell decomposition"
|
||||||
&& faceProcAddressing.size() == mesh.nFaces()
|
<< " map " << cellProcAddressing.filePath() << endl;
|
||||||
)
|
cellProcAddressing.writeOpt() = IOobject::NO_WRITE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (faceProcAddressing.headerOk())
|
||||||
|
{
|
||||||
|
if (faceProcAddressing.size() == mesh.nFaces())
|
||||||
{
|
{
|
||||||
Info<< "Renumbering processor face decomposition map "
|
Info<< "Renumbering processor face decomposition map "
|
||||||
<< faceProcAddressing.name() << endl;
|
<< faceProcAddressing.name() << endl;
|
||||||
@ -1132,11 +1139,16 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if
|
else
|
||||||
(
|
{
|
||||||
pointProcAddressing.headerOk()
|
Info<< "Not writing inconsistent processor face decomposition"
|
||||||
&& pointProcAddressing.size() == mesh.nPoints()
|
<< " map " << faceProcAddressing.filePath() << endl;
|
||||||
)
|
faceProcAddressing.writeOpt() = IOobject::NO_WRITE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pointProcAddressing.headerOk())
|
||||||
|
{
|
||||||
|
if (pointProcAddressing.size() == mesh.nPoints())
|
||||||
{
|
{
|
||||||
Info<< "Renumbering processor point decomposition map "
|
Info<< "Renumbering processor point decomposition map "
|
||||||
<< pointProcAddressing.name() << endl;
|
<< pointProcAddressing.name() << endl;
|
||||||
@ -1146,6 +1158,22 @@ int main(int argc, char *argv[])
|
|||||||
UIndirectList<label>(pointProcAddressing, map().pointMap())
|
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;
|
Info<< "Writing mesh to " << mesh.facesInstance() << endl;
|
||||||
|
|
||||||
|
// Remove old procAddressing files
|
||||||
processorMeshes::removeFiles(mesh);
|
processorMeshes::removeFiles(mesh);
|
||||||
|
// Remove refinement data
|
||||||
hexRef8::removeFiles(mesh);
|
hexRef8::removeFiles(mesh);
|
||||||
|
// Update sets
|
||||||
topoSet::updateMesh(mesh.facesInstance(), map(), cellSets);
|
topoSet::updateMesh(mesh.facesInstance(), map(), cellSets);
|
||||||
topoSet::updateMesh(mesh.facesInstance(), map(), faceSets);
|
topoSet::updateMesh(mesh.facesInstance(), map(), faceSets);
|
||||||
topoSet::updateMesh(mesh.facesInstance(), map(), pointSets);
|
topoSet::updateMesh(mesh.facesInstance(), map(), pointSets);
|
||||||
|
|
||||||
mesh.write();
|
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)
|
if (writeMaps)
|
||||||
{
|
{
|
||||||
// For debugging: write out region
|
// For debugging: write out region
|
||||||
|
|||||||
Reference in New Issue
Block a user