42Foam::channelIndex::vectorComponentsNames_
44 { vector::components::X,
"x" },
45 { vector::components::Y,
"y" },
46 { vector::components::Z,
"z" },
53void Foam::channelIndex::walkOppositeFaces
56 const labelList& startFaces,
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];
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];
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);
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);
154void 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);
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()
263 startFaces[
nFaces++] = pp.start()+j;
268 calcLayeredRegions(
mesh, startFaces);
274 const polyMesh&
mesh,
275 const labelList& startFaces,
276 const bool symmetric,
280 symmetric_(symmetric),
284 calcLayeredRegions(
mesh, startFaces);
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
fileName path() const
Return path.
void size(const label n)
Older name for setAddressableSize.
components
Component labeling enumeration.
Does averaging of fields over layers of cells. Assumes layered mesh.
const Time & time() const
Return the top-level database.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
label nInternalFaces() const noexcept
Number of internal faces.
const vectorField & cellCentres() const
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
const cellList & cells() const
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
List< cell > cellList
A List of cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static Map< Type > regionSum(const regionSplit ®ions, const Field< Type > &fld)
List< bool > boolList
A List of bools.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
List< face > faceList
A List of faces.
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.