meshSurfaceEngineParallelAddressing.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "meshSurfaceEngine.H"
29 #include "demandDrivenData.H"
30 #include "Map.H"
31 #include "HashSet.H"
32 #include "helperFunctionsPar.H"
33 
34 #include <map>
35 #include <set>
36 
37 // #define DEBUGSearch
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
47 {
50 
51  const labelList& bPoints = this->boundaryPoints();
52  labelList& globalPointLabel = *globalBoundaryPointLabelPtr_;
53  globalPointLabel.setSize(bPoints.size());
54  globalPointLabel = -1;
55 
56  if( !bpProcsPtr_ )
57  bpProcsPtr_ = new VRWGraph(bPoints.size());
58 
61 
62  if( !bpNeiProcsPtr_ )
64 
65  if( !Pstream::parRun() )
66  return;
67 
69 
70  //- find local points for the given processor
71  const faceListPMG& faces = mesh_.faces();
72  const labelList& bp = this->bp();
73  const PtrList<processorBoundaryPatch>& procBoundaries =
75 
76  //- find which processor contain a given bnd point
77  forAll(procBoundaries, patchI)
78  {
79  const label start = procBoundaries[patchI].patchStart();
80  const label end = start + procBoundaries[patchI].patchSize();
81  for(label faceI=start;faceI<end;++faceI)
82  {
83  const face& f = faces[faceI];
84  forAll(f, pI)
85  if( bp[f[pI]] != -1 )
86  {
88  (
89  bp[f[pI]],
90  procBoundaries[patchI].myProcNo()
91  );
93  (
94  bp[f[pI]],
95  procBoundaries[patchI].neiProcNo()
96  );
97  }
98  }
99  }
100 
101  //- exchange data with other processor and update bpAtProcs
102  //- continue this process as long as there is some change
103  bool finished;
104  do
105  {
106  finished = true;
107 
108  forAll(procBoundaries, patchI)
109  {
110  const label start = procBoundaries[patchI].patchStart();
111  const label end = start + procBoundaries[patchI].patchSize();
112 
113  labelLongList dts;
114  labelHashSet addedPoint;
115  for(label faceI=start;faceI<end;++faceI)
116  {
117  const face& f = faces[faceI];
118  forAll(f, pI)
119  if( (bp[f[pI]] != -1) && !addedPoint.found(f[pI]) )
120  {
121  addedPoint.insert(f[pI]);
122  const label bpI = bp[f[pI]];
123  //- data is sent as follows
124  //- 1. face position in patch
125  //- 2. local point position in face
126  //- 3. number of processors for point
127  //- 4. proc labels
128  dts.append(faceI-start);
129  dts.append((f.size()-pI)%f.size());
130  dts.append(bpAtProcs.sizeOfRow(bpI));
131  forAllRow(bpAtProcs, bpI, i)
132  dts.append(bpAtProcs(bpI, i));
133  }
134  }
135 
136  OPstream toOtherProc
137  (
139  procBoundaries[patchI].neiProcNo(),
140  dts.byteSize()
141  );
142  toOtherProc << dts;
143  }
144 
145  forAll(procBoundaries, patchI)
146  {
147  IPstream fromOtherProc
148  (
150  procBoundaries[patchI].neiProcNo()
151  );
152  labelList receivedData;
153  fromOtherProc >> receivedData;
154 
155  const label start = procBoundaries[patchI].patchStart();
156 
157  label counter(0);
158  while( counter < receivedData.size() )
159  {
160  const face& f = faces[start+receivedData[counter++]];
161  const label pI = receivedData[counter++];
162  const label nProcs = receivedData[counter++];
163  for(label i=0;i<nProcs;++i)
164  {
165  const label neiProc = receivedData[counter++];
166  if( !bpAtProcs.contains(bp[f[pI]], neiProc) )
167  {
168  bpAtProcs.append(bp[f[pI]], neiProc);
169  finished = false;
170  }
171  }
172  }
173  }
174 
175  reduce(finished, minOp<bool>());
176  } while( !finished );
177 
178  //- start calculating global point labels
179  label nLocalPoints(0);
180  boolList localPoints(bPoints.size(), true);
181  forAll(bpAtProcs, bpI)
182  if( bpAtProcs.sizeOfRow(bpI) != 0 )
183  {
184  label pMin = bpAtProcs(bpI, 0);
185  forAllRow(bpAtProcs, bpI, procI)
186  if( bpAtProcs(bpI, procI) < pMin )
187  pMin = bpAtProcs(bpI, procI);
188 
189  if( pMin == Pstream::myProcNo() )
190  {
191  ++nLocalPoints;
192  }
193  else
194  {
195  localPoints[bpI] = false;
196  }
197  }
198  else
199  {
200  ++nLocalPoints;
201  }
202 
203  //- give local points their labels
204  label startPoint(0);
205  labelList nPointsAtProc(Pstream::nProcs());
206  nPointsAtProc[Pstream::myProcNo()] = nLocalPoints;
207  Pstream::gatherList(nPointsAtProc);
208  Pstream::scatterList(nPointsAtProc);
209  for(label i=0;i<Pstream::myProcNo();++i)
210  startPoint += nPointsAtProc[i];
211 
212  forAll(localPoints, pI)
213  if( localPoints[pI] )
214  globalPointLabel[pI] = startPoint++;
215 
216  //- send labels to non-local points
217  do
218  {
219  finished = true;
220 
221  forAll(procBoundaries, patchI)
222  {
223  const label start = procBoundaries[patchI].patchStart();
224  const label end = start + procBoundaries[patchI].patchSize();
225 
226  labelLongList dts;
227  labelHashSet addedPoint;
228  for(label faceI=start;faceI<end;++faceI)
229  {
230  const face& f = faces[faceI];
231  forAll(f, pI)
232  {
233  const label bpI = bp[f[pI]];
234  if( (bpI != -1) && (globalPointLabel[bpI] != -1) )
235  {
236  if( addedPoint.found(bpI) )
237  continue;
238 
239  addedPoint.insert(bpI);
240  //- data is sent as follows
241  //- 1. face position in patch
242  //- 2. local point position in face
243  //- 3. global point label
244  dts.append(faceI-start);
245  dts.append((f.size()-pI)%f.size());
246  dts.append(globalPointLabel[bpI]);
247  }
248  }
249  }
250 
251  OPstream toOtherProc
252  (
254  procBoundaries[patchI].neiProcNo(),
255  dts.byteSize()
256  );
257  toOtherProc << dts;
258  }
259 
260  forAll(procBoundaries, patchI)
261  {
262  IPstream fromOtherProc
263  (
265  procBoundaries[patchI].neiProcNo()
266  );
267  labelList receivedData;
268  fromOtherProc >> receivedData;
269 
270  const label start = procBoundaries[patchI].patchStart();
271 
272  label counter(0);
273  while( counter < receivedData.size() )
274  {
275  const face& f = faces[start+receivedData[counter++]];
276  const label pI = receivedData[counter++];
277  const label globalLabel = receivedData[counter++];
278 
279  if( globalPointLabel[bp[f[pI]]] == -1 )
280  {
281  globalPointLabel[bp[f[pI]]] = globalLabel;
282  finished = false;
283  }
284  else if( globalPointLabel[bp[f[pI]]] != globalLabel )
285  {
287  (
288  "void meshSurfaceEngine::"
289  "calcGlobalBoundaryPointLabels() const"
290  ) << "Point labels in proc boundary "
291  << procBoundaries[patchI].patchName()
292  << " face " << f << " pI = " << pI
293  << nl << " label " << globalPointLabel[bp[f[pI]]]
294  << nl << " other global label " << globalLabel
295  << " do not match!" << abort(FatalError);
296  }
297  }
298  }
299 
300  reduce(finished, minOp<bool>());
301  } while( !finished );
302 
303  //- create globalToLocal addressing
304  forAll(bpAtProcs, bpI)
305  {
306  if( bpAtProcs.sizeOfRow(bpI) != 0 )
307  {
308  globalBoundaryPointToLocalPtr_->insert(globalPointLabel[bpI], bpI);
309 
310  forAllRow(bpAtProcs, bpI, j)
311  {
312  const label procI = bpAtProcs(bpI, j);
313 
314  if( procI == Pstream::myProcNo() )
315  continue;
316 
318  }
319  }
320  }
321 }
322 
324 {
327 
328  const edgeList& bEdges = this->edges();
329 
330  labelList& globalEdgeLabel = *globalBoundaryEdgeLabelPtr_;
331  globalEdgeLabel.setSize(bEdges.size());
332  globalEdgeLabel = -1;
333 
334  if( !beProcsPtr_ )
335  beProcsPtr_ = new VRWGraph(bEdges.size());
336 
339 
340  if( !beNeiProcsPtr_ )
342 
343  if( !Pstream::parRun() )
344  return;
345 
347 
348  const faceListPMG& faces = mesh_.faces();
349  const labelList& bp = this->bp();
350  const VRWGraph& pEdges = this->boundaryPointEdges();
351  const PtrList<processorBoundaryPatch>& procBoundaries =
353 
354  //- find which processors contain a given bnd edge
355  typedef std::set<std::pair<label, label> > procEdgeMap;
356  List<procEdgeMap> facesWithProcBndEdges(procBoundaries.size());
357 
358  forAll(procBoundaries, patchI)
359  {
360  const label start = procBoundaries[patchI].patchStart();
361  const label end = start + procBoundaries[patchI].patchSize();
362  for(label faceI=start;faceI<end;++faceI)
363  {
364  const face& f = faces[faceI];
365 
366  forAll(f, eI)
367  {
368  if( bp[f[eI]] != -1 )
369  {
370  const edge e = f.faceEdge(eI);
371 
372  const label bpI = bp[e.start()];
373  label edgeI(-1);
374  forAllRow(pEdges, bpI, peI)
375  if( bEdges[pEdges(bpI, peI)] == e )
376  {
377  edgeI = pEdges(bpI, peI);
378  break;
379  }
380 
381  if( edgeI != -1 )
382  {
383  facesWithProcBndEdges[patchI].insert
384  (
385  std::make_pair(faceI, eI)
386  );
387 
389  (
390  edgeI,
391  procBoundaries[patchI].myProcNo()
392  );
394  (
395  edgeI,
396  procBoundaries[patchI].neiProcNo()
397  );
398  }
399  }
400  }
401  }
402  }
403 
404  //- exchange data with other processor and update beAtProcs
405  //- continue this process as long as there is some change
406  bool finished;
407  do
408  {
409  finished = true;
410 
411  forAll(facesWithProcBndEdges, patchI)
412  {
413  const label start = procBoundaries[patchI].patchStart();
414  const procEdgeMap& procBndEdges = facesWithProcBndEdges[patchI];
415 
416  labelLongList dts;
417  forAllConstIter(procEdgeMap, procBndEdges, it)
418  {
419  const std::pair<label, label>& fPair = *it;
420 
421  const face& f = faces[fPair.first];
422  const edge e = f.faceEdge(fPair.second);
423 
424  if( bp[e.start()] != -1 )
425  {
426  const label bpI = bp[e.start()];
427  label edgeI(-1);
428  forAllRow(pEdges, bpI, peI)
429  if( bEdges[pEdges(bpI, peI)] == e )
430  {
431  edgeI = pEdges(bpI, peI);
432  break;
433  }
434 
435  if( edgeI != -1 )
436  {
437  //- data is sent as follows
438  //- 1. face position in patch
439  //- 2. local edge position in face
440  //- 3. number of processors for edge
441  //- 4. proc labels
442  dts.append(fPair.first-start);
443  dts.append((f.size()-fPair.second-1)%f.size());
444  dts.append(beAtProcs.sizeOfRow(edgeI));
445  forAllRow(beAtProcs, edgeI, i)
446  dts.append(beAtProcs(edgeI, i));
447  }
448  }
449  }
450 
451  OPstream toOtherProc
452  (
454  procBoundaries[patchI].neiProcNo(),
455  dts.byteSize()
456  );
457  toOtherProc << dts;
458  }
459 
460  forAll(procBoundaries, patchI)
461  {
462  IPstream fromOtherProc
463  (
465  procBoundaries[patchI].neiProcNo()
466  );
467  labelList receivedData;
468  fromOtherProc >> receivedData;
469 
470  const label start = procBoundaries[patchI].patchStart();
471 
472  label counter(0);
473  while( counter < receivedData.size() )
474  {
475  const label faceI = start+receivedData[counter++];
476  const face& f = faces[faceI];
477  const label eI = receivedData[counter++];
478 
479  const edge e = f.faceEdge(eI);
480  label edgeI(-1);
481  forAllRow(pEdges, bp[e.start()], peI)
482  if( bEdges[pEdges(bp[e.start()], peI)] == e )
483  edgeI = pEdges(bp[e.start()], peI);
484 
485  const label nProcs = receivedData[counter++];
486  for(label i=0;i<nProcs;++i)
487  {
488  const label neiProc = receivedData[counter++];
489  if( !beAtProcs.contains(edgeI, neiProc) )
490  {
491  facesWithProcBndEdges[patchI].insert
492  (
493  std::make_pair(faceI, eI)
494  );
495 
496  beAtProcs.append(edgeI, neiProc);
497  finished = false;
498  }
499  }
500  }
501  }
502 
503  reduce(finished, minOp<bool>());
504  } while( !finished );
505 
506  //- start calculating global edge labels
507  label nLocalEdges(0);
508  boolList localEdges(bEdges.size(), true);
509  forAll(beAtProcs, bpI)
510  if( beAtProcs.sizeOfRow(bpI) != 0 )
511  {
512  label pMin = beAtProcs(bpI, 0);
513  forAllRow(beAtProcs, bpI, procI)
514  if( beAtProcs(bpI, procI) < pMin )
515  pMin = beAtProcs(bpI, procI);
516 
517  if( pMin == Pstream::myProcNo() )
518  {
519  ++nLocalEdges;
520  }
521  else
522  {
523  localEdges[bpI] = false;
524  }
525  }
526  else
527  {
528  ++nLocalEdges;
529  }
530 
531  //- give local points their labels
532  label startEdge(0);
533  labelList nEdgesAtProc(Pstream::nProcs());
534  nEdgesAtProc[Pstream::myProcNo()] = nLocalEdges;
535  Pstream::gatherList(nEdgesAtProc);
536  Pstream::scatterList(nEdgesAtProc);
537  for(label i=0;i<Pstream::myProcNo();++i)
538  startEdge += nEdgesAtProc[i];
539 
540  forAll(localEdges, pI)
541  if( localEdges[pI] )
542  globalEdgeLabel[pI] = startEdge++;
543 
544  //- send labels to non-local edges
545  do
546  {
547  finished = true;
548 
549  forAll(facesWithProcBndEdges, patchI)
550  {
551  const label start = procBoundaries[patchI].patchStart();
552  const procEdgeMap& procBndEdges = facesWithProcBndEdges[patchI];
553 
554  labelLongList dts;
555  forAllConstIter(procEdgeMap, procBndEdges, it)
556  {
557  const label faceI = it->first;
558  const face& f = faces[faceI];
559 
560  const label eI = it->second;
561  const edge e = f.faceEdge(eI);
562 
563  if( bp[e.start()] != -1 )
564  {
565  const label bpI = bp[e.start()];
566  label edgeI(-1);
567  forAllRow(pEdges, bpI, peI)
568  if( bEdges[pEdges(bpI, peI)] == e )
569  {
570  edgeI = pEdges(bpI, peI);
571  break;
572  }
573 
574  if( (edgeI != -1) && (globalEdgeLabel[edgeI] != -1) )
575  {
576  //- data is sent as follows
577  //- 1. face position in patch
578  //- 2. local edge position in face
579  //- 3. global edge label
580  dts.append(faceI-start);
581  dts.append((f.size()-eI-1)%f.size());
582  dts.append(globalEdgeLabel[edgeI]);
583  }
584  }
585  }
586 
587  OPstream toOtherProc
588  (
590  procBoundaries[patchI].neiProcNo(),
591  dts.byteSize()
592  );
593  toOtherProc << dts;
594  }
595 
596  forAll(procBoundaries, patchI)
597  {
598  IPstream fromOtherProc
599  (
601  procBoundaries[patchI].neiProcNo()
602  );
603  labelList receivedData;
604  fromOtherProc >> receivedData;
605 
606  const label start = procBoundaries[patchI].patchStart();
607 
608  label counter(0);
609  while( counter < receivedData.size() )
610  {
611  const face& f = faces[start+receivedData[counter++]];
612  const label eI = receivedData[counter++];
613 
614  const edge e = f.faceEdge(eI);
615  label edgeI(-1);
616  forAllRow(pEdges, bp[e.start()], peI)
617  if( bEdges[pEdges(bp[e.start()], peI)] == e )
618  edgeI = pEdges(bp[e.start()], peI);
619 
620  const label globalLabel = receivedData[counter++];
621 
622  if( globalEdgeLabel[edgeI] == -1 )
623  {
624  globalEdgeLabel[edgeI] = globalLabel;
625  finished = false;
626  }
627  else if( globalEdgeLabel[edgeI] != globalLabel )
628  {
630  (
631  "void meshSurfaceEngine::"
632  "calcGlobalBoundaryEdgeLabels() const"
633  ) << "Edge labels do not match!" << abort(FatalError);
634  }
635  }
636  }
637 
638  reduce(finished, minOp<bool>());
639  } while( !finished );
640 
641  //- create globalToLocal addressing
642  forAll(beAtProcs, beI)
643  {
644  if( beAtProcs.sizeOfRow(beI) != 0 )
645  {
646  globalBoundaryEdgeToLocalPtr_->insert(globalEdgeLabel[beI], beI);
647 
648  forAllRow(beAtProcs, beI, j)
649  {
650  const label procI = beAtProcs(beI, j);
651 
652  if( procI == Pstream::myProcNo() )
653  continue;
654 
656  }
657  }
658  }
659 }
660 
662 {
663  const labelList& globalEdgeLabel = this->globalBoundaryEdgeLabel();
665  const VRWGraph& eFaces = this->edgeFaces();
666  const VRWGraph& beAtProcs = this->beAtProcs();
667  const Map<label>& globalToLocal = this->globalToLocalBndEdgeAddressing();
668  const DynList<label>& beNeiProcs = this->beNeiProcs();
669 
670  std::map<label, labelLongList> exchangeData;
671  forAll(beNeiProcs, i)
672  exchangeData.insert(std::make_pair(beNeiProcs[i], labelLongList()));
673 
674  //- check if it the surface is manifold over inter-processor edges
675  Map<label> nFacesAtEdge;
676  forAllConstIter(Map<label>, globalToLocal, iter)
677  {
678  const label beI = iter();
679  nFacesAtEdge.insert(beI, eFaces.sizeOfRow(beI));
680 
681  forAllRow(beAtProcs, beI, i)
682  {
683  const label neiProc = beAtProcs(beI, i);
684 
685  if( neiProc == Pstream::myProcNo() )
686  continue;
687 
688  labelLongList& dts = exchangeData[neiProc];
689  dts.append(iter.key());
690  dts.append(eFaces.sizeOfRow(beI));
691  }
692  }
693 
694  labelLongList receivedData;
695  help::exchangeMap(exchangeData, receivedData);
696  for(label counter=0;counter<receivedData.size();)
697  {
698  const label beI = globalToLocal[receivedData[counter++]];
699  nFacesAtEdge[beI] += receivedData[counter++];
700  }
701 
702  forAllConstIter(Map<label>, nFacesAtEdge, iter)
703  {
704  if( iter() != 2 )
706  (
707  "void meshSurfaceEngine::calcAddressingForProcEdges() const"
708  ) << "Surface is not manifold at boundary edge "
709  << iter.key() << exit(FatalError);
710  }
711 
712  //- find the processor which contains other face containing an edge
713  //- at inter-processor boundary
714  exchangeData.clear();
715  forAll(beNeiProcs, i)
716  exchangeData.insert(std::make_pair(beNeiProcs[i], labelLongList()));
717 
718  forAllConstIter(Map<label>, globalToLocal, iter)
719  {
720  const label beI = iter();
721 
722  forAllRow(beAtProcs, beI, procI)
723  {
724  const label neiProc = beAtProcs(beI, procI);
725 
726  if( neiProc == Pstream::myProcNo() )
727  continue;
728 
729  if( eFaces.sizeOfRow(beI) == 1 )
730  {
731  exchangeData[neiProc].append(globalEdgeLabel[beI]);
732  exchangeData[neiProc].append
733  (
734  boundaryFacePatches[eFaces(beI, 0)]
735  );
736  }
737  }
738  }
739 
740  //- exchange edge-face patches with other processors
741  std::map<label, labelList> receivedMap;
742  help::exchangeMap(exchangeData, receivedMap);
743 
744  //- store other face patches in a map
747  Map<label>& otherProcPatches = *otherEdgeFacePatchPtr_;
748  Map<label>& otherFaceProc = *otherEdgeFaceAtProcPtr_;
749  for
750  (
751  std::map<label, labelList>::const_iterator iter=receivedMap.begin();
752  iter!=receivedMap.end();
753  ++iter
754  )
755  {
756  const labelList& receivedData = iter->second;
757 
758  label counter(0);
759  while( counter < receivedData.size() )
760  {
761  const label beI = globalToLocal[receivedData[counter++]];
762  const label patch = receivedData[counter++];
763  if( eFaces.sizeOfRow(beI) == 1 )
764  {
765  otherProcPatches.insert(beI, patch);
766  otherFaceProc.insert(beI, iter->first);
767  }
768  }
769  }
770 }
771 
773 {
774  const faceList::subList& bFaces = boundaryFaces();
775 
778 
779  labelList& globalFaceLabel = *globalBoundaryFaceLabelPtr_;
780 
781  labelList nFacesAtProc(Pstream::nProcs());
782  nFacesAtProc[Pstream::myProcNo()] = bFaces.size();
783  Pstream::gatherList(nFacesAtProc);
784  Pstream::scatterList(nFacesAtProc);
785 
786  label startFace(0);
787  for(label i=0;i<Pstream::myProcNo();++i)
788  startFace += nFacesAtProc[i];
789 
790  forAll(bFaces, fI)
791  globalFaceLabel[fI] = startFace++;
792 }
793 
794 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
795 
796 } // End namespace Foam
797 
798 // ************************************************************************* //
Foam::meshSurfaceEngine::boundaryPointEdges
const VRWGraph & boundaryPointEdges() const
Definition: meshSurfaceEngineI.H:315
Foam::meshSurfaceEngine::bpAtProcs
const VRWGraph & bpAtProcs() const
processors which contain the vertex
Definition: meshSurfaceEngineI.H:451
Foam::meshSurfaceEngine::beAtProcs
const VRWGraph & beAtProcs() const
processors which contain the edges
Definition: meshSurfaceEngineI.H:530
Foam::meshSurfaceEngine::bpProcsPtr_
VRWGraph * bpProcsPtr_
boundary point-processors addressing
Definition: meshSurfaceEngine.H:124
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::LongList::append
void append(const T &e)
Append an element at the end of the list.
Definition: LongListI.H:265
Foam::meshSurfaceEngine::globalBoundaryEdgeLabelPtr_
labelList * globalBoundaryEdgeLabelPtr_
global boundary edge label
Definition: meshSurfaceEngine.H:130
Foam::labelList
List< label > labelList
A List of labels.
Definition: labelList.H:56
Foam::meshSurfaceEngine::globalToLocalBndEdgeAddressing
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
Definition: meshSurfaceEngineI.H:510
Foam::meshSurfaceEngine::globalBoundaryEdgeLabel
const labelList & globalBoundaryEdgeLabel() const
global boundary edge label
Definition: meshSurfaceEngineI.H:489
helperFunctionsPar.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::meshSurfaceEngine::beProcsPtr_
VRWGraph * beProcsPtr_
boundary edge-processors addressing
Definition: meshSurfaceEngine.H:136
Foam::OPstream
Output inter-processor communications stream.
Definition: OPstream.H:50
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::Pstream::scatterList
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
Definition: gatherScatterList.C:205
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::UPstream::nProcs
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:387
Foam::minOp
Definition: ops.H:173
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
pMin
dimensionedScalar pMin("pMin", dimPressure, fluid)
Foam::meshSurfaceEngine::globalBoundaryEdgeToLocalPtr_
Map< label > * globalBoundaryEdgeToLocalPtr_
global boundary edge to local addressing
Definition: meshSurfaceEngine.H:133
Foam::meshSurfaceEngine::boundaryFacePatches
const labelList & boundaryFacePatches() const
patch label for each boundary face
Definition: meshSurfaceEngineI.H:123
Foam::Map< label >
Foam::LongList::size
label size() const
Size of the active part of the list.
Definition: LongListI.H:203
Foam::HashSet< label, Hash< label > >
Foam::VRWGraph::appendIfNotIn
void appendIfNotIn(const label rowI, const label)
Append an element to the given row if it does not exist there.
Definition: VRWGraphI.H:346
Foam::meshSurfaceEngine::otherEdgeFacePatchPtr_
Map< label > * otherEdgeFacePatchPtr_
Definition: meshSurfaceEngine.H:143
Foam::VRWGraph::contains
bool contains(const label rowI, const label e) const
check if the element is in the given row (takes linear time)
Definition: VRWGraphI.H:511
Foam::polyMeshGenFaces::faces
const faceListPMG & faces() const
access to faces
Definition: polyMeshGenFacesI.H:43
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::LongList< label >
Map.H
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:43
Foam::meshSurfaceEngine::calcGlobalBoundaryPointLabels
void calcGlobalBoundaryPointLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:46
Foam::meshSurfaceEngine::boundaryFaces
const faceList::subList & boundaryFaces() const
Definition: meshSurfaceEngineI.H:103
Foam::meshSurfaceEngine::globalBoundaryPointToLocalPtr_
Map< label > * globalBoundaryPointToLocalPtr_
global boundary point to local addressing
Definition: meshSurfaceEngine.H:121
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::meshSurfaceEngine::beNeiProcs
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
Definition: meshSurfaceEngineI.H:549
Foam::meshSurfaceEngine::globalBoundaryPointLabelPtr_
labelList * globalBoundaryPointLabelPtr_
global boundary point label
Definition: meshSurfaceEngine.H:118
Foam::DynList::appendIfNotIn
void appendIfNotIn(const T &e)
Definition: DynListI.H:324
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
forAllRow
#define forAllRow(graph, rowI, index)
Definition: VRWGraph.H:277
Foam::meshSurfaceEngine::calcGlobalBoundaryEdgeLabels
void calcGlobalBoundaryEdgeLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:323
HashSet.H
Foam::VRWGraph::sizeOfRow
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
Definition: VRWGraphI.H:127
Foam::FatalError
error FatalError
Foam::meshSurfaceEngine::globalBoundaryFaceLabelPtr_
labelList * globalBoundaryFaceLabelPtr_
global label for boundary faces
Definition: meshSurfaceEngine.H:146
Foam::meshSurfaceEngine::bpNeiProcsPtr_
DynList< label > * bpNeiProcsPtr_
neighbour processors for communication when sending point data
Definition: meshSurfaceEngine.H:127
Foam::HashTable::found
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:109
Foam::meshSurfaceEngine::edgeFaces
const VRWGraph & edgeFaces() const
Definition: meshSurfaceEngineI.H:334
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
meshSurfaceEngine.H
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::DynList< label >
Foam::meshSurfaceEngine::edges
const edgeList & edges() const
Definition: meshSurfaceEngineI.H:296
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:405
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::Pstream::gatherList
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Definition: gatherScatterList.C:49
Foam::LongList::byteSize
label byteSize() const
Return the binary size in number of characters of the UList.
Definition: LongListI.H:209
f
labelList f(nPoints)
Foam::meshSurfaceEngine::mesh_
polyMeshGen & mesh_
reference to the mesh
Definition: meshSurfaceEngine.H:58
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::meshSurfaceEngine::otherEdgeFaceAtProcPtr_
Map< label > * otherEdgeFaceAtProcPtr_
processor containing other face and face-patch addressing
Definition: meshSurfaceEngine.H:142
Foam::meshSurfaceEngine::calcAddressingForProcEdges
void calcAddressingForProcEdges() const
Definition: meshSurfaceEngineParallelAddressing.C:661
Foam::PtrList::size
label size() const
Return the number of elements in the PtrList.
Definition: PtrListI.H:32
Foam::help::exchangeMap
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
Definition: helperFunctionsPar.C:129
Foam::HashSet::insert
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:116
Foam::VRWGraph::append
void append(const label rowI, const label)
Append an element to the given row.
Definition: VRWGraphI.H:303
Foam::polyMeshGenFaces::procBoundaries
const PtrList< processorBoundaryPatch > & procBoundaries() const
inter-processor boundaries
Definition: polyMeshGenFacesI.H:106
Foam::meshSurfaceEngine::boundaryPoints
const labelList & boundaryPoints() const
Definition: meshSurfaceEngineI.H:84
Foam::IPstream
Input inter-processor communications stream.
Definition: IPstream.H:50
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:313
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::UList::size
label size() const
Return the number of elements in the UList.
Definition: UListI.H:299
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::labelLongList
LongList< label > labelLongList
Definition: labelLongList.H:46
Foam::meshSurfaceEngine::calcGlobalBoundaryFaceLabels
void calcGlobalBoundaryFaceLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:772
Foam::meshSurfaceEngine::beNeiProcsPtr_
DynList< label > * beNeiProcsPtr_
neighbour processors for communication when sending edge data
Definition: meshSurfaceEngine.H:139
Foam::meshSurfaceEngine::faces
const faceListPMG & faces() const
Definition: meshSurfaceEngineI.H:54