43Foam::channelIndex::vectorComponentsNames_
45 { vector::components::X,
"x" },
46 { vector::components::Y,
"y" },
47 { vector::components::Z,
"z" },
54void Foam::channelIndex::walkOppositeFaces
57 const labelList& startFaces,
63 const label nBnd =
mesh.nBoundaryFaces();
65 DynamicList<label> frontFaces(startFaces);
68 label facei = frontFaces[i];
69 blockedFace[facei] =
true;
75 boolList isFrontBndFace(nBnd,
false);
78 label facei = frontFaces[i];
80 if (!
mesh.isInternalFace(facei))
82 isFrontBndFace[facei-
mesh.nInternalFaces()] =
true;
90 label facei =
mesh.nInternalFaces()+i;
91 if (isFrontBndFace[i] && !blockedFace[facei])
93 blockedFace[facei] =
true;
94 frontFaces.append(facei);
99 DynamicList<label> newFrontFaces(frontFaces.size());
103 label facei = frontFaces[i];
106 const cell& ownCell =
cells[
mesh.faceOwner()[facei]];
108 label oppositeFacei = ownCell.opposingFaceLabel(facei, faces);
110 if (oppositeFacei == -1)
113 <<
"Face:" << facei <<
" owner cell:" << ownCell
118 if (!blockedFace[oppositeFacei])
120 blockedFace[oppositeFacei] =
true;
121 newFrontFaces.append(oppositeFacei);
126 if (
mesh.isInternalFace(facei))
128 const cell& neiCell =
mesh.cells()[
mesh.faceNeighbour()[facei]];
130 label oppositeFacei = neiCell.opposingFaceLabel(facei, faces);
132 if (oppositeFacei == -1)
135 <<
"Face:" << facei <<
" neighbour cell:" << neiCell
140 if (!blockedFace[oppositeFacei])
142 blockedFace[oppositeFacei] =
true;
143 newFrontFaces.append(oppositeFacei);
149 frontFaces.transfer(newFrontFaces);
155void Foam::channelIndex::calcLayeredRegions
174 forAll(blockedFace, facei)
176 if (blockedFace[facei])
186 str <<
' ' << vertI+fp+1;
198 Info<<
"Detected " << cellRegion_().nRegions() <<
" layers." <<
nl <<
endl;
212 sortMap_ = sortComponent.indices();
218 y_.setSize(cellRegion_().nRegions()/2);
225Foam::channelIndex::channelIndex
231 symmetric_(
dict.
get<bool>(
"symmetric")),
232 dir_(vectorComponentsNames_.
get(
"component",
dict))
234 const polyBoundaryMesh&
patches =
mesh.boundaryMesh();
248 <<
". Valid patches are " <<
patches.name()
252 nFaces +=
patches[patchi].size();
264 startFaces[nFaces++] =
pp.start()+j;
269 calcLayeredRegions(
mesh, startFaces);
273Foam::channelIndex::channelIndex
275 const polyMesh&
mesh,
276 const labelList& startFaces,
277 const bool symmetric,
281 symmetric_(symmetric),
285 calcLayeredRegions(
mesh, startFaces);
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
A list that is sorted upon construction or when explicitly requested with the sort() method.
fileName path() const
The path for the case = rootPath/caseName.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A face is a list of labels corresponding to mesh vertices.
const Time & time() const
Return the top-level database.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
virtual const pointField & points() const
Return raw points.
const vectorField & cellCentres() const
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
List< word > wordList
List of word.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cell > cellList
List of cell.
errorManip< error > abort(error &err)
static Map< Type > regionSum(const regionSplit ®ions, const Field< Type > &fld)
List< bool > boolList
A List of bools.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.