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-2015 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 
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 // Agglomerate only the interface coefficients.
198 (
199  const label fineLevelIndex,
200  const lduInterfacePtrsList& coarseMeshInterfaces,
201  PtrList<lduInterfaceField>& coarsePrimInterfaces,
202  lduInterfaceFieldPtrsList& coarseInterfaces,
203  FieldField<Field, scalar>& coarseInterfaceBouCoeffs,
204  FieldField<Field, scalar>& coarseInterfaceIntCoeffs
205 ) const
206 {
207  // Get reference to fine-level interfaces
208  const lduInterfaceFieldPtrsList& fineInterfaces =
209  interfaceLevel(fineLevelIndex);
210 
211  // Get reference to fine-level boundary coefficients
212  const FieldField<Field, scalar>& fineInterfaceBouCoeffs =
213  interfaceBouCoeffsLevel(fineLevelIndex);
214 
215  // Get reference to fine-level internal coefficients
216  const FieldField<Field, scalar>& fineInterfaceIntCoeffs =
217  interfaceIntCoeffsLevel(fineLevelIndex);
218 
219  const labelListList& patchFineToCoarse =
220  agglomeration_.patchFaceRestrictAddressing(fineLevelIndex);
221 
222  const labelList& nPatchFaces =
223  agglomeration_.nPatchFaces(fineLevelIndex);
224 
225 
226  // Add the coarse level
227  forAll(fineInterfaces, inti)
228  {
229  if (fineInterfaces.set(inti))
230  {
231  const GAMGInterface& coarseInterface =
232  refCast<const GAMGInterface>
233  (
234  coarseMeshInterfaces[inti]
235  );
236 
237  coarsePrimInterfaces.set
238  (
239  inti,
241  (
242  coarseInterface,
243  fineInterfaces[inti]
244  ).ptr()
245  );
246  coarseInterfaces.set
247  (
248  inti,
249  &coarsePrimInterfaces[inti]
250  );
251 
252  const labelList& faceRestrictAddressing = patchFineToCoarse[inti];
253 
254  coarseInterfaceBouCoeffs.set
255  (
256  inti,
257  new scalarField(nPatchFaces[inti], 0.0)
258  );
259  agglomeration_.restrictField
260  (
261  coarseInterfaceBouCoeffs[inti],
262  fineInterfaceBouCoeffs[inti],
263  faceRestrictAddressing
264  );
265 
266  coarseInterfaceIntCoeffs.set
267  (
268  inti,
269  new scalarField(nPatchFaces[inti], 0.0)
270  );
271  agglomeration_.restrictField
272  (
273  coarseInterfaceIntCoeffs[inti],
274  fineInterfaceIntCoeffs[inti],
275  faceRestrictAddressing
276  );
277  }
278  }
279 }
280 
281 
282 // Gather matrices.
283 // Note: matrices get constructed with dummy mesh
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)
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 fromSlave
323  (
324  Pstream::scheduled,
325  procIDs[procI],
326  0, // bufSize
327  Pstream::msgType(),
328  meshComm
329  );
330 
331  otherMats.set(otherI, new lduMatrix(dummyMesh, fromSlave));
332 
333  // Receive number of/valid interfaces
334  boolList& procTransforms = otherTransforms[otherI];
335  List<label>& procRanks = otherRanks[otherI];
336 
337  fromSlave >> procTransforms;
338  fromSlave >> 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(fromSlave)
359  );
360  otherIntCoeffs[otherI].set
361  (
362  intI,
363  new scalarField(fromSlave)
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 =
382  (
383  interfaces[intI]
384  );
385 
386  procTransforms[intI] = interface.doTransform();
387  procRanks[intI] = interface.rank();
388  }
389  }
390 
391  OPstream toMaster
392  (
393  Pstream::scheduled,
394  procIDs[0],
395  0,
396  Pstream::msgType(),
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 
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 
440  label coarseComm = coarsestMesh.comm();
441 
442  label oldWarn = UPstream::warnComm;
443  UPstream::warnComm = coarseComm;
444 
445 
446 
447  // Gather all matrix coefficients onto agglomProcIDs[0]
448  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449 
450  PtrList<lduMatrix> otherMats;
451  PtrList<FieldField<Field, scalar> > otherBouCoeffs;
452  PtrList<FieldField<Field, scalar> > otherIntCoeffs;
453  List<boolList> otherTransforms;
454  List<List<label> > otherRanks;
455  gatherMatrices
456  (
457  agglomProcIDs,
458  coarsestMesh,
459  coarseComm,
460 
461  coarsestMatrix,
462  coarsestBouCoeffs,
463  coarsestIntCoeffs,
464  coarsestInterfaces,
465 
466  otherMats,
467  otherBouCoeffs,
468  otherIntCoeffs,
469  otherTransforms,
470  otherRanks
471  );
472 
473 
474  if (Pstream::myProcNo(coarseComm) == agglomProcIDs[0])
475  {
476  // Agglomerate all matrix
477  // ~~~~~~~~~~~~~~~~~~~~~~
478 
479  //Pout<< "Own matrix:" << coarsestMatrix.info() << endl;
480  //
481  //forAll(otherMats, i)
482  //{
483  // Pout<< "** otherMats " << i << " "
484  // << otherMats[i].info()
485  // << endl;
486  //}
487  //Pout<< endl;
488 
489 
490  const lduMesh& allMesh = agglomeration_.meshLevel(levelI+1);
491  const labelList& cellOffsets = agglomeration_.cellOffsets(levelI+1);
492  const labelListList& faceMap = agglomeration_.faceMap(levelI+1);
493  const labelListList& boundaryMap = agglomeration_.boundaryMap(levelI+1);
494  const labelListListList& boundaryFaceMap =
495  agglomeration_.boundaryFaceMap(levelI+1);
496 
497  allMatrixPtr.reset(new lduMatrix(allMesh));
498  lduMatrix& allMatrix = allMatrixPtr();
499 
500  if (coarsestMatrix.hasDiag())
501  {
502  scalarField& allDiag = allMatrix.diag();
504  (
505  allDiag,
506  coarsestMatrix.diag().size()
507  ).assign
508  (
509  coarsestMatrix.diag()
510  );
511  forAll(otherMats, i)
512  {
514  (
515  allDiag,
516  otherMats[i].diag().size(),
517  cellOffsets[i+1]
518  ).assign
519  (
520  otherMats[i].diag()
521  );
522  }
523  }
524  if (coarsestMatrix.hasLower())
525  {
526  scalarField& allLower = allMatrix.lower();
528  (
529  allLower,
530  faceMap[0]
531  ) = coarsestMatrix.lower();
532  forAll(otherMats, i)
533  {
535  (
536  allLower,
537  faceMap[i+1]
538  ) = otherMats[i].lower();
539  }
540  }
541  if (coarsestMatrix.hasUpper())
542  {
543  scalarField& allUpper = allMatrix.upper();
545  (
546  allUpper,
547  faceMap[0]
548  ) = coarsestMatrix.upper();
549  forAll(otherMats, i)
550  {
552  (
553  allUpper,
554  faceMap[i+1]
555  ) = otherMats[i].upper();
556  }
557  }
558 
559 
560  // Agglomerate interface fields and coefficients
561  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
562 
563  lduInterfacePtrsList allMeshInterfaces = allMesh.interfaces();
564 
565  allInterfaceBouCoeffs.setSize(allMeshInterfaces.size());
566  allInterfaceIntCoeffs.setSize(allMeshInterfaces.size());
567  allPrimitiveInterfaces.setSize(allMeshInterfaces.size());
568  allInterfaces.setSize(allMeshInterfaces.size());
569 
570  forAll(allMeshInterfaces, intI)
571  {
572  const lduInterface& patch = allMeshInterfaces[intI];
573  label size = patch.faceCells().size();
574 
575  allInterfaceBouCoeffs.set(intI, new scalarField(size));
576  allInterfaceIntCoeffs.set(intI, new scalarField(size));
577  }
578 
579  labelList nBounFaces(allMeshInterfaces.size());
580  forAll(boundaryMap, procI)
581  {
582  const FieldField<Field, scalar>& procBouCoeffs
583  (
584  (procI == 0)
585  ? coarsestBouCoeffs
586  : otherBouCoeffs[procI-1]
587  );
588  const FieldField<Field, scalar>& procIntCoeffs
589  (
590  (procI == 0)
591  ? coarsestIntCoeffs
592  : otherIntCoeffs[procI-1]
593  );
594 
595  const labelList& bMap = boundaryMap[procI];
596  forAll(bMap, procIntI)
597  {
598  label allIntI = bMap[procIntI];
599 
600  if (allIntI != -1)
601  {
602  // So this boundary has been preserved. Copy
603  // data across.
604 
605  if (!allInterfaces.set(allIntI))
606  {
607  // Construct lduInterfaceField
608 
609  bool doTransform = false;
610  int rank = -1;
611  if (procI == 0)
612  {
613  const processorGAMGInterfaceField& procInt =
614  refCast
615  <
617  >
618  (
619  coarsestInterfaces[procIntI]
620  );
621  doTransform = procInt.doTransform();
622  rank = procInt.rank();
623  }
624  else
625  {
626  doTransform =
627  otherTransforms[procI-1][procIntI];
628  rank = otherRanks[procI-1][procIntI];
629  }
630 
631  allPrimitiveInterfaces.set
632  (
633  allIntI,
635  (
636  refCast<const GAMGInterface>
637  (
638  allMeshInterfaces[allIntI]
639  ),
640  doTransform,
641  rank
642  ).ptr()
643  );
644  allInterfaces.set
645  (
646  allIntI,
647  &allPrimitiveInterfaces[allIntI]
648  );
649  }
650 
651 
652  // Map data from processor to complete mesh
653 
654  scalarField& allBou = allInterfaceBouCoeffs[allIntI];
655  scalarField& allInt = allInterfaceIntCoeffs[allIntI];
656 
657  const labelList& map = boundaryFaceMap[procI][procIntI];
658 
659  const scalarField& procBou = procBouCoeffs[procIntI];
660  const scalarField& procInt = procIntCoeffs[procIntI];
661 
662  forAll(map, i)
663  {
664  label allFaceI = map[i];
665  if (allFaceI < 0)
666  {
668  << "problem." << abort(FatalError);
669  }
670  allBou[allFaceI] = procBou[i];
671  allInt[allFaceI] = procInt[i];
672  }
673  }
674  else if (procBouCoeffs.set(procIntI))
675  {
676  // Boundary has become internal face
677 
678  const labelList& map = boundaryFaceMap[procI][procIntI];
679  const scalarField& procBou = procBouCoeffs[procIntI];
680  const scalarField& procInt = procIntCoeffs[procIntI];
681 
682 
683  forAll(map, i)
684  {
685  if (map[i] >= 0)
686  {
687  label allFaceI = map[i];
688 
689  if (coarsestMatrix.hasUpper())
690  {
691  allMatrix.upper()[allFaceI] = -procBou[i];
692  }
693  if (coarsestMatrix.hasLower())
694  {
695  allMatrix.lower()[allFaceI] = -procInt[i];
696  }
697  }
698  else
699  {
700  label allFaceI = -map[i]-1;
701 
702  if (coarsestMatrix.hasUpper())
703  {
704  allMatrix.upper()[allFaceI] = -procInt[i];
705  }
706  if (coarsestMatrix.hasLower())
707  {
708  allMatrix.lower()[allFaceI] = -procBou[i];
709  }
710  }
711  }
712  }
713  }
714  }
715 
716  //Pout<< "** Assembled allMatrix:" << allMatrix.info() << endl;
717  //
718  //forAll(allInterfaces, intI)
719  //{
720  // if (allInterfaces.set(intI))
721  // {
722  // Pout<< " patch:" << intI
723  // << " type:" << allInterfaces[intI].type()
724  // << " size:"
725  // << allInterfaces[intI].interface().
726  // faceCells().size()
727  // << endl;
728  //
729  // //const scalarField& bouCoeffs = allInterfaceBouCoeffs[intI];
730  // //const scalarField& intCoeffs = allInterfaceIntCoeffs[intI];
731  // //forAll(bouCoeffs, faceI)
732  // //{
733  // // Pout<< " " << faceI
734  // // << "\tbou:" << bouCoeffs[faceI]
735  // // << "\tint:" << intCoeffs[faceI]
736  // // << endl;
737  // //}
738  // }
739  //}
740  }
741  UPstream::warnComm = oldWarn;
742 }
743 
744 
746 (
747  const labelList& procAgglomMap,
748  const List<label>& agglomProcIDs,
749 
750  const label levelI
751 )
752 {
753  autoPtr<lduMatrix> allMatrixPtr;
754  autoPtr<FieldField<Field, scalar> > allInterfaceBouCoeffs
755  (
757  );
758  autoPtr<FieldField<Field, scalar> > allInterfaceIntCoeffs
759  (
761  );
762  autoPtr<PtrList<lduInterfaceField> > allPrimitiveInterfaces
763  (
765  );
767  (
769  );
770 
771  procAgglomerateMatrix
772  (
773  // Agglomeration information
774  procAgglomMap,
775  agglomProcIDs,
776 
777  levelI,
778 
779  // Resulting matrix
780  allMatrixPtr,
781  allInterfaceBouCoeffs(),
782  allInterfaceIntCoeffs(),
783  allPrimitiveInterfaces(),
784  allInterfaces()
785  );
786 
787  matrixLevels_.set(levelI, allMatrixPtr);
788  interfaceLevelsBouCoeffs_.set(levelI, allInterfaceBouCoeffs);
789  interfaceLevelsIntCoeffs_.set(levelI, allInterfaceIntCoeffs);
790  primitiveInterfaceLevels_.set(levelI, allPrimitiveInterfaces);
791  interfaceLevels_.set(levelI, allInterfaces);
792 }
793 
794 
795 // ************************************************************************* //
Foam::faceMap
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Definition: blockMeshMergeFast.C:90
Foam::lduMatrix::hasLower
bool hasLower() const
Definition: lduMatrix.H:585
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
Foam::FieldField
Generic field type.
Definition: FieldField.H:51
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::diag
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
Definition: pointPatchFieldFunctions.H:262
Foam::OPstream
Output inter-processor communications stream.
Definition: OPstream.H:50
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:53
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:77
Foam::GAMGSolver::agglomerateInterfaceCoefficients
void agglomerateInterfaceCoefficients(const label fineLevelIndex, const lduInterfacePtrsList &coarseMeshInterfaces, PtrList< lduInterfaceField > &coarsePrimInterfaces, lduInterfaceFieldPtrsList &coarseInterfaces, FieldField< Field, scalar > &coarseInterfaceBouCoeffs, FieldField< Field, scalar > &coarseInterfaceIntCoeffs) const
Agglomerate coarse interface coefficients.
Definition: GAMGSolverAgglomerateMatrix.C:198
Foam::lduMatrix::hasDiag
bool hasDiag() const
Definition: lduMatrix.H:575
processorLduInterfaceField.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::lduMatrix::upper
scalarField & upper()
Definition: lduMatrix.C:194
Foam::UPtrList::setSize
void setSize(const label)
Reset size of UPtrList. This can only be used to set the size.
Definition: UPtrList.C:87
Foam::processorGAMGInterfaceField
GAMG agglomerated processor interface field.
Definition: processorGAMGInterfaceField.H:50
Foam::lduInterfaceFieldPtrsList
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
Definition: lduInterfaceFieldPtrsList.H:42
Foam::lduMesh::interfaces
virtual lduInterfacePtrsList interfaces() const =0
Return a list of pointers for each patch.
interface
interfaceProperties interface(alpha1, U, mixture())
Foam::lduMatrix::lower
scalarField & lower()
Definition: lduMatrix.C:165
Foam::PtrList::set
bool set(const label) const
Is element set.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::GAMGInterface
Abstract base class for GAMG agglomerated interfaces.
Definition: GAMGInterface.H:51
Foam::UList::assign
void assign(const UList< T > &)
Assign elements to those from UList.
Definition: UList.C:37
Foam::UPtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:53
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::FatalError
error FatalError
GAMGInterfaceField.H
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Foam::lduMatrix::diag
scalarField & diag()
Definition: lduMatrix.C:183
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::GAMGSolver::procAgglomerateMatrix
void procAgglomerateMatrix(const labelList &procAgglomMap, const List< label > &agglomProcIDs, const label levelI, autoPtr< lduMatrix > &allMatrixPtr, FieldField< Field, scalar > &allInterfaceBouCoeffs, FieldField< Field, scalar > &allInterfaceIntCoeffs, PtrList< lduInterfaceField > &allPrimitiveInterfaces, lduInterfaceFieldPtrsList &allInterfaces) const
Agglomerate processor matrices.
Definition: GAMGSolverAgglomerateMatrix.C:415
Foam::Pout
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::processorGAMGInterfaceField::doTransform
virtual bool doTransform() const
Does the interface field perform the transfromation.
Definition: processorGAMGInterfaceField.H:175
scalarField
volScalarField scalarField(fieldObject, mesh)
Foam::UPtrList::set
bool set(const label) const
Is element set.
Foam::GAMGSolver::gatherMatrices
void gatherMatrices(const labelList &procIDs, const lduMesh &dummyMesh, const label meshComm, const lduMatrix &mat, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, PtrList< lduMatrix > &otherMats, PtrList< FieldField< Field, scalar > > &otherBouCoeffs, PtrList< FieldField< Field, scalar > > &otherIntCoeffs, List< boolList > &otherTransforms, List< List< label > > &otherRanks) const
Collect matrices from other processors.
Definition: GAMGSolverAgglomerateMatrix.C:285
Foam::lduMatrix::mesh
const lduMesh & mesh() const
Return the LDU mesh from which the addressing is obtained.
Definition: lduMatrix.H:539
Foam::PtrList::setSize
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:142
processorGAMGInterfaceField.H
Foam::lduMesh::comm
virtual label comm() const =0
Return communicator used for parallel communication.
Foam::autoPtr::reset
void reset(T *=0)
If object pointer already set, delete object and set to given.
Definition: autoPtrI.H:114
Foam::UIndirectList
A List with indirect addressing.
Definition: fvMatrix.H:106
Foam::lduMatrix::hasUpper
bool hasUpper() const
Definition: lduMatrix.H:580
Foam::IPstream
Input inter-processor communications stream.
Definition: IPstream.H:50
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::UList::size
label size() const
Return the number of elements in the UList.
Definition: UListI.H:299
Foam::processorLduInterfaceField
Abstract base class for processor coupled interfaces.
Definition: processorLduInterfaceField.H:49
GAMGSolver.H
Foam::GAMGSolver::agglomerateMatrix
void agglomerateMatrix(const label fineLevelIndex, const lduMesh &coarseMesh, const lduInterfacePtrsList &coarseMeshInterfaces)
Agglomerate coarse matrix. Supply mesh to use - so we can.
Definition: GAMGSolverAgglomerateMatrix.C:34
Foam::processorGAMGInterfaceField::rank
virtual int rank() const
Return rank of component for transform.
Definition: processorGAMGInterfaceField.H:187
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:51
Foam::lduInterface::faceCells
virtual const labelUList & faceCells() const =0
Return faceCell addressing.
Foam::UPtrList::size
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:31