Skip to content
Snippets Groups Projects
Commit c1dc097c authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

Cells in multiple cellZones not flagged.

parent 3e276561
No related branches found
No related tags found
No related merge requests found
...@@ -1081,13 +1081,14 @@ label findCorrespondingZone ...@@ -1081,13 +1081,14 @@ label findCorrespondingZone
// Determine same zone over all processors. // Determine same zone over all processors.
reduce(zoneI, maxOp<label>()); reduce(zoneI, maxOp<label>());
// 2. All of cellZone present?
if (zoneI == labelMax) if (zoneI == labelMax)
{ {
zoneI = -1; zoneI = -1;
} }
else if (zoneI != -1)
// 2. All of cellZone present?
if (zoneI != -1)
{ {
const cellZone& cz = cellZones[zoneI]; const cellZone& cz = cellZones[zoneI];
...@@ -1095,10 +1096,13 @@ label findCorrespondingZone ...@@ -1095,10 +1096,13 @@ label findCorrespondingZone
{ {
if (cellRegion[cz[i]] != regionI) if (cellRegion[cz[i]] != regionI)
{ {
zoneI = labelMax; zoneI = -1;
break; break;
} }
} }
// If one in error, all should be in error. Note that branch gets taken
// on all procs.
reduce(zoneI, minOp<label>());
} }
return zoneI; return zoneI;
...@@ -1144,12 +1148,36 @@ int main(int argc, char *argv[]) ...@@ -1144,12 +1148,36 @@ int main(int argc, char *argv[])
const cellZoneMesh& cellZones = mesh.cellZones(); const cellZoneMesh& cellZones = mesh.cellZones();
// Collect zone per cell
// ~~~~~~~~~~~~~~~~~~~~~
// - non-unique zoning
// - coupled zones
// Existing zoneID // Existing zoneID
labelList zoneID(mesh.nCells(), -1); labelList zoneID(mesh.nCells(), -1);
forAll(cellZones, zoneI) forAll(cellZones, zoneI)
{ {
setValues(zoneID, cellZones[zoneI], zoneI); const cellZone& cz = cellZones[zoneI];
forAll(cz, i)
{
label cellI = cz[i];
if (zoneID[cellI] == -1)
{
zoneID[cellI] = zoneI;
}
else
{
FatalErrorIn(args.executable())
<< "Cell " << cellI << " with cell centre "
<< mesh.cellCentres()[cellI]
<< " is multiple zones. This is not allowed." << endl
<< "It is in zone " << cellZones[zoneID[cellI]].name()
<< " and in zone " << cellZones[zoneI].name()
<< exit(FatalError);
}
}
} }
// Neighbour zoneID. // Neighbour zoneID.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment