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