cyclicACMIGAMGInterface.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2019,2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "AMIInterpolation.H"
32 #include "Map.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  defineTypeNameAndDebug(cyclicACMIGAMGInterface, 0);
40  (
41  GAMGInterface,
42  cyclicACMIGAMGInterface,
43  lduInterface
44  );
46  (
47  GAMGInterface,
48  cyclicACMIGAMGInterface,
49  Istream
50  );
51 }
52 
53 
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 
56 Foam::cyclicACMIGAMGInterface::cyclicACMIGAMGInterface
57 (
58  const label index,
59  const lduInterfacePtrsList& coarseInterfaces,
60  const lduInterface& fineInterface,
61  const labelField& localRestrictAddressing,
62  const labelField& neighbourRestrictAddressing,
63  const label fineLevelIndex,
64  const label coarseComm
65 )
66 :
68  (
69  index,
70  coarseInterfaces
71  ),
72  neighbPatchID_
73  (
74  refCast<const cyclicACMILduInterface>(fineInterface).neighbPatchID()
75  ),
76  owner_
77  (
78  refCast<const cyclicACMILduInterface>(fineInterface).owner()
79  ),
80  forwardT_
81  (
82  refCast<const cyclicACMILduInterface>(fineInterface).forwardT()
83  ),
84  reverseT_
85  (
86  refCast<const cyclicACMILduInterface>(fineInterface).reverseT()
87  )
88 {
89  const auto& fineCyclicACMIInterface =
90  refCast<const cyclicACMILduInterface>(fineInterface);
91 
92  // Construct face agglomeration from cell agglomeration
93  {
94  // From coarse face to cell
95  DynamicList<label> dynFaceCells(localRestrictAddressing.size());
96 
97  // From face to coarse face
98  DynamicList<label> dynFaceRestrictAddressing
99  (
100  localRestrictAddressing.size()
101  );
102 
103  Map<label> masterToCoarseFace(localRestrictAddressing.size());
104 
105  for (const label curMaster : localRestrictAddressing)
106  {
107  const auto iter = masterToCoarseFace.cfind(curMaster);
108 
109  if (iter.good())
110  {
111  // Already have coarse face
112  dynFaceRestrictAddressing.append(iter.val());
113  }
114  else
115  {
116  // New coarse face
117  const label coarseI = dynFaceCells.size();
118  dynFaceRestrictAddressing.append(coarseI);
119  dynFaceCells.append(curMaster);
120  masterToCoarseFace.insert(curMaster, coarseI);
121  }
122  }
123 
124  faceCells_.transfer(dynFaceCells);
125  faceRestrictAddressing_.transfer(dynFaceRestrictAddressing);
126  }
127 
128 
129  // On the owner side construct the AMI
130 
131  if (fineCyclicACMIInterface.owner())
132  {
133  // Construct the neighbour side agglomeration (as the neighbour would
134  // do it so it the exact loop above using neighbourRestrictAddressing
135  // instead of localRestrictAddressing)
136 
137  labelList nbrFaceRestrictAddressing;
138  {
139  // From face to coarse face
140  DynamicList<label> dynNbrFaceRestrictAddressing
141  (
142  neighbourRestrictAddressing.size()
143  );
144 
145  Map<label> masterToCoarseFace(neighbourRestrictAddressing.size());
146 
147  for (const label curMaster : neighbourRestrictAddressing)
148  {
149  const auto iter = masterToCoarseFace.cfind(curMaster);
150 
151  if (iter.good())
152  {
153  // Already have coarse face
154  dynNbrFaceRestrictAddressing.append(iter.val());
155  }
156  else
157  {
158  // New coarse face
159  const label coarseI = masterToCoarseFace.size();
160  dynNbrFaceRestrictAddressing.append(coarseI);
161  masterToCoarseFace.insert(curMaster, coarseI);
162  }
163  }
164 
165  nbrFaceRestrictAddressing.transfer(dynNbrFaceRestrictAddressing);
166  }
167 
168 
169  amiPtr_.reset
170  (
172  (
173  fineCyclicACMIInterface.AMI(),
175  nbrFaceRestrictAddressing
176  )
177  );
178  }
179 }
180 
181 
182 Foam::cyclicACMIGAMGInterface::cyclicACMIGAMGInterface
183 (
184  const label index,
185  const lduInterfacePtrsList& coarseInterfaces,
186  Istream& is
187 )
188 :
189  GAMGInterface(index, coarseInterfaces, is),
190  neighbPatchID_(readLabel(is)),
191  owner_(readBool(is)),
192  forwardT_(is),
193  reverseT_(is)
194 {
195  const bool hasAMI(readBool(is));
196 
197  if (hasAMI)
198  {
199  amiPtr_.reset(new AMIPatchToPatchInterpolation(is));
200  }
201 }
202 
203 
204 Foam::cyclicACMIGAMGInterface::cyclicACMIGAMGInterface
205 (
206  const label index,
207  const lduInterfacePtrsList& coarseInterfaces,
208  const lduInterface& fineInterface,
209  const labelList& interfaceMap,
210  const labelUList& faceCells,
211  const labelUList& faceRestrictAddresssing,
212  const labelUList& faceOffsets,
213  const lduInterfacePtrsList& allInterfaces,
214  const label coarseComm,
215  const label myProcNo,
216  const labelList& procAgglomMap
217 )
218 :
219  GAMGInterface
220  (
221  index,
222  coarseInterfaces,
223  faceCells,
224  faceRestrictAddresssing
225  ),
226  neighbPatchID_
227  (
228  interfaceMap.find
229  (
230  refCast
231  <
232  const cyclicACMILduInterface
233  >(fineInterface).neighbPatchID()
234  )
235  ),
236  owner_
237  (
238  refCast<const cyclicACMILduInterface>(fineInterface).owner()
239  ),
240  forwardT_
241  (
242  refCast<const cyclicACMILduInterface>(fineInterface).forwardT()
243  ),
244  reverseT_
245  (
246  refCast<const cyclicACMILduInterface>(fineInterface).reverseT()
247  )
248 {
249  const auto& fineCyclicACMIInterface =
250  refCast<const cyclicACMIGAMGInterface>(fineInterface);
251 
252  if (fineCyclicACMIInterface.amiPtr_)
253  {
254  const auto& AMI = const_cast<AMIPatchToPatchInterpolation&>
255  (
256  fineCyclicACMIInterface.AMI()
257  );
258 
259  label singlePatchProc = AMI.singlePatchProc();
260 
261 
262  // Get some sizes
263  label nSrc = 0;
264  label nTgt = 0;
265  bool hasSrcMagSf = false;
266  bool hasSrcCentroids = false;
267  bool hasTgtMagSf = false;
268 
269  forAll(allInterfaces, inti)
270  {
271  if (allInterfaces.set(inti))
272  {
273  const auto& intf =
274  refCast<const cyclicACMIGAMGInterface>(allInterfaces[inti]);
275  const auto& AMI = intf.AMI();
276  nSrc += AMI.srcAddress().size();
277  nTgt += AMI.tgtAddress().size();
278 
279  if (AMI.srcMagSf().size())
280  {
281  hasSrcMagSf = true;
282  if (AMI.srcMagSf().size() != AMI.srcAddress().size())
283  {
285  << "srcMagSf size:" << AMI.srcMagSf().size()
286  << "srcAddress size:" << AMI.srcAddress().size()
287  << exit(FatalError);
288  }
289  }
290  if (AMI.srcCentroids().size())
291  {
292  hasSrcCentroids = true;
293  if (AMI.srcCentroids().size() != AMI.srcAddress().size())
294  {
296  << "srcCentroids size:" << AMI.srcCentroids().size()
297  << "srcAddress size:" << AMI.srcAddress().size()
298  << exit(FatalError);
299  }
300  }
301  if (AMI.tgtMagSf().size())
302  {
303  hasTgtMagSf = true;
304  if (AMI.tgtMagSf().size() != AMI.tgtAddress().size())
305  {
307  << "tgtMagSf size:" << AMI.tgtMagSf().size()
308  << "tgtAddress size:" << AMI.tgtAddress().size()
309  << exit(FatalError);
310  }
311  }
312  }
313  }
314 
315 
316  labelListList srcAddress;
317  scalarListList srcWeights;
318  scalarList srcMagSf;
319  // Needed?
320  pointListList srcCentroids;
321 
322  labelListList tgtAddress;
323  scalarListList tgtWeights;
324  scalarList tgtMagSf;
325 
326 
327  // Map to send src side data to tgt side
328  autoPtr<mapDistribute> srcToTgtMap;
329 
330  // Map to send tgt side data to src side
331  autoPtr<mapDistribute> tgtToSrcMap;
332 
333  if (AMI.distributed())
334  {
335  // Create combined maps
336  UPtrList<const mapDistribute> srcMaps(allInterfaces.size());
337  UPtrList<const mapDistribute> tgtMaps(allInterfaces.size());
338  forAll(allInterfaces, inti)
339  {
340  if (allInterfaces.set(inti))
341  {
342  const auto& intf = refCast<const cyclicACMIGAMGInterface>
343  (
344  allInterfaces[inti]
345  );
346  const auto& AMI = intf.AMI();
347  srcMaps.set(inti, &AMI.srcMap());
348  tgtMaps.set(inti, &AMI.tgtMap());
349  }
350  }
351 
352 
353  // Find ranks that agglomerate together
354  const label myAgglom =
355  procAgglomMap[UPstream::myProcNo(AMI.comm())];
356 
357  // Invert procAgglomMap
358  const labelListList newToOldRanks
359  (
361  (
362  UPstream::nProcs(coarseComm),
363  procAgglomMap
364  )
365  );
366  const labelList& localRanks = newToOldRanks[myAgglom];
367 
368 
369  // Offsets for slots into results of srcToTgtMap
370  labelList srcStartOfLocal;
371  List<Map<label>> srcCompactMaps;
372 
373  srcToTgtMap.reset
374  (
375  new mapDistribute
376  (
377  srcMaps,
378  localRanks, // per src map which rank it is from
379  coarseComm,
380  newToOldRanks, // destination rank to source ranks
381  srcStartOfLocal,
382  srcCompactMaps
383  )
384  );
385 
386  // Assemble tgtAddress
387  tgtAddress.setSize(nTgt);
388  if (tgtAddress.size())
389  {
390  label alli = 0;
391  forAll(allInterfaces, inti)
392  {
393  if (allInterfaces.set(inti))
394  {
395  const auto& intf =
396  refCast<const cyclicACMIGAMGInterface>
397  (
398  allInterfaces[inti]
399  );
400  const auto& AMI = intf.AMI();
401  const auto& tgtSlots = AMI.tgtAddress();
402  const label localSize =
403  srcStartOfLocal[inti+1]
404  - srcStartOfLocal[inti];
405 
406  forAll(tgtSlots, tgti)
407  {
408  // Append old slots: copy old values and adapt
409  auto& newSlots = tgtAddress[alli++];
410  newSlots = tgtSlots[tgti];
411 
412  // Renumber to new indices
414  (
415  newSlots,
416  localSize,
417  srcStartOfLocal[inti],
418  srcCompactMaps[inti],
419  AMI.srcMap().constructHasFlip() //hasFlip
420  );
421 
422  for (const label slot : newSlots)
423  {
424  if
425  (
426  slot < 0
427  || slot >= srcToTgtMap().constructSize()
428  )
429  {
430  FatalErrorInFunction << " newSlots:"
431  << newSlots << exit(FatalError);
432  }
433  }
434  }
435  }
436  }
437 
438  if (nTgt != alli)
439  {
440  FatalErrorInFunction << "nTgt:" << nTgt
441  << " alli:" << alli << exit(FatalError);
442  }
443  }
444 
445  // Offsets for slots into results of tgtToSrcMap
446  labelList tgtStartOfLocal;
447  List<Map<label>> tgtCompactMaps;
448 
449  tgtToSrcMap.reset
450  (
451  new mapDistribute
452  (
453  tgtMaps,
454  localRanks,
455  coarseComm,
456  newToOldRanks,
457  tgtStartOfLocal,
458  tgtCompactMaps
459  )
460  );
461 
462  // Assemble srcAddress
463  srcAddress.setSize(nSrc);
464  if (srcAddress.size())
465  {
466  label alli = 0;
467  forAll(allInterfaces, inti)
468  {
469  if (allInterfaces.set(inti))
470  {
471  const auto& intf =
472  refCast<const cyclicACMIGAMGInterface>
473  (
474  allInterfaces[inti]
475  );
476  const auto& AMI = intf.AMI();
477  const auto& srcSlots = AMI.srcAddress();
478  const label localSize =
479  tgtStartOfLocal[inti+1]
480  - tgtStartOfLocal[inti];
481 
482  forAll(srcSlots, srci)
483  {
484  // Append old slots: copy old values and adapt
485  auto& newSlots = srcAddress[alli++];
486  newSlots = srcSlots[srci];
487  // Renumber to new indices
489  (
490  newSlots,
491  localSize,
492  tgtStartOfLocal[inti],
493  tgtCompactMaps[inti],
494  AMI.tgtMap().constructHasFlip() //hasFlip
495  );
496 
497  for (const label slot : newSlots)
498  {
499  if
500  (
501  slot < 0
502  || slot >= tgtToSrcMap().constructSize()
503  )
504  {
505  FatalErrorInFunction << " newSlots:"
506  << newSlots << exit(FatalError);
507  }
508  }
509  }
510  }
511  }
512 
513  if (nSrc != alli)
514  {
515  FatalErrorInFunction << "nSrc:" << nSrc
516  << " alli:" << alli << exit(FatalError);
517  }
518  }
519 
520 
521  // Clean up: if no remote elements sent/received mark as
522  // non-distributed. We could do this at the start but this
523  // needs to take all the internal transport into account. Easier
524  // (but less efficient) to do afterwards now all is compacted.
525  {
526  const auto& map = srcToTgtMap().subMap();
527 
528  bool usesRemote = false;
529  forAll(map, proci)
530  {
531  if (proci != myAgglom)
532  {
533  const auto& ss = srcToTgtMap().subMap()[proci];
534  const auto& sc = srcToTgtMap().constructMap()[proci];
535  const auto& ts = tgtToSrcMap().subMap()[proci];
536  const auto& tc = tgtToSrcMap().constructMap()[proci];
537 
538  if (ss.size() || sc.size() || ts.size() || tc.size())
539  {
540  usesRemote = true;
541  break;
542  }
543  }
544  }
545 
546  if (!usesRemote)
547  {
548  //Pout<< "** making fully local on new rank "
549  // << myAgglom << " in comm:" << coarseComm << endl;
550  singlePatchProc = myAgglom;
551  srcToTgtMap.clear();
552  tgtToSrcMap.clear();
553  }
554  }
555  }
556  else
557  {
558  // src/tgt address are straight indices
559 
560  srcAddress.setSize(nSrc);
561  tgtAddress.setSize(nTgt);
562 
563  nSrc = 0;
564  nTgt = 0;
565  forAll(allInterfaces, inti)
566  {
567  if (allInterfaces.set(inti))
568  {
569  const auto& intf = refCast<const cyclicACMIGAMGInterface>
570  (
571  allInterfaces[inti]
572  );
573  const auto& AMI = intf.AMI();
574 
575  const auto& srcA = AMI.srcAddress();
576  if (srcAddress.size())
577  {
578  label srci = nSrc;
579  forAll(srcA, i)
580  {
581  srcAddress[srci++] = srcA[i]+nTgt;
582  }
583  }
584 
585  const auto& tgtA = AMI.tgtAddress();
586  if (tgtAddress.size())
587  {
588  label tgti = nTgt;
589  forAll(tgtA, i)
590  {
591  tgtAddress[tgti++] = tgtA[i]+nSrc;
592  }
593  }
594 
595  nSrc += srcA.size();
596  nTgt += tgtA.size();
597  }
598  }
599  }
600 
601  srcWeights.setSize(nSrc);
602  if (hasSrcMagSf)
603  {
604  srcMagSf.setSize(nSrc);
605  }
606  if (hasSrcCentroids)
607  {
608  srcCentroids.setSize(nSrc);
609  }
610  tgtWeights.setSize(nTgt);
611  if (hasTgtMagSf)
612  {
613  tgtMagSf.setSize(nTgt);
614  }
615 
616 
617  // Append individual data
618  nSrc = 0;
619  nTgt = 0;
620  forAll(allInterfaces, inti)
621  {
622  if (allInterfaces.set(inti))
623  {
624  const auto& intf = refCast<const cyclicACMIGAMGInterface>
625  (
626  allInterfaces[inti]
627  );
628  const auto& AMI = intf.AMI();
629 
630  const auto& srcA = AMI.srcAddress();
631  {
632  // weights
633  SubList<scalarList>(srcWeights, srcA.size(), nSrc) =
634  AMI.srcWeights();
635 
636  // magSf
637  if (hasSrcMagSf)
638  {
639  SubList<scalar>(srcMagSf, srcA.size(), nSrc) =
640  AMI.srcMagSf();
641  }
642 
643  // centroids
644  if (hasSrcCentroids)
645  {
646  SubList<pointList>(srcCentroids, srcA.size(), nSrc) =
647  AMI.srcCentroids();
648  }
649  }
650 
651  const auto& tgtA = AMI.tgtAddress();
652  {
653  // weights
654  SubList<scalarList>(tgtWeights, tgtA.size(), nTgt) =
655  AMI.tgtWeights();
656 
657  if (hasTgtMagSf)
658  {
659  SubList<scalar>(tgtMagSf, tgtA.size(), nTgt) =
660  AMI.tgtMagSf();
661  }
662  }
663 
664  nSrc += srcA.size();
665  nTgt += tgtA.size();
666  }
667  }
668 
669 
670  // Construct with same arguments as original
671  amiPtr_.reset
672  (
674  (
675  AMI.requireMatch(),
676  AMI.reverseTarget(),
678  )
679  );
680  amiPtr_().comm(coarseComm),
681  amiPtr_().reset
682  (
683  std::move(srcToTgtMap),
684  std::move(tgtToSrcMap),
685  std::move(srcAddress),
686  std::move(srcWeights),
687  std::move(tgtAddress),
688  std::move(tgtWeights),
689  singlePatchProc
690  );
691  amiPtr_().srcMagSf() = std::move(srcMagSf);
692  amiPtr_().srcCentroids() = std::move(srcCentroids);
693  amiPtr_().tgtMagSf() = std::move(tgtMagSf);
694  }
695 }
696 
697 
698 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
699 
702 (
703  const Pstream::commsTypes commsType,
704  const labelUList& iF
705 ) const
706 {
707  const cyclicACMIGAMGInterface& nbr =
708  dynamic_cast<const cyclicACMIGAMGInterface&>(neighbPatch());
709  const labelUList& nbrFaceCells = nbr.faceCells();
710 
711  auto tpnf = tmp<labelField>::New(nbrFaceCells.size());
712  labelField& pnf = tpnf.ref();
713 
714  forAll(pnf, facei)
715  {
716  pnf[facei] = iF[nbrFaceCells[facei]];
717  }
718 
719  return tpnf;
720 }
721 
722 
723 void Foam::cyclicACMIGAMGInterface::write(Ostream& os) const
724 {
726 
727  const bool hasAMI = amiPtr_.valid();
728 
729  os << token::SPACE << neighbPatchID_
730  << token::SPACE << owner_
731  << token::SPACE << forwardT_
732  << token::SPACE << reverseT_
733  << token::SPACE << hasAMI;
734 
735  if (hasAMI)
736  {
737  os << token::SPACE;
738  AMI().writeData(os);
739  }
740 }
741 
742 
743 // ************************************************************************* //
List< scalar > scalarList
List of scalar.
Definition: scalarList.H:32
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
Definition: ListOps.H:795
GAMG agglomerated cyclic ACMI interface.
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
const pointListList & srcCentroids() const
Return const access to source patch face centroids.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
commsTypes
Communications types.
Definition: UPstream.H:72
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
Definition: List.C:326
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
const scalarListList & tgtWeights() const
Return const access to target patch weights.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
void append(const T &val)
Append an element at the end of the list.
Definition: List.H:517
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
virtual const labelUList & faceCells() const
Return faceCell addressing.
const mapDistribute & srcMap() const
Source map - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by t...
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
Definition: typeInfo.H:159
virtual void write(Ostream &) const
Write to stream.
const labelListList & tgtAddress() const
Return const access to target patch addressing.
bool requireMatch() const noexcept
Return the requireMatch flag.
label singlePatchProc() const noexcept
The processor holding all faces (both sides), or -1 if distributed.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition: label.H:63
labelList faceRestrictAddressing_
Face restrict addressing.
Definition: GAMGInterface.H:76
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
Definition: UPstream.H:1074
bool distributed() const noexcept
Distributed across processors (singlePatchProc == -1)
List< labelList > labelListList
List of labelList.
Definition: labelList.H:38
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
Definition: UList.H:78
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
Definition: UPstream.H:1065
void setSize(const label n)
Alias for resize()
Definition: List.H:316
const List< scalar > & tgtMagSf() const
Return const access to target patch face areas.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
Definition: ListOps.C:107
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
Definition: HashTableI.H:113
List< scalarList > scalarListList
List of scalarList.
Definition: scalarList.H:35
Space [isspace].
Definition: token.H:131
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
An abstract base class for cyclic ACMI coupled interfaces.
const scalarListList & srcWeights() const
Return const access to source patch weights.
bool constructHasFlip() const noexcept
Does constructMap include a sign.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
bool reverseTarget() const noexcept
Access to the reverseTarget flag.
const List< scalar > & srcMagSf() const
Return const access to source patch face areas.
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:50
virtual void write(Ostream &) const =0
Write to stream.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
virtual const AMIPatchToPatchInterpolation & AMI() const
labelList faceCells_
Face-cell addressing.
Definition: GAMGInterface.H:71
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
List< label > labelList
A List of labels.
Definition: List.H:62
const mapDistribute & tgtMap() const
Target map - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by sr...
List< pointList > pointListList
List of pointList.
Definition: pointList.H:35
A class for managing temporary objects.
Definition: HashPtrTable.H:50
scalar lowWeightCorrection() const
Threshold weight below which interpolation is deactivated.
const labelListList & srcAddress() const
Return const access to source patch addressing.
bool readBool(Istream &is)
Read bool from stream using Foam::Switch(Istream&)
Definition: bool.C:62
label comm() const
Communicator to use for parallel operations.
Namespace for OpenFOAM.
static label renumberMap(labelListList &mapElements, const labelUList &oldToNew, const bool hasFlip)
Helper for renumbering the (compacted) map elements using the supplied old-to-new mapping...
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)