faMatrix.H
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) 2016-2017 Wikki Ltd
9  Copyright (C) 2020 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 Class
28  Foam::faMatrix
29 
30 Description
31  Finite-Area matrix.
32 
33 SourceFiles
34  faMatrix.C
35  faMatrixSolve.C
36 
37 Author
38  Zeljko Tukovic, FMENA
39  Hrvoje Jasak, Wikki Ltd.
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef faMatrix_H
44 #define faMatrix_H
45 
46 #include "areaFields.H"
47 #include "edgeFields.H"
48 #include "lduMatrix.H"
49 #include "tmp.H"
50 #include "autoPtr.H"
51 #include "dimensionedTypes.H"
52 #include "className.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 // Forward Declarations
60 template<class Type> class faMatrix;
61 template<class T> class UIndirectList;
62 
63 template<class Type>
65 
66 
67 /*---------------------------------------------------------------------------*\
68  Class faMatrix Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class Type>
72 class faMatrix
73 :
74  public refCount,
75  public lduMatrix
76 {
77  // Private Data
78 
79  //- Const reference to field
80  // Converted into a non-const reference at the point of solution.
82 
83  //- Dimension set
84  dimensionSet dimensions_;
85 
86  //- Source term
87  Field<Type> source_;
88 
89  //- Boundary scalar field containing pseudo-matrix coeffs
90  //- for internal faces
91  FieldField<Field, Type> internalCoeffs_;
92 
93  //- Boundary scalar field containing pseudo-matrix coeffs
94  //- for boundary faces
95  FieldField<Field, Type> boundaryCoeffs_;
96 
97  //- Face flux field for non-orthogonal correction
99  *faceFluxCorrectionPtr_;
100 
101 
102 protected:
103 
104  //- Declare friendship with the faSolver class
105  friend class faSolver;
106 
107 
108  // Protected Member Functions
109 
110  //- Add patch contribution to internal field
111  template<class Type2>
112  void addToInternalField
113  (
114  const labelUList& addr,
115  const Field<Type2>& pf,
116  Field<Type2>& intf
117  ) const;
118 
119  template<class Type2>
120  void addToInternalField
121  (
122  const labelUList& addr,
123  const tmp<Field<Type2>>& tpf,
124  Field<Type2>& intf
125  ) const;
126 
127  //- Subtract patch contribution from internal field
128  template<class Type2>
130  (
131  const labelUList& addr,
132  const Field<Type2>& pf,
133  Field<Type2>& intf
134  ) const;
135 
136  template<class Type2>
138  (
139  const labelUList& addr,
140  const tmp<Field<Type2>>& tpf,
141  Field<Type2>& intf
142  ) const;
143 
144 
145  // Matrix completion functionality
146 
147  void addBoundaryDiag
148  (
149  scalarField& diag,
150  const direction cmpt
151  ) const;
152 
154 
155  void addBoundarySource
156  (
158  const bool couples = true
159  ) const;
160 
161 
162  // Matrix manipulation functionality
163 
164  //- Set solution in given faces to the specified values
165  template<template<class> class ListType>
166  void setValuesFromList
167  (
168  const labelUList& faceLabels,
169  const ListType<Type>& values
170  );
171 
172 
173 public:
174 
175  //- Solver class returned by the solver function
176  //- used for systems in which it is useful to cache the solver for reuse.
177  class faSolver
178  {
179  faMatrix<Type>& faMat_;
180 
182 
183  public:
184 
185  // Constructors
186 
188  :
189  faMat_(faMat),
190  solver_(std::move(sol))
191  {}
192 
193 
194  // Member Functions
195 
196  //- Solve returning the solution statistics.
197  // Solver controls read from dictionary
198  SolverPerformance<Type> solve(const dictionary& solverControls);
199 
200  //- Solve returning the solution statistics.
201  // Solver controls read from faSolution
203  };
204 
205 
206  ClassName("faMatrix");
207 
208 
209  // Constructors
210 
211  //- Construct given a field to solve for
212  faMatrix
213  (
215  const dimensionSet& ds
216  );
217 
218  //- Copy construct
219  faMatrix(const faMatrix<Type>&);
220 
221  //- Construct from Istream given field to solve for
222  faMatrix
223  (
225  Istream& is
226  );
227 
228  //- Clone
229  tmp<faMatrix<Type>> clone() const;
230 
231 
232  //- Destructor
233  virtual ~faMatrix();
234 
235 
236  // Member Functions
237 
238  // Access
239 
241  {
242  return psi_;
243  }
244 
245  const dimensionSet& dimensions() const
246  {
247  return dimensions_;
248  }
249 
251  {
252  return source_;
253  }
254 
255  const Field<Type>& source() const
256  {
257  return source_;
258  }
259 
260  //- faBoundary scalar field containing pseudo-matrix coeffs
261  //- for internal cells
263  {
264  return internalCoeffs_;
265  }
266 
267  //- faBoundary scalar field containing pseudo-matrix coeffs
268  //- for internal cells
270  {
271  return internalCoeffs_;
272  }
273 
274  //- faBoundary scalar field containing pseudo-matrix coeffs
275  //- for boundary cells
277  {
278  return boundaryCoeffs_;
279  }
280 
281  //- faBoundary scalar field containing pseudo-matrix coeffs
282  //- for boundary cells
284  {
285  return boundaryCoeffs_;
286  }
287 
288 
289  //- Declare return type of the faceFluxCorrectionPtr() function
292 
293  //- Return pointer to face-flux non-orthogonal correction field
295  {
296  return faceFluxCorrectionPtr_;
297  }
298 
299 
300  // Operations
301 
302  //- Set solution in given faces to the specified value
303  //- and eliminate the corresponding equations from the matrix.
304  void setValues
305  (
306  const labelUList& faceLabels,
307  const Type& value
308  );
309 
310  //- Set solution in given faces to the specified values
311  //- and eliminate the corresponding equations from the matrix.
312  void setValues
313  (
314  const labelUList& faceLabels,
315  const UList<Type>& values
316  );
317 
318  //- Set solution in given faces to the specified values
319  //- and eliminate the corresponding equations from the matrix.
320  void setValues
321  (
322  const labelUList& faceLabels,
324  );
325 
326  //- Set reference level for solution
327  void setReference
328  (
329  const label facei,
330  const Type& value,
331  const bool forceReference = false
332  );
333 
334  //- Set reference level for solution
335  void setReferences
336  (
337  const labelUList& faceLabels,
338  const Type& value,
339  const bool forceReference = false
340  );
341 
342  //- Set reference level for solution
343  void setReferences
344  (
345  const labelUList& faceLabels,
346  const UList<Type>& values,
347  const bool forceReference = false
348  );
349 
350  //- Set reference level for a component of the solution
351  //- on a given patch face
353  (
354  const label patchi,
355  const label facei,
356  const direction cmpt,
357  const scalar value
358  );
359 
360  //- Relax matrix (for steady-state solution).
361  // alpha = 1 : diagonally equal
362  // alpha < 1 : ,, dominant
363  // alpha = 0 : do nothing
364  // Note: Requires positive diagonal.
365  void relax(const scalar alpha);
366 
367  //- Relax matrix (for steady-state solution).
368  // alpha is read from controlDict
369  void relax();
370 
371  //- Solve returning the solution statistics.
372  // Solver controls read Istream
374 
375  //- Solve returning the solution statistics.
376  // Solver controls read from faSolution
378 
379  //- Return the matrix residual
380  tmp<Field<Type>> residual() const;
381 
382  //- Return the matrix diagonal
383  tmp<scalarField> D() const;
384 
385  //- Return the central coefficient
386  tmp<areaScalarField> A() const;
387 
388  //- Return the H operation source
390 
391  //- Return the face-flux field from the matrix
393 
394 
395  // Member Operators
396 
397  void operator=(const faMatrix<Type>&);
398  void operator=(const tmp<faMatrix<Type>>&);
399 
400  void negate();
401 
402  void operator+=(const faMatrix<Type>&);
403  void operator+=(const tmp<faMatrix<Type>>&);
404 
405  void operator-=(const faMatrix<Type>&);
406  void operator-=(const tmp<faMatrix<Type>>&);
407 
410 
413 
414  void operator+=(const dimensioned<Type>&);
415  void operator-=(const dimensioned<Type>&);
416 
417  void operator*=(const areaScalarField&);
418  void operator*=(const tmp<areaScalarField>&);
419 
420  void operator*=(const dimensioned<scalar>&);
421 
422 
423  // Ostream Operator
424 
425  friend Ostream& operator<< <Type>
426  (
427  Ostream&,
428  const faMatrix<Type>&
429  );
430 };
431 
432 
433 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
434 
435 template<class Type>
436 void checkMethod
437 (
438  const faMatrix<Type>&,
439  const faMatrix<Type>&,
440  const char*
441 );
442 
443 template<class Type>
444 void checkMethod
445 (
446  const faMatrix<Type>&,
447  const GeometricField<Type, faPatchField, areaMesh>&,
448  const char*
449 );
450 
451 template<class Type>
452 void checkMethod
453 (
454  const faMatrix<Type>&,
455  const dimensioned<Type>&,
456  const char*
457 );
458 
459 
460 //- Solve returning the solution statistics given convergence tolerance
461 // Solver controls read Istream
462 template<class Type>
463 SolverPerformance<Type> solve(faMatrix<Type>&, Istream&);
464 
465 
466 //- Solve returning the solution statistics given convergence tolerance,
467 //- deleting temporary matrix after solution.
468 // Solver controls read Istream
469 template<class Type>
470 SolverPerformance<Type> solve(const tmp<faMatrix<Type>>&, Istream&);
471 
472 
473 //- Solve returning the solution statistics given convergence tolerance
474 // Solver controls read faSolution
475 template<class Type>
476 SolverPerformance<Type> solve(faMatrix<Type>&);
477 
478 
479 //- Solve returning the solution statistics given convergence tolerance,
480 //- deleting temporary matrix after solution.
481 // Solver controls read faSolution
482 template<class Type>
483 SolverPerformance<Type> solve(const tmp<faMatrix<Type>>&);
484 
485 
486 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
487 
488 template<class Type>
489 tmp<faMatrix<Type>> operator-
490 (
491  const faMatrix<Type>&
492 );
493 
494 template<class Type>
495 tmp<faMatrix<Type>> operator-
496 (
497  const tmp<faMatrix<Type>>&
498 );
499 
500 template<class Type>
501 tmp<faMatrix<Type>> operator+
502 (
503  const faMatrix<Type>&,
504  const faMatrix<Type>&
505 );
506 
507 template<class Type>
508 tmp<faMatrix<Type>> operator+
509 (
510  const tmp<faMatrix<Type>>&,
511  const faMatrix<Type>&
512 );
513 
514 template<class Type>
515 tmp<faMatrix<Type>> operator+
516 (
517  const faMatrix<Type>&,
518  const tmp<faMatrix<Type>>&
519 );
520 
521 template<class Type>
522 tmp<faMatrix<Type>> operator+
523 (
524  const tmp<faMatrix<Type>>&,
525  const tmp<faMatrix<Type>>&
526 );
527 
528 template<class Type>
529 tmp<faMatrix<Type>> operator-
530 (
531  const faMatrix<Type>&,
532  const faMatrix<Type>&
533 );
534 
535 template<class Type>
536 tmp<faMatrix<Type>> operator-
537 (
538  const tmp<faMatrix<Type>>&,
539  const faMatrix<Type>&
540 );
541 
542 template<class Type>
543 tmp<faMatrix<Type>> operator-
544 (
545  const faMatrix<Type>&,
546  const tmp<faMatrix<Type>>&
547 );
548 
549 template<class Type>
550 tmp<faMatrix<Type>> operator-
551 (
552  const tmp<faMatrix<Type>>&,
553  const tmp<faMatrix<Type>>&
554 );
555 
556 template<class Type>
557 tmp<faMatrix<Type>> operator==
558 (
559  const faMatrix<Type>&,
560  const faMatrix<Type>&
561 );
562 
563 template<class Type>
564 tmp<faMatrix<Type>> operator==
565 (
566  const tmp<faMatrix<Type>>&,
567  const faMatrix<Type>&
568 );
569 
570 template<class Type>
571 tmp<faMatrix<Type>> operator==
572 (
573  const faMatrix<Type>&,
574  const tmp<faMatrix<Type>>&
575 );
576 
577 template<class Type>
578 tmp<faMatrix<Type>> operator==
579 (
580  const tmp<faMatrix<Type>>&,
581  const tmp<faMatrix<Type>>&
582 );
583 
584 template<class Type>
585 tmp<faMatrix<Type>> operator+
586 (
587  const faMatrix<Type>&,
588  const GeometricField<Type, faPatchField, areaMesh>&
589 );
590 
591 template<class Type>
592 tmp<faMatrix<Type>> operator+
593 (
594  const tmp<faMatrix<Type>>&,
595  const GeometricField<Type, faPatchField, areaMesh>&
596 );
597 
598 template<class Type>
599 tmp<faMatrix<Type>> operator+
600 (
601  const faMatrix<Type>&,
602  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
603 );
604 
605 template<class Type>
606 tmp<faMatrix<Type>> operator+
607 (
608  const tmp<faMatrix<Type>>&,
609  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
610 );
611 
612 template<class Type>
613 tmp<faMatrix<Type>> operator+
614 (
615  const GeometricField<Type, faPatchField, areaMesh>&,
616  const faMatrix<Type>&
617 );
618 
619 template<class Type>
620 tmp<faMatrix<Type>> operator+
621 (
622  const GeometricField<Type, faPatchField, areaMesh>&,
623  const tmp<faMatrix<Type>>&
624 );
625 
626 template<class Type>
627 tmp<faMatrix<Type>> operator+
628 (
629  const tmp<GeometricField<Type, faPatchField, areaMesh>>&,
630  const faMatrix<Type>&
631 );
632 
633 template<class Type>
634 tmp<faMatrix<Type>> operator+
635 (
636  const tmp<GeometricField<Type, faPatchField, areaMesh>>&,
637  const tmp<faMatrix<Type>>&
638 );
639 
640 template<class Type>
641 tmp<faMatrix<Type>> operator-
642 (
643  const faMatrix<Type>&,
644  const GeometricField<Type, faPatchField, areaMesh>&
645 );
646 
647 template<class Type>
648 tmp<faMatrix<Type>> operator-
649 (
650  const tmp<faMatrix<Type>>&,
651  const GeometricField<Type, faPatchField, areaMesh>&
652 );
653 
654 template<class Type>
655 tmp<faMatrix<Type>> operator-
656 (
657  const faMatrix<Type>&,
658  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
659 );
660 
661 template<class Type>
662 tmp<faMatrix<Type>> operator-
663 (
664  const tmp<faMatrix<Type>>&,
665  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
666 );
667 
668 template<class Type>
669 tmp<faMatrix<Type>> operator-
670 (
671  const GeometricField<Type, faPatchField, areaMesh>&,
672  const faMatrix<Type>&
673 );
674 
675 template<class Type>
676 tmp<faMatrix<Type>> operator-
677 (
678  const GeometricField<Type, faPatchField, areaMesh>&,
679  const tmp<faMatrix<Type>>&
680 );
681 
682 template<class Type>
683 tmp<faMatrix<Type>> operator-
684 (
685  const tmp<GeometricField<Type, faPatchField, areaMesh>>&,
686  const faMatrix<Type>&
687 );
688 
689 template<class Type>
690 tmp<faMatrix<Type>> operator-
691 (
692  const tmp<GeometricField<Type, faPatchField, areaMesh>>&,
693  const tmp<faMatrix<Type>>&
694 );
695 
696 template<class Type>
697 tmp<faMatrix<Type>> operator+
698 (
699  const faMatrix<Type>&,
700  const dimensioned<Type>&
701 );
702 
703 template<class Type>
704 tmp<faMatrix<Type>> operator+
705 (
706  const tmp<faMatrix<Type>>&,
707  const dimensioned<Type>&
708 );
709 
710 template<class Type>
711 tmp<faMatrix<Type>> operator+
712 (
713  const dimensioned<Type>&,
714  const faMatrix<Type>&
715 );
716 
717 template<class Type>
718 tmp<faMatrix<Type>> operator+
719 (
720  const dimensioned<Type>&,
721  const tmp<faMatrix<Type>>&
722 );
723 
724 template<class Type>
725 tmp<faMatrix<Type>> operator-
726 (
727  const faMatrix<Type>&,
728  const dimensioned<Type>&
729 );
730 
731 template<class Type>
732 tmp<faMatrix<Type>> operator-
733 (
734  const tmp<faMatrix<Type>>&,
735  const dimensioned<Type>&
736 );
737 
738 template<class Type>
739 tmp<faMatrix<Type>> operator-
740 (
741  const dimensioned<Type>&,
742  const faMatrix<Type>&
743 );
744 
745 template<class Type>
746 tmp<faMatrix<Type>> operator-
747 (
748  const dimensioned<Type>&,
749  const tmp<faMatrix<Type>>&
750 );
751 
752 template<class Type>
753 tmp<faMatrix<Type>> operator==
754 (
755  const faMatrix<Type>&,
756  const GeometricField<Type, faPatchField, areaMesh>&
757 );
758 
759 template<class Type>
760 tmp<faMatrix<Type>> operator==
761 (
762  const tmp<faMatrix<Type>>&,
763  const GeometricField<Type, faPatchField, areaMesh>&
764 );
765 
766 template<class Type>
767 tmp<faMatrix<Type>> operator==
768 (
769  const faMatrix<Type>&,
770  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
771 );
772 
773 template<class Type>
774 tmp<faMatrix<Type>> operator==
775 (
776  const tmp<faMatrix<Type>>&,
777  const tmp<GeometricField<Type, faPatchField, areaMesh>>&
778 );
779 
780 template<class Type>
781 tmp<faMatrix<Type>> operator==
782 (
783  const faMatrix<Type>&,
784  const dimensioned<Type>&
785 );
786 
787 template<class Type>
788 tmp<faMatrix<Type>> operator==
789 (
790  const tmp<faMatrix<Type>>&,
791  const dimensioned<Type>&
792 );
793 
794 
795 template<class Type>
796 tmp<faMatrix<Type>> operator*
797 (
798  const areaScalarField&,
799  const faMatrix<Type>&
800 );
801 
802 template<class Type>
803 tmp<faMatrix<Type>> operator*
804 (
805  const areaScalarField&,
806  const tmp<faMatrix<Type>>&
807 );
808 
809 template<class Type>
810 tmp<faMatrix<Type>> operator*
811 (
812  const tmp<areaScalarField>&,
813  const faMatrix<Type>&
814 );
815 
816 template<class Type>
817 tmp<faMatrix<Type>> operator*
818 (
819  const tmp<areaScalarField>&,
820  const tmp<faMatrix<Type>>&
821 );
822 
823 template<class Type>
824 tmp<faMatrix<Type>> operator*
825 (
826  const dimensioned<scalar>&,
827  const faMatrix<Type>&
828 );
829 
830 template<class Type>
831 tmp<faMatrix<Type>> operator*
832 (
833  const dimensioned<scalar>&,
834  const tmp<faMatrix<Type>>&
835 );
836 
837 
838 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
839 
840 } // End namespace Foam
841 
842 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
843 
844 #ifdef NoRepository
845  #include "faMatrix.C"
846 #endif
847 
848 // Specialisation for scalars
849 
850 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
851 
852 #endif
853 
854 // ************************************************************************* //
Foam::checkMethod
void checkMethod(const faMatrix< Type > &, const faMatrix< Type > &, const char *)
Definition: faMatrix.C:1035
Foam::faMatrix::operator+=
void operator+=(const faMatrix< Type > &)
Definition: faMatrix.C:846
Foam::faMatrix::addToInternalField
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
Definition: faMatrix.C:42
Foam::faMatrix::dimensions
const dimensionSet & dimensions() const
Definition: faMatrix.H:244
Foam::faMatrix
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatrix.H:59
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::faMatrix::negate
void negate()
Definition: faMatrix.C:831
Foam::faMatrix::setValues
void setValues(const labelUList &faceLabels, const Type &value)
Definition: faMatrix.C:425
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::faMatrix::operator-=
void operator-=(const faMatrix< Type > &)
Definition: faMatrix.C:880
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::diag
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
Definition: pointPatchFieldFunctions.H:287
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::faMatrix::boundaryCoeffs
FieldField< Field, Type > & boundaryCoeffs()
Definition: faMatrix.H:282
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::faMatrix::flux
tmp< GeometricField< Type, faePatchField, edgeMesh > > flux() const
Return the face-flux field from the matrix.
Definition: faMatrix.C:708
Foam::faMatrix::source
const Field< Type > & source() const
Definition: faMatrix.H:254
Foam::faMatrix::setComponentReference
void setComponentReference(const label patchi, const label facei, const direction cmpt, const scalar value)
Definition: faMatrixSolve.C:38
lduMatrix.H
Foam::faMatrix::faMatrix
faMatrix(const GeometricField< Type, faPatchField, areaMesh > &psi, const dimensionSet &ds)
Construct given a field to solve for.
Definition: faMatrix.C:185
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:65
Foam::faMatrix::subtractFromInternalField
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
Definition: faMatrix.C:80
Foam::faMatrix::source
Field< Type > & source()
Definition: faMatrix.H:249
Foam::faMatrix::setReferences
void setReferences(const labelUList &faceLabels, const Type &value, const bool forceReference=false)
Set reference level for solution.
Definition: faMatrix.C:477
Foam::faMatrix::faSolver
Definition: faMatrix.H:176
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::faMatrix::addBoundaryDiag
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
Definition: faMatrix.C:117
Foam::faMatrix::operator=
void operator=(const faMatrix< Type > &)
Definition: faMatrix.C:790
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
edgeFields.H
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::faMatrix::setValuesFromList
void setValuesFromList(const labelUList &faceLabels, const ListType< Type > &values)
Set solution in given faces to the specified values.
Definition: faMatrix.C:336
Foam::faMatrix::solve
SolverPerformance< Type > solve()
Solve returning the solution statistics.
Definition: faMatrixSolve.C:172
Foam::solve
SolverPerformance< Type > solve(faMatrix< Type > &, Istream &)
Solve returning the solution statistics given convergence tolerance.
Foam::faMatrix::addBoundarySource
void addBoundarySource(Field< Type > &source, const bool couples=true) const
Definition: faMatrix.C:151
Foam::faMatrix::relax
void relax()
Relax matrix (for steady-state solution).
Definition: faMatrix.C:612
Foam::faMatrix::internalCoeffs
FieldField< Field, Type > & internalCoeffs()
Definition: faMatrix.H:268
areaFields.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::faMatrix::H
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
Definition: faMatrix.C:664
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:43
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::areaScalarField
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
Definition: areaFieldsFwd.H:53
Foam::faMatrix::setReference
void setReference(const label facei, const Type &value, const bool forceReference=false)
Set reference level for solution.
Definition: faMatrix.C:458
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
tmp.H
Foam::faMatrix::psi
const GeometricField< Type, faPatchField, areaMesh > & psi() const
Definition: faMatrix.H:239
Foam::faMatrix::faSolver::faSolver
faSolver(faMatrix< Type > &faMat, autoPtr< lduMatrix::solver > &&sol)
Definition: faMatrix.H:186
Foam::faMatrix::boundaryCoeffs
const FieldField< Field, Type > & boundaryCoeffs() const
Definition: faMatrix.H:275
Foam::faMatrix::internalCoeffs
const FieldField< Field, Type > & internalCoeffs() const
Definition: faMatrix.H:261
Foam::faMatrix::faceFluxCorrectionPtr
edgeTypeFieldPtr & faceFluxCorrectionPtr()
Return pointer to face-flux non-orthogonal correction field.
Definition: faMatrix.H:293
Foam::faMatrix::addCmptAvBoundaryDiag
void addCmptAvBoundaryDiag(scalarField &diag) const
Definition: faMatrix.C:135
Foam::faMatrix::operator*=
void operator*=(const areaScalarField &)
Definition: faMatrix.C:977
Foam::UList< label >
Foam::faMatrix::edgeTypeFieldPtr
GeometricField< Type, faePatchField, edgeMesh > * edgeTypeFieldPtr
Declare return type of the faceFluxCorrectionPtr() function.
Definition: faMatrix.H:290
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::faMatrix::~faMatrix
virtual ~faMatrix()
Destructor.
Definition: faMatrix.C:322
dimensionedTypes.H
faMatrix.C
Foam::UIndirectList
A List with indirect addressing.
Definition: faMatrix.H:60
Foam::faMatrix::D
tmp< scalarField > D() const
Return the matrix diagonal.
Definition: faMatrix.C:628
Foam::faMatrix::A
tmp< areaScalarField > A() const
Return the central coefficient.
Definition: faMatrix.C:637
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::faMatrix::residual
tmp< Field< Type > > residual() const
Return the matrix residual.
Definition: faMatrixSolve.C:179
Foam::faMatrix::faSolver::solve
SolverPerformance< Type > solve()
Solve returning the solution statistics.
Definition: faMatrixSolve.C:165
Foam::faMatrix::clone
tmp< faMatrix< Type > > clone() const
Clone.
Definition: faMatrix.C:309
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::SolverPerformance
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
Definition: SolverPerformance.H:51
Foam::faMatrix::ClassName
ClassName("faMatrix")
autoPtr.H