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