Go to the documentation of this file.
74 neighbourFaces.
clear();
79 const label cellI = faceOwner[bfI];
87 const label edgeI = faceEdges(bfI, feI);
91 label nei = edgeFaces(edgeI, 0);
94 nei = edgeFaces(edgeI, 1);
97 if( faceOwner[nei] == cellI )
102 const cell& neiC =
cells[faceOwner[nei]];
103 bool sharedFace(
false);
108 if(
c[fI] == neiC[fJ] )
120 neighbourFaces.
append(nei);
125 template<
class labelListType>
129 const labelListType& elementInGroup,
144 std::map<label, LongList<labelPair> > exchangeData;
150 const label beI = it();
155 const cell&
c =
cells[faceOwner[edgeFaces(beI, 0)]];
157 bool validCell(
false);
160 const face&
f = faces[
c[fI]];
164 const edge fe =
f.faceEdge(eI);
168 (fe == edges[beI]) &&
169 (
mesh.faceIsInProcPatch(
c[fI]) >= 0)
184 const label groupI = elementInGroup[edgeFaces(beI, 0)];
189 const label lgI = localGroupLabel[groupI];
202 const cell&
c =
cells[faceOwner[edgeFaces(beI, 0)]];
207 bool validCell(
false);
210 const face&
f = faces[
c[fI]];
214 const edge fe =
f.faceEdge(eI);
218 (fe == edges[beI]) &&
219 (
mesh.faceIsInProcPatch(
c[fI]) >= 0)
234 const label groupI = elementInGroup[edgeFaces(beI, 0)];
264 const cell&
c =
mesh.cells()[faceOwner[bfI]];
266 const label start = boundaries[0].patchStart();
268 label nBndFaces(0), baseFace(-1), otherBase(-1), nQuads(0);
271 if( faces[
c[fI]].size() == 4 )
274 if( (
c[fI] - start) == bfI )
287 if( (nQuads + 2) !=
c.size() )
293 label nQuadsAttachedToBaseFace(0);
302 if( (faces[
c[fI]].size() == 4) && sEdge )
304 ++nQuadsAttachedToBaseFace;
308 if( otherBase != -1 )
318 ((nQuadsAttachedToBaseFace + 2) ==
c.size()) &&
335 Info <<
"Analysing mesh for bnd layer existence" <<
endl;
386 # pragma omp parallel for schedule(dynamic, 50)
390 const face& bf = bFaces[bfI];
392 bool allZMin(
true), allZMax(
true);
395 if( !zMinPoint[bf[pI]] )
397 if( !zMaxPoint[bf[pI]] )
401 if( allZMax ^ allZMin )
407 typedef std::map<label, DynList<label> > patchToLayerType;
408 patchToLayerType patchToLayer;
424 patchToLayerType::const_iterator it=patchToLayer.begin();
425 it!=patchToLayer.end();
433 if( layersAtPatch[i] < 0 )
456 Info <<
"0.2 No layer at boundary face " << bfI <<
endl;
469 const label nInternalFaces =
mesh.boundaries()[0].patchStart();
484 if(
c[fI] - nInternalFaces == bfI )
489 const face&
f = faces[
c[fI]];
494 const edge e =
f.faceEdge(eI);
506 faceEdges[fI][eI] =
pos;
512 if( (baseFace < 0) || ((
c.size() - faces[
c[baseFace]].
size()) != 2) )
518 const face& bf = faces[
c[baseFace]];
523 const label nextEdge = faceEdges[baseFace][pI];
524 const label prevEdge = faceEdges[baseFace][bf.rcIndex(pI)];
526 if( edgeFaces[nextEdge].size() != 2 || edgeFaces[prevEdge].size() != 2 )
533 label otherNextFace = edgeFaces[nextEdge][0];
534 if( otherNextFace == baseFace )
535 otherNextFace = edgeFaces[nextEdge][1];
538 label otherPrevFace = edgeFaces[prevEdge][0];
539 if( otherPrevFace == baseFace )
540 otherPrevFace = edgeFaces[prevEdge][1];
543 for(commonEdge=0;commonEdge<edges.
size();++commonEdge)
545 edgeFaces[commonEdge].contains(otherNextFace) &&
546 edgeFaces[commonEdge].contains(otherPrevFace)
550 if( commonEdge == edges.
size() )
557 if( edges[commonEdge].start() == bf[pI] )
559 hairEdges[pI] = edges[commonEdge];
563 hairEdges[pI] = edges[commonEdge].reverseEdge();
582 # pragma omp parallel if( bFaces.size() > 1000 )
588 # pragma omp for schedule(dynamic, 100)
600 const face& bf = bFaces[bfI];
607 if(
he.start() != bf[pI] )
610 "void detectBoundaryLayers::generateHairEdges()"
620 # pragma omp critical
644 # pragma omp parallel for schedule(dynamic, 50)
646 forAll(pHairEdges, pointI)
650 const label heI = pHairEdges(pointI, pheI);
655 const label heJ = pHairEdges(pointI, pheJ);
659 duplicateEdge[heJ] =
true;
667 if( !duplicateEdge[heI] )
const VRWGraph & boundaryPointEdges() const
const labelList & bp() const
void append(const T &e)
Append an element at the end of the list.
bool operator()(const label bfI) const
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
#define forAll(list, i)
Loop across all elements in list.
A List obtained as a section of another List.
word scalarToText(const scalar s)
convert the scalar value into text
void clear()
Clear the list, i.e. set next free to zero.
const cellList & cells() const
const VRWGraph & pointFaces() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const Type & first() const
Return first.
const VRWGraph & faceEdges() const
List< DynList< label > > layerAtPatch_
layer at a boundary patch
Ostream & endl(Ostream &os)
Add newline and flush stream.
label size() const
Size of the active part of the list.
const meshSurfaceEngine & surfaceEngine() const
return const reference to meshSurfaceEngine
const boolList & zMinPoints() const
const meshSurfacePartitioner & meshSurface_
Reference to the meshSurfacePartitioner.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
meshBndLayerNeighbourOperator(const meshSurfaceEngine &mse)
void setSize(const label)
Reset size of List.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
void addCellToSubset(const label, const label)
const faceList::subList & boundaryFaces() const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label groupMarking(labelListType &elementInGroup, const neiOp &neighbourCalculator, const filterOp &selector)
const bool is2DMesh_
is it a 2D mesh
const edgeLongList & hairEdges() const
return hair edges found in the detection process
void collectGroups(std::map< label, DynList< label > > &neiGroups, const labelListType &elementInGroup, const DynList< label > &localGroupLabel) const
const Map< label > & otherEdgeFaceAtProc() const
label addCellSubset(const word &)
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
void appendIfNotIn(const T &e)
void transfer(LongList< T, Offset > &)
transfer the list from another one without allocating it
const Type & second() const
Return second.
void setSize(const label)
Reset the number of rows.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
#define forAllRow(graph, rowI, index)
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
const boolList & zMaxPoints() const
void operator()(const label bfI, DynList< label > &neighbourFaces) const
VRWGraph hairEdgesAtBoundaryPoint_
hair edges at a boudary point
void generateHairEdges()
generate hair edges for all boundary points
const VRWGraph & edgeFaces() const
errorManip< error > abort(error &err)
const double e
Elementary charge.
edgeLongList hairEdges_
hair edges found in the mesh
const edgeList & edges() const
const labelList & boundaryFacePatches() const
void analyseLayers()
analyse layers to check their topology
label containsAtPosition(const T &e) const
const meshSurfaceEngine & mse_
virtual const faceList & faces() const
Return raw faces.
meshBndLayerSelectorOperator(const meshSurfaceEngine &mse)
void reverseAddressing(const label nRows, const GraphType &origGraph)
An ordered pair of two objects of type <T> with first() and second() elements.
label size() const
return the number of used elements
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
label size() const
Return the number of elements in the PtrList.
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
void clear()
Clear the graph.
void append(const label rowI, const label)
Append an element to the given row.
bool findHairsForFace(const label, DynList< edge > &hairEdges) const
provide hair edges in a cell above a boundary face
const dimensionedScalar c
Speed of light in a vacuum.
const meshSurfaceEngine & mse_
labelList layerAtBndFace_
information about the existing boundary layer at a boundary face
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
A cell is defined as a list of faces with extra functionality.
Pair< label > labelPair
Label pair.
const polyMeshGen & mesh() const
void clear()
Clear the list, i.e. set next free to zero.
bool shareAnEdge(const faceType1 &f1, const faceType2 &f2)
check if two faces share an edge
const cellListPMG & cells() const
void append(const T &e)
Append an element at the end of the list.
const labelList & faceOwners() const
dimensionedScalar pos(const dimensionedScalar &ds)