43 Foam::channelIndex::vectorComponentsNames_
45 { vector::components::X,
"x" },
47 { vector::components::Z,
"z" },
54 void Foam::channelIndex::walkOppositeFaces
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);
155 void Foam::channelIndex::calcLayeredRegions
157 const polyMesh&
mesh,
174 forAll(blockedFace, facei)
176 if (blockedFace[facei])
186 str <<
' ' << vertI+fp+1;
196 cellRegion_.reset(
new regionSplit(
mesh, blockedFace));
198 Info<<
"Detected " << cellRegion_().nRegions() <<
" layers." <<
nl <<
endl;
210 SortableList<scalar> sortComponent(regionCc.component(dir_));
212 sortMap_ = sortComponent.indices();
218 y_.setSize(cellRegion_().nRegions()/2);
225 Foam::channelIndex::channelIndex
227 const polyMesh&
mesh,
228 const dictionary&
dict 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);
273 Foam::channelIndex::channelIndex
275 const polyMesh&
mesh,
277 const bool symmetric,
281 symmetric_(symmetric),
285 calcLayeredRegions(
mesh, startFaces);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
void size(const label n)
Older name for setAddressableSize.
fileName path() const
Return path = rootPath/caseName. Same as TimePaths::path()
List< cell > cellList
List of cell.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Time & time() const
Return the top-level database.
label nFaces() const noexcept
Number of mesh faces.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static Map< Type > regionSum(const regionSplit ®ions, const Field< Type > &fld)
wordList patchNames(nPatches)
virtual const faceList & faces() const
Return raw faces.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
List< word > wordList
List of word.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
label nCells() const noexcept
Number of mesh cells.
PtrList< volScalarField > & Y
const polyBoundaryMesh & patches
messageStream Info
Information stream (stdout output on master, null elsewhere)
components
Component labeling enumeration.
List< label > labelList
A List of labels.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
List< bool > boolList
A List of bools.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())