Go to the documentation of this file.
94 const label bpI = it.key();
108 if( commonPatches.
found(tpwp[pJ]) )
111 commonPatches.
insert(tpwp[pJ]);
112 allPatches.
append(tpwp[pJ]);
120 Info <<
"Corner " << bpI <<
" is shared by patches "
121 << pPatches[bpI] <<
endl;
122 Info <<
"All patches " << allPatches <<
endl;
135 std::map<std::pair<label, label>,
Pair<label> > edgeClassification;
142 const edge&
e = edges[eI];
146 (invertedVertices.
found(
e[0]) || invertedVertices.
found(
e[1]))
150 const label patch0 = boundaryFacePatches[eFaces(eI, 0)];
151 const label patch1 = boundaryFacePatches[eFaces(eI, 1)];
152 if( patch0 != patch1 )
154 std::pair<label, label> pp
159 if( edgeClassification.find(pp) == edgeClassification.end() )
160 edgeClassification.insert
165 const face&
f1 = bFaces[eFaces(eI, 0)];
166 const face& f2 = bFaces[eFaces(eI, 1)];
174 ++edgeClassification[pp].second();
178 ++edgeClassification[pp].
first();
202 std::map<label, LongList<labelledPoint> > exchangePoints;
205 exchangePoints.insert
214 const label beI = it.key();
219 const edge&
e = edges[beI];
224 (invertedVertices.
found(
e[0]) || invertedVertices.
found(
e[1]))
230 if( otherProcPatches[beI] == boundaryFacePatches[eFaces(beI, 0)] )
233 const face&
f = bFaces[eFaces(beI, 0)];
235 const label neiProc = it();
250 globalPointLabel[bp[
f[pI]]],
264 while( counter < receivedData.
size() )
267 globalToLocal[receivedData[counter++].pointLabel()];
274 if( globalPointToLocal.found(lp.
pointLabel()) )
277 f[pI] = bPoints[globalPointToLocal[lp.
pointLabel()]];
284 if( !transferredPointToLocal.found(lp.
pointLabel()) )
287 transferredPointToLocal.insert
299 const face& bf = bFaces[eFaces(beI, 0)];
301 const label patch0 = boundaryFacePatches[eFaces(beI, 0)];
302 const label patch1 = otherProcPatches[beI];
304 std::pair<label, label> pp
309 if( edgeClassification.find(pp) == edgeClassification.end() )
310 edgeClassification.insert
323 ++edgeClassification[pp].second();
327 ++edgeClassification[pp].first();
335 std::map<std::pair<label, label>,
Pair<label> >::const_iterator it;
336 for(it=edgeClassification.begin();it!=edgeClassification.end();++it)
338 const std::pair<label, label>& edgePair = it->
first;
341 if( nConvexAndConcave.
second() != 0 )
345 const label patch0 = edgePair.first;
346 const label patch1 = edgePair.second;
366 flattenedPatches.
append(patchI);
374 forAll(flattenedPatches, i)
379 forAll(procPatches, procI)
384 const labelList& cPatches = procPatches[procI];
387 while( counter < cPatches.
size() )
389 const label patchI = cPatches[counter++];
390 const label size = cPatches[counter++];
391 for(
label i=0;i<size;++i)
406 confirmed[patchI] =
true;
410 if( confirmed[patchI] )
413 std::set<label> commonPatches;
414 commonPatches.insert(patchI);
418 confirmed[patchI] =
true;
420 while( front.
size() )
428 if( confirmed[patchJ] )
432 confirmed[patchJ] =
true;
433 commonPatches.insert(patchJ);
441 const label patchJ = *it;
450 for(it=edgeClassification.begin();it!=edgeClassification.end();++it)
452 const std::pair<label, label>& edgePair = it->first;
454 Info <<
"Pair of patches " << edgePair.first <<
" "
455 << edgePair.second <<
" is " << nConvexAndConcave <<
endl;
461 label layerI(0), subsetId;
467 if( usedPatch[patchI] || (boundaries[patchI].patchSize() == 0) )
470 Info <<
"Adding layer subset " << layerI
471 <<
" for patch " << patchI <<
endl;
472 usedPatch[patchI] =
true;
479 usedPatch[cPatch] =
true;
481 label start = boundaries[cPatch].patchStart();
482 const label size = boundaries[cPatch].patchSize();
483 for(
label i=0;i<size;++i)
514 treatPatches[patchI] =
true;
526 forAll(treatPatches, patchI)
527 if( treatPatches[patchI] )
541 meshPartitionerPtr_(NULL),
542 patchWiseLayers_(
true),
543 terminateLayersAtConcaveEdges_(
false),
548 treatPatchesWithPatch_(),
549 newLabelForVertex_(),
553 geometryAnalysed_(
false)
557 patchTypes_.setSize(boundaries.
size());
558 forAll(boundaries, patchI)
560 patchNames_[patchI] = boundaries[patchI].patchName();
561 patchTypes_[patchI] = boundaries[patchI].patchType();
565 treatedPatch_ =
false;
567 treatPatchesWithPatch_.setSize(boundaries.
size());
589 forAll(boundaries, patchI)
590 if( boundaries[patchI].patchName() == patchName )
617 # pragma omp parallel for schedule(dynamic, 50)
621 const face& bf = bFaces[bfI];
625 if( !zMinPoint[bf[pI]] )
626 allZMin[facePatch[bfI]] =
false;
627 if( !zMaxPoint[bf[pI]] )
628 allZMax[facePatch[bfI]] =
false;
635 if( allZMin[patchI] ^ allZMax[patchI] )
662 forAll(boundaries, patchI)
682 treatedPatches[counter++] = i;
virtual const pointField & points() const
Return raw points.
const labelList & bp() const
void append(const T &e)
Append an element at the end of the list.
wordList patchNames_
patch names
const point & coordinates() const
return point coordinates
A class for handling words, derived from string.
const meshSurfaceEngine & surfaceEngine() const
Return const reference to meshSurfaceEngine.
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)
const labelList & globalBoundaryEdgeLabel() const
global boundary edge label
T & first()
Return the first element of the list.
label nPoints_
number of vertices in the mesh
#define forAll(list, i)
Loop across all elements in list.
const labelHashSet & invertedVertices() const
return the labels of inverted vertices
const labelList & globalBoundaryPointLabel() const
global boundary point label
polyMeshGen & mesh_
Reference to the mesh.
Template functions to aid in the implementation of demand driven data.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
A List obtained as a section of another List.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
word scalarToText(const scalar s)
convert the scalar value into text
static bool & parRun()
Is this a parallel run?
label addFaceSubset(const word &)
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 Type & first() const
Return first.
labelLongList newLabelForVertex_
label of a new node (helper)
std::map< label, std::map< std::pair< label, label >, label > > otherVrts_
bool is2DMesh_
is it a 2D mesh
Ostream & endl(Ostream &os)
Add newline and flush stream.
const pointFieldPMG & points() const
access to points
label size() const
Size of the active part of the list.
boundaryLayers(const boundaryLayers &)
Disallow bitwise copy construct.
const boolList & zMinPoints() const
T removeLastElement()
Return and remove the last element.
const VRWGraph & pointPatches() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of List.
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 findPatchesToBeTreatedTogether()
void addLayerForPatch(const label patchLabel)
create a bnd layer for a given patch
const Map< label > & otherEdgeFaceAtProc() const
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
bool geometryAnalysed_
has the geometry been analysed
const Type & second() const
Return second.
void terminateLayersAtConcaveEdges()
terminate boundary layers at concave edges (used as a flag)
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)
void addLayerForAllPatches()
add layers for all patches
void removeUnusedVertices()
remove unused vertices
bool isSharedEdgeConvex(const pointField &points, const Face1 &f1, const Face2 &f2)
check if the faces share a convex edge
label numberOfFeatureEdgesAtPoint(const label bpI) const
return the number of feature edges attached to a boundary point
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
const boolList & zMaxPoints() const
bool terminateLayersAtConcaveEdges_
shall the layers be terminated at concave edges (true)
labelList patchKey_
a key assigned to each patch. It is needed to search in otherVrts_
void setSize(const label nElmts)
set the number of used elements
bool found(const Key &) const
Return true if hashedEntry is found in table.
void createLayerCells(const labelList &patchLabels)
const VRWGraph & edgeFaces() const
void append(const point &)
add a point at the end of the list
const double e
Elementary charge.
const edgeList & edges() const
scalar angleBetweenFaces(const pointField &points, const Face1 &f1, const Face2 &f2)
angle between the two faces in radians
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
void clearOut()
delete meshSurfaceEngine
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
List< DynList< label > > treatPatchesWithPatch_
extrude patches with patch
void createOTopologyLayers()
create O-topology layers (used as flag)
meshSurfacePartitioner * meshPartitionerPtr_
poiner to meshSurfacePartitioner
const PtrList< boundaryPatch > & boundaries() const
ordinary boundaries
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void clear()
Clear the list, i.e. set size to zero.
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)
bool insert(const Key &key)
Insert a new entry.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
const labelList & boundaryPoints() const
void addFaceToSubset(const label, const label)
void createNewVertices(const boolList &treatPatches)
create new vertices for the selected patches
A face is a list of labels corresponding to mesh vertices.
const Map< label > & globalToLocalBndPointAddressing() const
global point label to local label. Only for processors points
void size(const label)
Override size to be inconsistent with allocated storage.
void createNewFacesAndCells(const boolList &treatPatches)
create a layer of cells
vector point
Point is a vector.
const Map< label > & otherEdgeFacePatch() const
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
const meshSurfacePartitioner & surfacePartitioner() const
return const reference to meshSurfacePartitioner
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
meshSurfaceEngine * msePtr_
pointer to mesh surface engine
label pointLabel() const
return point label
void append(const T &e)
Append an element at the end of the list.