42 Foam::channelIndex::vectorComponentsNames_
44 { vector::components::X,
"x" },
46 { vector::components::Z,
"z" },
53 void Foam::channelIndex::walkOppositeFaces
62 const label nBnd =
mesh.nBoundaryFaces();
64 DynamicList<label> frontFaces(startFaces);
67 label facei = frontFaces[i];
68 blockedFace[facei] =
true;
71 while (
returnReduce(frontFaces.size(), sumOp<label>()) > 0)
74 boolList isFrontBndFace(nBnd,
false);
77 label facei = frontFaces[i];
79 if (!
mesh.isInternalFace(facei))
81 isFrontBndFace[facei-
mesh.nInternalFaces()] =
true;
89 label facei =
mesh.nInternalFaces()+i;
90 if (isFrontBndFace[i] && !blockedFace[facei])
92 blockedFace[facei] =
true;
93 frontFaces.append(facei);
98 DynamicList<label> newFrontFaces(frontFaces.size());
102 label facei = frontFaces[i];
105 const cell& ownCell =
cells[
mesh.faceOwner()[facei]];
107 label oppositeFacei = ownCell.opposingFaceLabel(facei, faces);
109 if (oppositeFacei == -1)
112 <<
"Face:" << facei <<
" owner cell:" << ownCell
117 if (!blockedFace[oppositeFacei])
119 blockedFace[oppositeFacei] =
true;
120 newFrontFaces.append(oppositeFacei);
125 if (
mesh.isInternalFace(facei))
127 const cell& neiCell =
mesh.cells()[
mesh.faceNeighbour()[facei]];
129 label oppositeFacei = neiCell.opposingFaceLabel(facei, faces);
131 if (oppositeFacei == -1)
134 <<
"Face:" << facei <<
" neighbour cell:" << neiCell
139 if (!blockedFace[oppositeFacei])
141 blockedFace[oppositeFacei] =
true;
142 newFrontFaces.append(oppositeFacei);
148 frontFaces.transfer(newFrontFaces);
154 void Foam::channelIndex::calcLayeredRegions
156 const polyMesh&
mesh,
173 forAll(blockedFace, facei)
175 if (blockedFace[facei])
185 str <<
' ' << vertI+fp+1;
195 cellRegion_.reset(
new regionSplit(
mesh, blockedFace));
197 Info<<
"Detected " << cellRegion_().nRegions() <<
" layers." <<
nl <<
endl;
209 SortableList<scalar> sortComponent(regionCc.component(dir_));
211 sortMap_ = sortComponent.indices();
217 y_.setSize(cellRegion_().nRegions()/2);
224 Foam::channelIndex::channelIndex
226 const polyMesh&
mesh,
227 const dictionary&
dict
231 dir_(vectorComponentsNames_.
get(
"component",
dict))
233 const polyBoundaryMesh&
patches =
mesh.boundaryMesh();
247 <<
". Valid patches are " <<
patches.name()
251 nFaces +=
patches[patchi].size();
263 startFaces[nFaces++] = pp.start()+j;
268 calcLayeredRegions(
mesh, startFaces);
272 Foam::channelIndex::channelIndex
274 const polyMesh&
mesh,
276 const bool symmetric,
280 symmetric_(symmetric),
284 calcLayeredRegions(
mesh, startFaces);