2 // Check which region needs reference
3 needRef = boolList(mesh.regions().nRegions(), true);
5 forAll(U.boundaryField(), patchI)
7 // philipc - this used to set a reference on
8 // processors which did not have a patch that fixesValue
9 // so processor in the centre of the domain all had
10 // a referece set causing stress peaks and resulting
11 // in an incorrect solution
12 // so a quick fix is to not set a reference on regions
13 // with a processor boundary
14 //if (U.boundaryField()[patchI].fixesValue())
17 U.boundaryField()[patchI].fixesValue()
19 mesh.boundaryMesh()[patchI].type()
20 == processorPolyPatch::typeName
23 const unallocLabelList& curFaceCells =
24 mesh.boundary()[patchI].faceCells();
26 forAll(curFaceCells, fI)
28 needRef[mesh.regions()[curFaceCells[fI]]] = false;
33 // Find reference cell for each region
34 refCells = labelList(mesh.regions().nRegions(), -1);
36 forAll(refCells, regI)
38 refCells[regI] = findIndex(mesh.regions(), regI);
40 if (refCells[regI] == -1)
42 FatalErrorIn(args.executable())
43 << "Can't find reference cell for region: "
44 << regI << abort(FatalError);
49 labelHashSet deadCellsSet;
50 const labelList& regs = mesh.regions();
54 if (mesh.nCellsInRegion(regs[cellI]) < 0.01*mesh.nCells())
56 deadCellsSet.insert(cellI);
60 deadCells = deadCellsSet.toc();