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())
16 U.boundaryField()[patchI].fixesValue()
18 mesh.boundaryMesh()[patchI].type()
19 == processorPolyPatch::typeName
22 const unallocLabelList& curFaceCells =
23 mesh.boundary()[patchI].faceCells();
25 forAll(curFaceCells, fI)
27 needRef[mesh.regions()[curFaceCells[fI]]] = false;
32 // Find reference cell for each region
33 refCells = labelList(mesh.regions().nRegions(), -1);
35 forAll(refCells, regI)
37 refCells[regI] = findIndex(mesh.regions(), regI);
39 if (refCells[regI] == -1)
41 FatalErrorIn(args.executable())
42 << "Can't find reference cell for region: "
43 << regI << abort(FatalError);
48 labelHashSet deadCellsSet;
49 const labelList& regs = mesh.regions();
53 if (mesh.nCellsInRegion(regs[cellI]) < 0.01*mesh.nCells())
55 deadCellsSet.insert(cellI);
59 deadCells = deadCellsSet.toc();