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
86 const labelList& sendElems = map.subMap()[domain];
88 if (sendElems.empty())
91 faces[domain].
clear();
93 faceIDs[domain].clear();
97 faceList subFaces(UIndirectList<face>(
pp, sendElems));
102 Pout<<
"distributePatches: to processor " << domain
103 <<
" sending faces " << subPatch.faceCentres() <<
endl;
110 faces[domain] = subPatch.localFaces();
111 points[domain] = subPatch.localPoints();
112 faceIDs[domain] = gi.toGlobal(sendElems);
117 UOPstream str(domain, pBufs);
119 << subPatch.localFaces()
120 << subPatch.localPoints()
121 << gi.toGlobal(sendElems);
126 pBufs.finishedSends();
131 const labelList& recvElems = map.constructMap()[domain];
135 UIPstream is(domain, pBufs);
145 void Foam::advancingFrontAMI::distributeAndMergePatches
147 const mapDistribute& map,
149 const globalIndex& gi,
156 List<faceList> allFaces;
158 List<labelList> allTgtFaceIDs;
159 distributePatches(map, tgtPatch, gi, allFaces,
allPoints, allTgtFaceIDs);
166 nFaces += allFaces[proci].size();
170 tgtFaces.setSize(nFaces);
172 tgtFaceIDs.setSize(nFaces);
180 SubList<label>(tgtFaceIDs, faceIDs.size()) = faceIDs;
183 for (
const face&
f : fcs)
185 face& newF = tgtFaces[nFaces++];
206 const labelList& faceIDs = allTgtFaceIDs[proci];
207 SubList<label>(tgtFaceIDs, faceIDs.size(), nFaces) = faceIDs;
209 const faceList& fcs = allFaces[proci];
210 for (
const face&
f : fcs)
212 face& newF = tgtFaces[nFaces++];
242 Pout<<
"Merged from " << oldToNew.size()
243 <<
" down to " << tgtPoints.size() <<
" points" <<
endl;
246 for (face&
f : tgtFaces)
268 srcPatch.localFaces(),
269 srcPatch.localPoints(),
282 Info<<
"Determining extent of srcPatch per processor:" <<
nl 283 <<
"\tproc\tbb" <<
endl;
286 Info<<
'\t' << proci <<
'\t' << procBb[proci] <<
endl;
291 const faceList& faces = tgtPatch.localFaces();
305 if (faces[facei].size())
307 treeBoundBox faceBb(
points, faces[facei]);
310 calcOverlappingProcs(procBb, faceBb, procBbOverlaps);
312 forAll(procBbOverlaps, proci)
314 if (procBbOverlaps[proci])
316 dynSendMap[proci].append(facei);
326 sendMap[proci].transfer(dynSendMap[proci]);
333 Pout<<
"Of my " << faces.size() <<
" I need to send to:" <<
nl 334 <<
"\tproc\tfaces" <<
endl;
337 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.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
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())