Go to the documentation of this file.
31 #include "triSurface.H"
55 Info <<
"Decomposing problematic faces" <<
endl;
72 if( facePatches[edgeFaces(beI, 0)] != facePatches[edgeFaces(beI, 1)] )
73 featureBndEdge[beI] =
true;
86 const label beI = it();
90 if( facePatches[edgeFaces(beI, 0)] != otherProcPatch[beI] )
91 featureBndEdge[beI] =
true;
95 std::map<label, labelLongList> exchangeData;
106 const label beI = it();
108 if( featureBndEdge[beI] )
112 const label procI = beAtProcs(beI, i);
116 exchangeData[procI].append(it.key());
125 while( counter < receivedData.
size() )
127 featureBndEdge[globalToLocalEdge[receivedData[counter++]]] =
true;
137 label nDecomposedFaces(0);
140 const label nIntFaces =
mesh.nInternalFaces();
142 # pragma omp parallel for schedule(guided) reduction(+ : nDecomposedFaces)
144 for(
label faceI=0;faceI<nIntFaces;++faceI)
146 const face&
f = faces[faceI];
148 label nFeatureEdges(0);
152 const edge e =
f.faceEdge(eI);
154 const label bs = bp[
e[0]];
155 const label be = bp[
e[1]];
156 if( (bs != -1) && (be != -1) )
161 const label beI = pointEdges(bs, i);
163 if( (edges[beI] ==
e) && featureBndEdge[beI] )
169 if( nFeatureEdges > 1 )
172 decomposeFace[faceI] =
true;
181 # pragma omp parallel for schedule(guided) reduction(+ : nDecomposedFaces)
188 if( featureBndEdge[faceEdges(bfI, feI)] )
189 featureEdge[feI] =
true;
194 decomposeFace[nIntFaces+bfI] =
true;
203 mesh.procBoundaries();
205 forAll(procBoundaries, patchI)
207 const label start = procBoundaries[patchI].patchStart();
208 const label end = start + procBoundaries[patchI].patchSize();
211 # pragma omp parallel for schedule(guided) \
212 reduction(+ : nDecomposedFaces)
214 for(
label faceI=start;faceI<end;++faceI)
216 const face&
f = faces[faceI];
218 label nFeatureEdges(0);
222 const edge e =
f.faceEdge(eI);
224 const label bs = bp[
e[0]];
225 const label be = bp[
e[1]];
226 if( (bs != -1) && (be != -1) )
232 const label beI = pointEdges(bs, i);
234 if( (edges[beI] ==
e) && featureBndEdge[beI] )
240 if( nFeatureEdges > 1 )
243 decomposeFace[faceI] =
true;
252 if( nDecomposedFaces != 0 )
254 Info << nDecomposedFaces <<
" faces decomposed into triangles" <<
endl;
264 Info <<
"Finished decomposing problematic faces" <<
endl;
291 # pragma omp parallel for schedule(dynamic, 100)
298 edgeInPatch[eI] = facePatch[edgeFaces(eI, 0)];
303 if( edgeType[eI] & problematicTypes)
305 const edge&
e = edges[eI];
307 concavePoint[bp[
e.start()]] =
true;
308 concavePoint[bp[
e.end()]] =
true;
318 std::map<label, labelLongList> exchangeData;
324 const label beI = it();
326 if( edgeInPatch[beI] < 0 )
331 const label neiProc = beAtProcs(beI, i);
339 dts.
append(edgeInPatch[beI]);
348 const label beI = globalToLocal[receivedData[i++]];
349 const label patchI = receivedData[i++];
350 if( edgeInPatch[beI] == -1 )
352 edgeInPatch[beI] = patchI;
354 else if( edgeInPatch[beI] != patchI )
358 "void correctEdgesBetweenPatches::decomposeConcaveFaces()"
371 label nDecomposed(0);
374 # pragma omp parallel for schedule(dynamic, 100) \
375 reduction(+ : nDecomposed)
379 const face&
f = faces[faceI];
381 bool hasConcave(
false);
387 const label bpI = bp[
f[pI]];
392 if( concavePoint[bpI] )
397 const edge e =
f.faceEdge(pI);
401 const label beI = bpEdges(bpI, bpeI);
402 const edge& ee = edges[beI];
413 if( hasConcave && (nBndEdges > 1) && (bndEdgePatches.
size() > 1) )
417 decomposeFace[faceI] =
true;
429 Info <<
"Decomposing " << nDecomposed <<
" internal faces" <<
endl;
441 Info <<
"Performing patch correction" <<
endl;
461 nodeType[it.key()] |= 1;
466 nodeType[it.key()] |= 2;
472 # pragma omp parallel for schedule(guided)
479 if( facePatches[edgeFaces(eI, 0)] != facePatches[edgeFaces(eI, 1)] )
480 featureEdge[eI] =
true;
489 if( facePatches[edgeFaces(it.key(), 0)] != it() )
490 featureEdge[it.key()] =
true;
499 label nDecomposedFaces(0);
502 const face& bf = bFaces[bfI];
510 featureEdge[faceEdges(bfI, i)] &&
511 featureEdge[faceEdges(bfI, bf.rcIndex(i))]
538 else if( bf.
size() == 4 )
549 triF[2] = bf[(i+2)%4];
554 triF[1] = bf[(i+2)%4];
583 Info <<
"Finished with patch correction" <<
endl;
const VRWGraph & boundaryPointEdges() const
const labelList & neighbour() const
const VRWGraph & beAtProcs() const
processors which contain the edges
const labelList & owner() const
owner and neighbour cells for faces
void decomposeProblematicFaces()
const labelList & bp() const
VRWGraph newBoundaryFaces_
void append(const T &e)
Append an element at the end of the list.
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define forAll(list, i)
Loop across all elements in list.
Template functions to aid in the implementation of demand driven data.
A List obtained as a section of another List.
void clear()
Clear the list, i.e. set next free to zero.
static bool & parRun()
Is this a parallel run?
point centre(const pointField &) const
Centre point of face.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const labelList & boundaryFacePatches() const
patch label for each boundary face
const VRWGraph & faceEdges() const
Ostream & endl(Ostream &os)
Add newline and flush stream.
const pointFieldPMG & points() const
access to points
const List< direction > & edgeTypes() const
return the information about classified edges
labelLongList newBoundaryPatches_
label size() const
Size of the active part of the list.
boolList decomposeCell_
holds data which cells have to be decomposed
const faceListPMG & faces() const
access to faces
label nInternalFaces() const
return number of internal faces
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
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.
void clearMeshSurface()
delete mesh surface
void decomposeConcaveFaces()
decompose cells with faces at concave boundary edges
void clearAddressingData() const
clear addressing data
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
label size() const
Returns the number of rows.
void appendIfNotIn(const T &e)
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 size() const
return the number of used elements
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
bool areElementsInChain(const boolListType &sel)
check if selected elements are in one singly-connected chain
const VRWGraph & edgeFaces() const
errorManip< error > abort(error &err)
void append(const point &)
add a point at the end of the list
const double e
Elementary charge.
void decomposeMeshFaces(const boolList &decomposeFace)
decompose selected faces into triangles using midnode subdivision
const edgeList & edges() const
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
const meshSurfaceEngine & meshSurface() const
construct and return mesh surface
label prevLabel(const label i) const
Previous vertex on face.
const labelHashSet & edgePoints() const
return labels of edge points (from the list of boundary points)
label nextLabel(const label i) const
Next vertex on face.
void replaceBoundary()
replace boundary
label size() const
return the number of used elements
void appendList(const ListType &l)
Append a list as a row at the end of the graph.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
labelLongList newBoundaryOwners_
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
void clear()
Clear the graph.
const labelList & boundaryPoints() const
#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.
const Map< label > & otherEdgeFacePatch() const
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
void patchCorrection()
perform decompose remaining faces having more than one feature edge
const polyMeshGen & mesh() const
const labelList & faceOwners() const