GAMGSolverAgglomerateMatrix.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 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 "GAMGSolver.H"
30 #include "GAMGInterfaceField.H"
33 
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 
36 void Foam::GAMGSolver::agglomerateMatrix
37 (
38  const label fineLevelIndex,
39  const lduMesh& coarseMesh,
40  const lduInterfacePtrsList& coarseMeshInterfaces
41 )
42 {
43  // Get fine matrix
44  const lduMatrix& fineMatrix = matrixLevel(fineLevelIndex);
45 
46  if (UPstream::myProcNo(fineMatrix.mesh().comm()) != -1)
47  {
48  const label nCoarseFaces = agglomeration_.nFaces(fineLevelIndex);
49  const label nCoarseCells = agglomeration_.nCells(fineLevelIndex);
50 
51  // Set the coarse level matrix
52  matrixLevels_.set
53  (
54  fineLevelIndex,
55  new lduMatrix(coarseMesh)
56  );
57  lduMatrix& coarseMatrix = matrixLevels_[fineLevelIndex];
58 
59 
60  // Coarse matrix diagonal initialised by restricting the finer mesh
61  // diagonal. Note that we size with the cached coarse nCells and not
62  // the actual coarseMesh size since this might be dummy when processor
63  // agglomerating.
64  scalarField& coarseDiag = coarseMatrix.diag(nCoarseCells);
65 
66  agglomeration_.restrictField
67  (
68  coarseDiag,
69  fineMatrix.diag(),
70  fineLevelIndex,
71  false // no processor agglomeration
72  );
73 
74  // Get reference to fine-level interfaces
75  const lduInterfaceFieldPtrsList& fineInterfaces =
76  interfaceLevel(fineLevelIndex);
77 
78  // Create coarse-level interfaces
79  primitiveInterfaceLevels_.set
80  (
81  fineLevelIndex,
82  new PtrList<lduInterfaceField>(fineInterfaces.size())
83  );
84 
85  PtrList<lduInterfaceField>& coarsePrimInterfaces =
86  primitiveInterfaceLevels_[fineLevelIndex];
87 
88  interfaceLevels_.set
89  (
90  fineLevelIndex,
91  new lduInterfaceFieldPtrsList(fineInterfaces.size())
92  );
93 
94  lduInterfaceFieldPtrsList& coarseInterfaces =
95  interfaceLevels_[fineLevelIndex];
96 
97  // Set coarse-level boundary coefficients
98  interfaceLevelsBouCoeffs_.set
99  (
100  fineLevelIndex,
101  new FieldField<Field, scalar>(fineInterfaces.size())
102  );
103  FieldField<Field, scalar>& coarseInterfaceBouCoeffs =
104  interfaceLevelsBouCoeffs_[fineLevelIndex];
105 
106  // Set coarse-level internal coefficients
107  interfaceLevelsIntCoeffs_.set
108  (
109  fineLevelIndex,
110  new FieldField<Field, scalar>(fineInterfaces.size())
111  );
112  FieldField<Field, scalar>& coarseInterfaceIntCoeffs =
113  interfaceLevelsIntCoeffs_[fineLevelIndex];
114 
115  // Add the coarse level
116  agglomerateInterfaceCoefficients
117  (
118  fineLevelIndex,
119  coarseMeshInterfaces,
120  coarsePrimInterfaces,
121  coarseInterfaces,
122  coarseInterfaceBouCoeffs,
123  coarseInterfaceIntCoeffs
124  );
125 
126 
127  // Get face restriction map for current level
128  const labelList& faceRestrictAddr =
129  agglomeration_.faceRestrictAddressing(fineLevelIndex);
130  const boolList& faceFlipMap =
131  agglomeration_.faceFlipMap(fineLevelIndex);
132 
133  // Check if matrix is asymmetric and if so agglomerate both upper
134  // and lower coefficients ...
135  if (fineMatrix.hasLower())
136  {
137  // Get off-diagonal matrix coefficients
138  const scalarField& fineUpper = fineMatrix.upper();
139  const scalarField& fineLower = fineMatrix.lower();
140 
141  // Coarse matrix upper coefficients. Note passed in size
142  scalarField& coarseUpper = coarseMatrix.upper(nCoarseFaces);
143  scalarField& coarseLower = coarseMatrix.lower(nCoarseFaces);
144 
145  forAll(faceRestrictAddr, fineFacei)
146  {
147  label cFace = faceRestrictAddr[fineFacei];
148 
149  if (cFace >= 0)
150  {
151  // Check the orientation of the fine-face relative to the
152  // coarse face it is being agglomerated into
153  if (!faceFlipMap[fineFacei])
154  {
155  coarseUpper[cFace] += fineUpper[fineFacei];
156  coarseLower[cFace] += fineLower[fineFacei];
157  }
158  else
159  {
160  coarseUpper[cFace] += fineLower[fineFacei];
161  coarseLower[cFace] += fineUpper[fineFacei];
162  }
163  }
164  else
165  {
166  // Add the fine face coefficients into the diagonal.
167  coarseDiag[-1 - cFace] +=
168  fineUpper[fineFacei] + fineLower[fineFacei];
169  }
170  }
171  }
172  else // ... Otherwise it is symmetric so agglomerate just the upper
173  {
174  // Get off-diagonal matrix coefficients
175  const scalarField& fineUpper = fineMatrix.upper();
176 
177  // Coarse matrix upper coefficients
178  scalarField& coarseUpper = coarseMatrix.upper(nCoarseFaces);
179 
180  forAll(faceRestrictAddr, fineFacei)
181  {
182  label cFace = faceRestrictAddr[fineFacei];
183 
184  if (cFace >= 0)
185  {
186  coarseUpper[cFace] += fineUpper[fineFacei];
187  }
188  else
189  {
190  // Add the fine face coefficient into the diagonal.
191  coarseDiag[-1 - cFace] += 2*fineUpper[fineFacei];
192  }
193  }
194  }
195  }
196 }
197 
198 
199 void Foam::GAMGSolver::agglomerateInterfaceCoefficients
200 (
201  const label fineLevelIndex,
202  const lduInterfacePtrsList& coarseMeshInterfaces,
203  PtrList<lduInterfaceField>& coarsePrimInterfaces,
204  lduInterfaceFieldPtrsList& coarseInterfaces,
205  FieldField<Field, scalar>& coarseInterfaceBouCoeffs,
206  FieldField<Field, scalar>& coarseInterfaceIntCoeffs
207 ) const
208 {
209  // Get reference to fine-level interfaces
210  const lduInterfaceFieldPtrsList& fineInterfaces =
211  interfaceLevel(fineLevelIndex);
212 
213  // Get reference to fine-level boundary coefficients
214  const FieldField<Field, scalar>& fineInterfaceBouCoeffs =
215  interfaceBouCoeffsLevel(fineLevelIndex);
216 
217  // Get reference to fine-level internal coefficients
218  const FieldField<Field, scalar>& fineInterfaceIntCoeffs =
219  interfaceIntCoeffsLevel(fineLevelIndex);
220 
221  const labelListList& patchFineToCoarse =
222  agglomeration_.patchFaceRestrictAddressing(fineLevelIndex);
223 
224  const labelList& nPatchFaces =
225  agglomeration_.nPatchFaces(fineLevelIndex);
226 
227 
228  // Add the coarse level
229  forAll(fineInterfaces, inti)
230  {
231  if (fineInterfaces.set(inti))
232  {
233  const GAMGInterface& coarseInterface =
234  refCast<const GAMGInterface>
235  (
236  coarseMeshInterfaces[inti]
237  );
238 
239  coarsePrimInterfaces.set
240  (
241  inti,
243  (
244  coarseInterface,
245  fineInterfaces[inti]
246  ).ptr()
247  );
248  coarseInterfaces.set
249  (
250  inti,
251  &coarsePrimInterfaces[inti]
252  );
253 
254  const labelList& faceRestrictAddressing = patchFineToCoarse[inti];
255 
256  coarseInterfaceBouCoeffs.set
257  (
258  inti,
259  new scalarField(nPatchFaces[inti], Zero)
260  );
261  agglomeration_.restrictField
262  (
263  coarseInterfaceBouCoeffs[inti],
264  fineInterfaceBouCoeffs[inti],
265  faceRestrictAddressing
266  );
267 
268  coarseInterfaceIntCoeffs.set
269  (
270  inti,
271  new scalarField(nPatchFaces[inti], Zero)
272  );
273  agglomeration_.restrictField
274  (
275  coarseInterfaceIntCoeffs[inti],
276  fineInterfaceIntCoeffs[inti],
277  faceRestrictAddressing
278  );
279  }
280  }
281 }
282 
283 
284 void Foam::GAMGSolver::gatherMatrices
285 (
286  const labelList& procIDs,
287  const lduMesh& dummyMesh,
288  const label meshComm,
289 
290  const lduMatrix& mat,
291  const FieldField<Field, scalar>& interfaceBouCoeffs,
292  const FieldField<Field, scalar>& interfaceIntCoeffs,
293  const lduInterfaceFieldPtrsList& interfaces,
294 
295  PtrList<lduMatrix>& otherMats,
296  PtrList<FieldField<Field, scalar>>& otherBouCoeffs,
297  PtrList<FieldField<Field, scalar>>& otherIntCoeffs,
298  List<boolList>& otherTransforms,
299  List<List<label>>& otherRanks
300 ) const
301 {
302  if (debug & 2)
303  {
304  Pout<< "GAMGSolver::gatherMatrices :"
305  << " collecting matrices from procs:" << procIDs
306  << " using comm:" << meshComm << endl;
307  }
308 
309  if (Pstream::myProcNo(meshComm) == procIDs[0])
310  {
311  // Master.
312  otherMats.setSize(procIDs.size()-1);
313  otherBouCoeffs.setSize(procIDs.size()-1);
314  otherIntCoeffs.setSize(procIDs.size()-1);
315  otherTransforms.setSize(procIDs.size()-1);
316  otherRanks.setSize(procIDs.size()-1);
317 
318  for (label proci = 1; proci < procIDs.size(); proci++)
319  {
320  label otherI = proci-1;
321 
322  IPstream fromProc
323  (
325  procIDs[proci],
326  0, // bufSize
328  meshComm
329  );
330 
331  otherMats.set(otherI, new lduMatrix(dummyMesh, fromProc));
332 
333  // Receive number of/valid interfaces
334  boolList& procTransforms = otherTransforms[otherI];
335  List<label>& procRanks = otherRanks[otherI];
336 
337  fromProc >> procTransforms;
338  fromProc >> procRanks;
339 
340  // Size coefficients
341  otherBouCoeffs.set
342  (
343  otherI,
344  new FieldField<Field, scalar>(procRanks.size())
345  );
346  otherIntCoeffs.set
347  (
348  otherI,
349  new FieldField<Field, scalar>(procRanks.size())
350  );
351  forAll(procRanks, intI)
352  {
353  if (procRanks[intI] != -1)
354  {
355  otherBouCoeffs[otherI].set
356  (
357  intI,
358  new scalarField(fromProc)
359  );
360  otherIntCoeffs[otherI].set
361  (
362  intI,
363  new scalarField(fromProc)
364  );
365  }
366  }
367  }
368  }
369  else
370  {
371  // Send to master
372 
373  // Count valid interfaces
374  boolList procTransforms(interfaceBouCoeffs.size(), false);
375  List<label> procRanks(interfaceBouCoeffs.size(), -1);
376  forAll(interfaces, intI)
377  {
378  if (interfaces.set(intI))
379  {
380  const processorLduInterfaceField& interface =
381  refCast<const processorLduInterfaceField>
382  (
383  interfaces[intI]
384  );
385 
386  procTransforms[intI] = interface.doTransform();
387  procRanks[intI] = interface.rank();
388  }
389  }
390 
391  OPstream toMaster
392  (
394  procIDs[0],
395  0,
397  meshComm
398  );
399 
400  toMaster << mat << procTransforms << procRanks;
401  forAll(procRanks, intI)
402  {
403  if (procRanks[intI] != -1)
404  {
405  toMaster
406  << interfaceBouCoeffs[intI]
407  << interfaceIntCoeffs[intI];
408  }
409  }
410  }
411 }
412 
413 
414 void Foam::GAMGSolver::procAgglomerateMatrix
415 (
416  // Agglomeration information
417  const labelList& procAgglomMap,
418  const List<label>& agglomProcIDs,
419 
420  const label levelI,
421 
422  // Resulting matrix
423  autoPtr<lduMatrix>& allMatrixPtr,
424  FieldField<Field, scalar>& allInterfaceBouCoeffs,
425  FieldField<Field, scalar>& allInterfaceIntCoeffs,
426  PtrList<lduInterfaceField>& allPrimitiveInterfaces,
427  lduInterfaceFieldPtrsList& allInterfaces
428 ) const
429 {
430  const lduMatrix& coarsestMatrix = matrixLevels_[levelI];
431  const lduInterfaceFieldPtrsList& coarsestInterfaces =
432  interfaceLevels_[levelI];
433  const FieldField<Field, scalar>& coarsestBouCoeffs =
434  interfaceLevelsBouCoeffs_[levelI];
435  const FieldField<Field, scalar>& coarsestIntCoeffs =
436  interfaceLevelsIntCoeffs_[levelI];
437  const lduMesh& coarsestMesh = coarsestMatrix.mesh();
438 
439  label coarseComm = coarsestMesh.comm();
440 
441  // Gather all matrix coefficients onto agglomProcIDs[0]
442  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
443 
444  PtrList<lduMatrix> otherMats;
445  PtrList<FieldField<Field, scalar>> otherBouCoeffs;
446  PtrList<FieldField<Field, scalar>> otherIntCoeffs;
447  List<boolList> otherTransforms;
448  List<List<label>> otherRanks;
449  gatherMatrices
450  (
451  agglomProcIDs,
452  coarsestMesh,
453  coarseComm,
454 
455  coarsestMatrix,
456  coarsestBouCoeffs,
457  coarsestIntCoeffs,
458  coarsestInterfaces,
459 
460  otherMats,
461  otherBouCoeffs,
462  otherIntCoeffs,
463  otherTransforms,
464  otherRanks
465  );
466 
467 
468  if (Pstream::myProcNo(coarseComm) == agglomProcIDs[0])
469  {
470  // Agglomerate all matrix
471  // ~~~~~~~~~~~~~~~~~~~~~~
472 
473  //Pout<< "Own matrix:" << coarsestMatrix.info() << endl;
474  //
475  //forAll(otherMats, i)
476  //{
477  // Pout<< "** otherMats " << i << " "
478  // << otherMats[i].info()
479  // << endl;
480  //}
481  //Pout<< endl;
482 
483 
484  const lduMesh& allMesh = agglomeration_.meshLevel(levelI+1);
485  const labelList& cellOffsets = agglomeration_.cellOffsets(levelI+1);
486  const labelListList& faceMap = agglomeration_.faceMap(levelI+1);
487  const labelListList& boundaryMap = agglomeration_.boundaryMap(levelI+1);
488  const labelListListList& boundaryFaceMap =
489  agglomeration_.boundaryFaceMap(levelI+1);
490 
491  allMatrixPtr.reset(new lduMatrix(allMesh));
492  lduMatrix& allMatrix = allMatrixPtr();
493 
494  if (coarsestMatrix.hasDiag())
495  {
496  scalarField& allDiag = allMatrix.diag();
497 
498  SubList<scalar>
499  (
500  allDiag,
501  coarsestMatrix.diag().size()
502  ) = coarsestMatrix.diag();
503 
504  forAll(otherMats, i)
505  {
506  SubList<scalar>
507  (
508  allDiag,
509  otherMats[i].diag().size(),
510  cellOffsets[i+1]
511  ) = otherMats[i].diag();
512  }
513  }
514  if (coarsestMatrix.hasLower())
515  {
516  scalarField& allLower = allMatrix.lower();
517  UIndirectList<scalar>
518  (
519  allLower,
520  faceMap[0]
521  ) = coarsestMatrix.lower();
522  forAll(otherMats, i)
523  {
524  UIndirectList<scalar>
525  (
526  allLower,
527  faceMap[i+1]
528  ) = otherMats[i].lower();
529  }
530  }
531  if (coarsestMatrix.hasUpper())
532  {
533  scalarField& allUpper = allMatrix.upper();
534  UIndirectList<scalar>
535  (
536  allUpper,
537  faceMap[0]
538  ) = coarsestMatrix.upper();
539  forAll(otherMats, i)
540  {
541  UIndirectList<scalar>
542  (
543  allUpper,
544  faceMap[i+1]
545  ) = otherMats[i].upper();
546  }
547  }
548 
549 
550  // Agglomerate interface fields and coefficients
551  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
552 
553  lduInterfacePtrsList allMeshInterfaces = allMesh.interfaces();
554 
555  allInterfaceBouCoeffs.setSize(allMeshInterfaces.size());
556  allInterfaceIntCoeffs.setSize(allMeshInterfaces.size());
557  allPrimitiveInterfaces.setSize(allMeshInterfaces.size());
558  allInterfaces.setSize(allMeshInterfaces.size());
559 
560  forAll(allMeshInterfaces, intI)
561  {
562  const lduInterface& patch = allMeshInterfaces[intI];
563  label size = patch.faceCells().size();
564 
565  allInterfaceBouCoeffs.set(intI, new scalarField(size));
566  allInterfaceIntCoeffs.set(intI, new scalarField(size));
567  }
568 
569  labelList nBounFaces(allMeshInterfaces.size());
570  forAll(boundaryMap, proci)
571  {
572  const FieldField<Field, scalar>& procBouCoeffs
573  (
574  (proci == 0)
575  ? coarsestBouCoeffs
576  : otherBouCoeffs[proci-1]
577  );
578  const FieldField<Field, scalar>& procIntCoeffs
579  (
580  (proci == 0)
581  ? coarsestIntCoeffs
582  : otherIntCoeffs[proci-1]
583  );
584 
585  const labelList& bMap = boundaryMap[proci];
586  forAll(bMap, procIntI)
587  {
588  label allIntI = bMap[procIntI];
589 
590  if (allIntI != -1)
591  {
592  // So this boundary has been preserved. Copy
593  // data across.
594 
595  if (!allInterfaces.set(allIntI))
596  {
597  // Construct lduInterfaceField
598 
599  bool doTransform = false;
600  int rank = -1;
601  if (proci == 0)
602  {
603  const processorGAMGInterfaceField& procInt =
604  refCast
605  <
606  const processorGAMGInterfaceField
607  >
608  (
609  coarsestInterfaces[procIntI]
610  );
611  doTransform = procInt.doTransform();
612  rank = procInt.rank();
613  }
614  else
615  {
616  doTransform =
617  otherTransforms[proci-1][procIntI];
618  rank = otherRanks[proci-1][procIntI];
619  }
620 
621  allPrimitiveInterfaces.set
622  (
623  allIntI,
625  (
626  refCast<const GAMGInterface>
627  (
628  allMeshInterfaces[allIntI]
629  ),
630  doTransform,
631  rank
632  ).ptr()
633  );
634  allInterfaces.set
635  (
636  allIntI,
637  &allPrimitiveInterfaces[allIntI]
638  );
639  }
640 
641 
642  // Map data from processor to complete mesh
643 
644  scalarField& allBou = allInterfaceBouCoeffs[allIntI];
645  scalarField& allInt = allInterfaceIntCoeffs[allIntI];
646 
647  const labelList& map = boundaryFaceMap[proci][procIntI];
648 
649  const scalarField& procBou = procBouCoeffs[procIntI];
650  const scalarField& procInt = procIntCoeffs[procIntI];
651 
652  forAll(map, i)
653  {
654  label allFacei = map[i];
655  if (allFacei < 0)
656  {
658  << "problem." << abort(FatalError);
659  }
660  allBou[allFacei] = procBou[i];
661  allInt[allFacei] = procInt[i];
662  }
663  }
664  else if (procBouCoeffs.set(procIntI))
665  {
666  // Boundary has become internal face
667 
668  const labelList& map = boundaryFaceMap[proci][procIntI];
669  const scalarField& procBou = procBouCoeffs[procIntI];
670  const scalarField& procInt = procIntCoeffs[procIntI];
671 
672 
673  forAll(map, i)
674  {
675  if (map[i] >= 0)
676  {
677  label allFacei = map[i];
678 
679  if (coarsestMatrix.hasUpper())
680  {
681  allMatrix.upper()[allFacei] = -procBou[i];
682  }
683  if (coarsestMatrix.hasLower())
684  {
685  allMatrix.lower()[allFacei] = -procInt[i];
686  }
687  }
688  else
689  {
690  label allFacei = -map[i]-1;
691 
692  if (coarsestMatrix.hasUpper())
693  {
694  allMatrix.upper()[allFacei] = -procInt[i];
695  }
696  if (coarsestMatrix.hasLower())
697  {
698  allMatrix.lower()[allFacei] = -procBou[i];
699  }
700  }
701  }
702  }
703  }
704  }
705 
706  //Pout<< "** Assembled allMatrix:" << allMatrix.info() << endl;
707  //
708  //forAll(allInterfaces, intI)
709  //{
710  // if (allInterfaces.set(intI))
711  // {
712  // Pout<< " patch:" << intI
713  // << " type:" << allInterfaces[intI].type()
714  // << " size:"
715  // << allInterfaces[intI].interface().
716  // faceCells().size()
717  // << endl;
718  //
719  // //const scalarField& bouCoeffs = allInterfaceBouCoeffs[intI];
720  // //const scalarField& intCoeffs = allInterfaceIntCoeffs[intI];
721  // //forAll(bouCoeffs, facei)
722  // //{
723  // // Pout<< " " << facei
724  // // << "\tbou:" << bouCoeffs[facei]
725  // // << "\tint:" << intCoeffs[facei]
726  // // << endl;
727  // //}
728  // }
729  //}
730  }
731 }
732 
733 
734 void Foam::GAMGSolver::procAgglomerateMatrix
735 (
736  const labelList& procAgglomMap,
737  const List<label>& agglomProcIDs,
738 
739  const label levelI
740 )
741 {
742  autoPtr<lduMatrix> allMatrixPtr;
743  autoPtr<FieldField<Field, scalar>> allInterfaceBouCoeffs
744  (
745  new FieldField<Field, scalar>(0)
746  );
747  autoPtr<FieldField<Field, scalar>> allInterfaceIntCoeffs
748  (
749  new FieldField<Field, scalar>(0)
750  );
751  autoPtr<PtrList<lduInterfaceField>> allPrimitiveInterfaces
752  (
753  new PtrList<lduInterfaceField>(0)
754  );
755  autoPtr<lduInterfaceFieldPtrsList> allInterfaces
756  (
758  );
759 
760  procAgglomerateMatrix
761  (
762  // Agglomeration information
763  procAgglomMap,
764  agglomProcIDs,
765 
766  levelI,
767 
768  // Resulting matrix
769  allMatrixPtr,
770  allInterfaceBouCoeffs(),
771  allInterfaceIntCoeffs(),
772  allPrimitiveInterfaces(),
773  allInterfaces()
774  );
775 
776  matrixLevels_.set(levelI, allMatrixPtr);
777  interfaceLevelsBouCoeffs_.set(levelI, allInterfaceBouCoeffs);
778  interfaceLevelsIntCoeffs_.set(levelI, allInterfaceIntCoeffs);
779  primitiveInterfaceLevels_.set(levelI, allPrimitiveInterfaces);
780  interfaceLevels_.set(levelI, allInterfaces);
781 }
782 
783 
784 // ************************************************************************* //
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
const labelList & faceRestrictAddressing(const label leveli) const
Return face restrict addressing of given level.
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
Restrict (integrate by summation) cell field.
const boolList & faceFlipMap(const label leveli) const
Return face flip map of given level.
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:578
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Definition: List.H:472
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
Definition: stringOps.C:1186
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:1184
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
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:1029
List< labelList > labelListList
List of labelList.
Definition: labelList.H:38
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:414
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
"scheduled" : (MPI_Send, MPI_Recv)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
List< labelListList > labelListListList
List of labelListList.
Definition: labelList.H:41
errorManip< error > abort(error &err)
Definition: errorManip.H:139
int debug
Static debugging option.
label nFaces(const label leveli) const
Return number of coarse faces (before processor agglomeration)
static autoPtr< GAMGInterfaceField > New(const GAMGInterface &GAMGCp, const lduInterfaceField &fineInterface)
Return a pointer to a new interface created on freestore given.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
Definition: stringOps.C:1170
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
Definition: List.H:62
void setSize(const label n)
Alias for resize()
Definition: UPtrList.H:830
List< bool > boolList
A List of bools.
Definition: List.H:60
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
label nCells(const label leveli) const
Return number of coarse cells (before processor agglomeration)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:133