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