36 Foam::label Foam::advancingFrontAMI::calcOverlappingProcs
38 const List<treeBoundBoxList>& procBb,
39 const treeBoundBox& bb,
43 overlaps.setSize(procBb.size());
52 for (
const treeBoundBox& tbb: bbp)
56 overlaps[proci] =
true;
67 void Foam::advancingFrontAMI::distributePatches
69 const mapDistribute& map,
71 const globalIndex& gi,
72 List<faceList>& faces,
74 List<labelList>& faceIDs
90 const labelList& sendElems = map.subMap()[domain];
92 if (sendElems.empty())
95 faces[domain].
clear();
97 faceIDs[domain].clear();
101 faceList subFaces(UIndirectList<face>(
pp, sendElems));
106 Pout<<
"distributePatches: to processor " << domain
107 <<
" sending faces " << subPatch.faceCentres() <<
endl;
114 faces[domain] = subPatch.localFaces();
115 points[domain] = subPatch.localPoints();
122 UOPstream str(domain, pBufs);
124 << subPatch.localFaces()
125 << subPatch.localPoints()
131 pBufs.finishedSends();
137 const labelList& recvElems = map.constructMap()[domain];
141 UIPstream is(domain, pBufs);
151 void Foam::advancingFrontAMI::distributeAndMergePatches
153 const mapDistribute& map,
155 const globalIndex& gi,
162 List<faceList> allFaces;
164 List<labelList> allTgtFaceIDs;
165 distributePatches(map, tgtPatch, gi, allFaces,
allPoints, allTgtFaceIDs);
172 nFaces += allFaces[proci].size();
176 tgtFaces.setSize(nFaces);
178 tgtFaceIDs.setSize(nFaces);
186 SubList<label>(tgtFaceIDs, faceIDs.size()) = faceIDs;
189 for (
const face&
f : fcs)
191 face& newF = tgtFaces[nFaces++];
212 const labelList& faceIDs = allTgtFaceIDs[proci];
213 SubList<label>(tgtFaceIDs, faceIDs.size(), nFaces) = faceIDs;
215 const faceList& fcs = allFaces[proci];
216 for (
const face&
f : fcs)
218 face& newF = tgtFaces[nFaces++];
248 Pout<<
"Merged from " << oldToNew.size()
249 <<
" down to " << tgtPoints.size() <<
" points" <<
endl;
252 for (face&
f : tgtFaces)
274 srcPatch.localFaces(),
275 srcPatch.localPoints(),
288 Info<<
"Determining extent of srcPatch per processor:" <<
nl 289 <<
"\tproc\tbb" <<
endl;
292 Info<<
'\t' << proci <<
'\t' << procBb[proci] <<
endl;
297 const faceList& faces = tgtPatch.localFaces();
311 if (faces[facei].size())
313 treeBoundBox faceBb(
points, faces[facei]);
316 calcOverlappingProcs(procBb, faceBb, procBbOverlaps);
318 forAll(procBbOverlaps, proci)
320 if (procBbOverlaps[proci])
322 dynSendMap[proci].append(facei);
332 sendMap[proci].transfer(dynSendMap[proci]);
339 Pout<<
"Of my " << faces.size() <<
" I need to send to:" <<
nl 340 <<
"\tproc\tfaces" <<
endl;
343 Pout<<
'\t' << proci <<
'\t' << sendMap[proci].size() <<
endl;
void size(const label n)
Older name for setAddressableSize.
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static int & msgType() noexcept
Message tag of standard messages.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
List< face > faceList
List of faces.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
void clear()
Clear the list, i.e. set size to zero.
const Field< point_type > & points() const noexcept
Return reference to global points.
label inplaceMergePoints(PointList &points, const scalar mergeTol, const bool verbose, labelList &pointToUnique)
Inplace merge points, preserving the original point order. All points closer/equal mergeTol are to be...
int debug
Static debugging option.
Geometric merging of points. See below.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field...
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
vector point
Point is a vector.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())