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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::faMatrix
29
30Description
31 Finite-Area matrix.
32
33SourceFiles
34 faMatrix.C
35 faMatrixSolve.C
36
37Author
38 Zeljko Tukovic, FMENA
39 Hrvoje Jasak, Wikki Ltd.
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef Foam_faMatrix_H
44#define Foam_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 "zero.H"
53#include "className.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60// Forward Declarations
61template<class Type> class faMatrix;
62template<class T> class UIndirectList;
63
64template<class Type>
66
67
68/*---------------------------------------------------------------------------*\
69 Class faMatrix Declaration
70\*---------------------------------------------------------------------------*/
71
72template<class Type>
73class faMatrix
74:
75 public refCount,
76 public lduMatrix
77{
78public:
79
80 // Public Types
81
82 //- The geometric field type for psi
83 typedef
86
87 //- Field type for face flux (for non-orthogonal correction)
88 typedef
91
94
95private:
96
97 // Private Data
98
99 //- Const reference to field
100 // Converted into a non-const reference at the point of solution.
101 const psiFieldType& psi_;
102
103 //- Dimension set
104 dimensionSet dimensions_;
105
106 //- Source term
107 Field<Type> source_;
108
109 //- Boundary scalar field containing pseudo-matrix coeffs
110 //- for internal faces
111 FieldField<Field, Type> internalCoeffs_;
112
113 //- Boundary scalar field containing pseudo-matrix coeffs
114 //- for boundary faces
115 FieldField<Field, Type> boundaryCoeffs_;
116
117 //- Face flux field for non-orthogonal correction
118 mutable faceFluxFieldType* faceFluxCorrectionPtr_;
119
120
121protected:
122
123 //- Declare friendship with the faSolver class
124 friend class faSolver;
125
126
127 // Protected Member Functions
128
129 //- Add patch contribution to internal field
130 template<class Type2>
132 (
133 const labelUList& addr,
134 const Field<Type2>& pf,
135 Field<Type2>& intf
136 ) const;
137
138 template<class Type2>
140 (
141 const labelUList& addr,
142 const tmp<Field<Type2>>& tpf,
143 Field<Type2>& intf
144 ) const;
145
146 //- Subtract patch contribution from internal field
147 template<class Type2>
149 (
150 const labelUList& addr,
151 const Field<Type2>& pf,
152 Field<Type2>& intf
153 ) const;
154
155 template<class Type2>
157 (
158 const labelUList& addr,
159 const tmp<Field<Type2>>& tpf,
160 Field<Type2>& intf
161 ) const;
162
163
164 // Matrix completion functionality
165
166 void addBoundaryDiag
167 (
169 const direction cmpt
170 ) const;
171
173
175 (
177 const bool couples = true
178 ) const;
179
180
181 // Matrix manipulation functionality
182
183 //- Set solution in given faces to the specified values
184 template<template<class> class ListType>
186 (
187 const labelUList& faceLabels,
188 const ListType<Type>& values
189 );
190
191
192public:
193
194 //- Solver class returned by the solver function
195 //- used for systems in which it is useful to cache the solver for reuse.
196 class faSolver
197 {
198 faMatrix<Type>& faMat_;
199
201
202 public:
203
204 // Constructors
207 :
208 faMat_(faMat),
209 solver_(std::move(sol))
210 {}
211
212
213 // Member Functions
214
215 //- Solve returning the solution statistics.
216 // Solver controls read from dictionary
217 SolverPerformance<Type> solve(const dictionary& solverControls);
218
219 //- Solve returning the solution statistics.
220 // Solver controls read from faSolution
222 };
223
224
225 // Runtime information
226 ClassName("faMatrix");
227
228
229 // Constructors
230
231 //- Construct given a field to solve for
233 (
235 const dimensionSet& ds
236 );
237
238 //- Copy construct
239 faMatrix(const faMatrix<Type>&);
240
241 //- Copy/move construct from tmp<faMatrix<Type>>
242 faMatrix(const tmp<faMatrix<Type>>&);
243
244 //- Deprecated(2022-05) - construct with dimensionSet instead
245 // \deprecated(2022-05) - construct with dimensionSet instead
246 FOAM_DEPRECATED_FOR(2022-05, "Construct with dimensionSet")
248 (
250 Istream& is
251 )
252 :
253 faMatrix<Type>(psi, dimensionSet(is))
254 {}
255
256 //- Construct and return a clone
258 {
259 return tmp<faMatrix<Type>>::New(*this);
260 }
261
262
263 //- Destructor
264 virtual ~faMatrix();
265
266
267 // Member Functions
268
269 // Access
272 {
273 return psi_;
274 }
276 const dimensionSet& dimensions() const noexcept
277 {
278 return dimensions_;
279 }
282 {
283 return source_;
284 }
286 const Field<Type>& source() const noexcept
287 {
288 return source_;
289 }
290
291 //- faBoundary scalar field containing pseudo-matrix coeffs
292 //- for internal cells
294 {
295 return internalCoeffs_;
296 }
297
298 //- faBoundary scalar field containing pseudo-matrix coeffs
299 //- for internal cells
301 {
302 return internalCoeffs_;
303 }
304
305 //- faBoundary scalar field containing pseudo-matrix coeffs
306 //- for boundary cells
308 {
309 return boundaryCoeffs_;
310 }
311
312 //- faBoundary scalar field containing pseudo-matrix coeffs
313 //- for boundary cells
315 {
316 return boundaryCoeffs_;
317 }
318
319 //- Declare return type of the faceFluxCorrectionPtr() function
322
323 //- Return pointer to face-flux non-orthogonal correction field
325 {
326 return faceFluxCorrectionPtr_;
327 }
328
329 //- True if face-flux non-orthogonal correction field exists
331 {
332 return bool(faceFluxCorrectionPtr_);
333 }
334
335
336 // Operations
337
338 //- Set solution in given faces to the specified value
339 //- and eliminate the corresponding equations from the matrix.
340 void setValues
341 (
342 const labelUList& faceLabels,
343 const Type& value
344 );
345
346 //- Set solution in given faces to the specified values
347 //- and eliminate the corresponding equations from the matrix.
348 void setValues
349 (
350 const labelUList& faceLabels,
351 const UList<Type>& values
352 );
353
354 //- Set solution in given faces to the specified values
355 //- and eliminate the corresponding equations from the matrix.
356 void setValues
357 (
358 const labelUList& faceLabels,
359 const UIndirectList<Type>& values
360 );
361
362 //- Set reference level for solution
363 void setReference
364 (
365 const label facei,
366 const Type& value,
367 const bool forceReference = false
368 );
369
370 //- Set reference level for solution
371 void setReferences
372 (
373 const labelUList& faceLabels,
374 const Type& value,
375 const bool forceReference = false
376 );
377
378 //- Set reference level for solution
379 void setReferences
380 (
381 const labelUList& faceLabels,
382 const UList<Type>& values,
383 const bool forceReference = false
384 );
385
386 //- Set reference level for a component of the solution
387 //- on a given patch face
389 (
390 const label patchi,
391 const label facei,
392 const direction cmpt,
393 const scalar value
394 );
395
396 //- Relax matrix (for steady-state solution).
397 // alpha = 1 : diagonally equal
398 // alpha < 1 : ,, dominant
399 // alpha = 0 : do nothing
400 // Note: Requires positive diagonal.
401 void relax(const scalar alpha);
402
403 //- Relax matrix (for steady-state solution).
404 // alpha is read from controlDict
405 void relax();
406
407 //- Solve returning the solution statistics.
408 // Use the given solver controls
410
411 //- Solve returning the solution statistics.
412 // Solver controls read from faSolution
414
415 //- Return the matrix residual
416 tmp<Field<Type>> residual() const;
417
418 //- Return the matrix diagonal
419 tmp<scalarField> D() const;
420
421 //- Return the central coefficient
422 tmp<areaScalarField> A() const;
423
424 //- Return the H operation source
426
427 //- Return the face-flux field from the matrix
429
430
431 // Member Operators
432
433 void operator=(const faMatrix<Type>&);
434 void operator=(const tmp<faMatrix<Type>>&);
435
436 //- Inplace negate
437 void negate();
438
439 void operator+=(const faMatrix<Type>&);
440 void operator+=(const tmp<faMatrix<Type>>&);
441
442 void operator-=(const faMatrix<Type>&);
443 void operator-=(const tmp<faMatrix<Type>>&);
444
447 void operator+=
448 (
450 );
451
454 void operator-=
455 (
457 );
458
459 void operator+=(const dimensioned<Type>&);
460 void operator-=(const dimensioned<Type>&);
461
462 void operator+=(const Foam::zero);
463 void operator-=(const Foam::zero);
464
467 void operator*=(const tmp<areaScalarField>&);
468
469 void operator*=(const dimensioned<scalar>&);
470
471
472 // Ostream Operator
474 friend Ostream& operator<< <Type>
475 (
476 Ostream&,
477 const faMatrix<Type>&
478 );
479};
480
481
482// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
483
484template<class Type>
485void checkMethod
486(
487 const faMatrix<Type>&,
488 const faMatrix<Type>&,
489 const char*
490);
491
492template<class Type>
493void checkMethod
494(
495 const faMatrix<Type>&,
497 const char*
498);
499
500template<class Type>
501void checkMethod
502(
503 const faMatrix<Type>&,
504 const dimensioned<Type>&,
505 const char*
506);
507
508
509//- Solve returning the solution statistics given convergence tolerance
510// Use the given solver controls
511template<class Type>
513
514
515//- Solve returning the solution statistics given convergence tolerance,
516//- deleting temporary matrix after solution.
517// Use the given solver controls
518template<class Type>
520
521
522//- Solve returning the solution statistics given convergence tolerance
523// Solver controls read faSolution
524template<class Type>
526
527
528//- Solve returning the solution statistics given convergence tolerance,
529//- deleting temporary matrix after solution.
530// Solver controls read faSolution
531template<class Type>
533
534
535// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
536
537//- Unary negation
538template<class Type>
539tmp<faMatrix<Type>> operator-
540(
541 const faMatrix<Type>&
542);
543
544//- Unary negation
545template<class Type>
546tmp<faMatrix<Type>> operator-
547(
548 const tmp<faMatrix<Type>>&
549);
550
551
552template<class Type>
553tmp<faMatrix<Type>> operator+
554(
555 const faMatrix<Type>&,
556 const faMatrix<Type>&
557);
558
559template<class Type>
560tmp<faMatrix<Type>> operator+
561(
562 const tmp<faMatrix<Type>>&,
563 const faMatrix<Type>&
564);
565
566template<class Type>
567tmp<faMatrix<Type>> operator+
568(
569 const faMatrix<Type>&,
570 const tmp<faMatrix<Type>>&
571);
572
573template<class Type>
574tmp<faMatrix<Type>> operator+
575(
576 const tmp<faMatrix<Type>>&,
577 const tmp<faMatrix<Type>>&
578);
579
580
581template<class Type>
582tmp<faMatrix<Type>> operator-
583(
584 const faMatrix<Type>&,
585 const faMatrix<Type>&
586);
587
588template<class Type>
589tmp<faMatrix<Type>> operator-
590(
591 const tmp<faMatrix<Type>>&,
592 const faMatrix<Type>&
593);
594
595template<class Type>
596tmp<faMatrix<Type>> operator-
597(
598 const faMatrix<Type>&,
599 const tmp<faMatrix<Type>>&
600);
601
602template<class Type>
603tmp<faMatrix<Type>> operator-
604(
605 const tmp<faMatrix<Type>>&,
606 const tmp<faMatrix<Type>>&
607);
608
609
610template<class Type>
611tmp<faMatrix<Type>> operator==
612(
613 const faMatrix<Type>&,
614 const faMatrix<Type>&
615);
616
617template<class Type>
618tmp<faMatrix<Type>> operator==
619(
620 const tmp<faMatrix<Type>>&,
621 const faMatrix<Type>&
622);
623
624template<class Type>
625tmp<faMatrix<Type>> operator==
626(
627 const faMatrix<Type>&,
628 const tmp<faMatrix<Type>>&
629);
630
631template<class Type>
632tmp<faMatrix<Type>> operator==
633(
634 const tmp<faMatrix<Type>>&,
635 const tmp<faMatrix<Type>>&
636);
637
638
639template<class Type>
640tmp<faMatrix<Type>> operator+
641(
642 const faMatrix<Type>&,
644);
645
646template<class Type>
647tmp<faMatrix<Type>> operator+
648(
649 const faMatrix<Type>&,
651);
652
653template<class Type>
654tmp<faMatrix<Type>> operator+
655(
656 const faMatrix<Type>&,
658);
659
660template<class Type>
661tmp<faMatrix<Type>> operator+
662(
663 const tmp<faMatrix<Type>>&,
665);
666
667template<class Type>
668tmp<faMatrix<Type>> operator+
669(
670 const tmp<faMatrix<Type>>&,
672);
673
674template<class Type>
675tmp<faMatrix<Type>> operator+
676(
677 const tmp<faMatrix<Type>>&,
679);
680
681template<class Type>
682tmp<faMatrix<Type>> operator+
683(
685 const faMatrix<Type>&
686);
687
688template<class Type>
689tmp<faMatrix<Type>> operator+
690(
692 const faMatrix<Type>&
693);
694
695template<class Type>
696tmp<faMatrix<Type>> operator+
697(
699 const faMatrix<Type>&
700);
701
702template<class Type>
703tmp<faMatrix<Type>> operator+
704(
706 const tmp<faMatrix<Type>>&
707);
708
709template<class Type>
710tmp<faMatrix<Type>> operator+
711(
713 const tmp<faMatrix<Type>>&
714);
715
716template<class Type>
717tmp<faMatrix<Type>> operator+
718(
720 const tmp<faMatrix<Type>>&
721);
722
723template<class Type>
724tmp<faMatrix<Type>> operator-
725(
726 const faMatrix<Type>&,
728);
729
730template<class Type>
731tmp<faMatrix<Type>> operator-
732(
733 const faMatrix<Type>&,
735);
736
737template<class Type>
738tmp<faMatrix<Type>> operator-
739(
740 const faMatrix<Type>&,
742);
743
744template<class Type>
745tmp<faMatrix<Type>> operator-
746(
747 const tmp<faMatrix<Type>>&,
749);
750
751template<class Type>
752tmp<faMatrix<Type>> operator-
753(
754 const tmp<faMatrix<Type>>&,
756);
757
758template<class Type>
759tmp<faMatrix<Type>> operator-
760(
761 const tmp<faMatrix<Type>>&,
763);
764
765
766template<class Type>
767tmp<faMatrix<Type>> operator-
768(
770 const faMatrix<Type>&
771);
772
773template<class Type>
774tmp<faMatrix<Type>> operator-
775(
777 const faMatrix<Type>&
778);
779
780template<class Type>
781tmp<faMatrix<Type>> operator-
782(
784 const faMatrix<Type>&
785);
786
787template<class Type>
788tmp<faMatrix<Type>> operator-
789(
791 const tmp<faMatrix<Type>>&
792);
793
794template<class Type>
795tmp<faMatrix<Type>> operator-
796(
798 const tmp<faMatrix<Type>>&
799);
800
801template<class Type>
802tmp<faMatrix<Type>> operator-
803(
805 const tmp<faMatrix<Type>>&
806);
807
808template<class Type>
809tmp<faMatrix<Type>> operator+
810(
811 const faMatrix<Type>&,
812 const dimensioned<Type>&
813);
814
815template<class Type>
816tmp<faMatrix<Type>> operator+
817(
818 const tmp<faMatrix<Type>>&,
819 const dimensioned<Type>&
820);
821
822template<class Type>
823tmp<faMatrix<Type>> operator+
824(
825 const dimensioned<Type>&,
826 const faMatrix<Type>&
827);
828
829template<class Type>
830tmp<faMatrix<Type>> operator+
831(
832 const dimensioned<Type>&,
833 const tmp<faMatrix<Type>>&
834);
835
836template<class Type>
837tmp<faMatrix<Type>> operator-
838(
839 const faMatrix<Type>&,
840 const dimensioned<Type>&
841);
842
843template<class Type>
844tmp<faMatrix<Type>> operator-
845(
846 const tmp<faMatrix<Type>>&,
847 const dimensioned<Type>&
848);
849
850template<class Type>
851tmp<faMatrix<Type>> operator-
852(
853 const dimensioned<Type>&,
854 const faMatrix<Type>&
855);
856
857template<class Type>
858tmp<faMatrix<Type>> operator-
859(
860 const dimensioned<Type>&,
861 const tmp<faMatrix<Type>>&
862);
863
864template<class Type>
865tmp<faMatrix<Type>> operator==
866(
867 const faMatrix<Type>&,
869);
870
871template<class Type>
872tmp<faMatrix<Type>> operator==
873(
874 const faMatrix<Type>&,
876);
877
878template<class Type>
879tmp<faMatrix<Type>> operator==
880(
881 const faMatrix<Type>&,
883);
884
885template<class Type>
886tmp<faMatrix<Type>> operator==
887(
888 const tmp<faMatrix<Type>>&,
890);
891
892template<class Type>
893tmp<faMatrix<Type>> operator==
894(
895 const tmp<faMatrix<Type>>&,
897);
898
899template<class Type>
900tmp<faMatrix<Type>> operator==
901(
902 const tmp<faMatrix<Type>>&,
904);
905
906template<class Type>
907tmp<faMatrix<Type>> operator==
908(
909 const faMatrix<Type>&,
910 const dimensioned<Type>&
911);
912
913template<class Type>
914tmp<faMatrix<Type>> operator==
915(
916 const tmp<faMatrix<Type>>&,
917 const dimensioned<Type>&
918);
919
920
921template<class Type>
922tmp<faMatrix<Type>> operator==
923(
924 const faMatrix<Type>&,
925 const Foam::zero
926);
927
928template<class Type>
929tmp<faMatrix<Type>> operator==
930(
931 const tmp<faMatrix<Type>>&,
932 const Foam::zero
933);
934
935
936template<class Type>
937tmp<faMatrix<Type>> operator*
938(
940 const faMatrix<Type>&
941);
942
943template<class Type>
944tmp<faMatrix<Type>> operator*
945(
947 const faMatrix<Type>&
948);
949
950template<class Type>
951tmp<faMatrix<Type>> operator*
952(
954 const faMatrix<Type>&
955);
956
957template<class Type>
958tmp<faMatrix<Type>> operator*
959(
961 const tmp<faMatrix<Type>>&
962);
963
964template<class Type>
965tmp<faMatrix<Type>> operator*
966(
968 const tmp<faMatrix<Type>>&
969);
970
971template<class Type>
972tmp<faMatrix<Type>> operator*
973(
975 const tmp<faMatrix<Type>>&
976);
977
978
979template<class Type>
980tmp<faMatrix<Type>> operator*
981(
982 const dimensioned<scalar>&,
983 const faMatrix<Type>&
984);
985
986template<class Type>
987tmp<faMatrix<Type>> operator*
988(
989 const dimensioned<scalar>&,
990 const tmp<faMatrix<Type>>&
991);
992
993
994// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
995
996} // End namespace Foam
997
998// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
999
1000#ifdef NoRepository
1001 #include "faMatrix.C"
1002#endif
1003
1004// Specialisation for scalars
1005
1006// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1007
1008#endif
1009
1010// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
Generic templated field type.
Definition: Field.H:82
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
A List with indirect addressing. Like IndirectList but does not store addressing.
Definition: IndirectList.H:79
Mesh data needed to do the Finite Area discretisation.
Definition: areaFaMesh.H:56
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
Generic dimensioned Type class.
SolverPerformance< Type > solve()
Solve returning the solution statistics.
faSolver(faMatrix< Type > &faMat, autoPtr< lduMatrix::solver > &&sol)
Definition: faMatrix.H:205
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatrix.H:76
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
Definition: faMatrix.C:42
const Field< Type > & source() const noexcept
Definition: faMatrix.H:285
void operator=(const faMatrix< Type > &)
Definition: faMatrix.C:759
GeometricField< Type, faePatchField, edgeMesh > faceFluxFieldType
Field type for face flux (for non-orthogonal correction)
Definition: faMatrix.H:89
const FieldField< Field, Type > & internalCoeffs() const noexcept
Definition: faMatrix.H:292
void relax()
Relax matrix (for steady-state solution).
Definition: faMatrix.C:581
SolverPerformance< Type > solve()
Solve returning the solution statistics.
tmp< faMatrix< Type > > clone() const
Construct and return a clone.
Definition: faMatrix.H:256
faceFluxFieldPtrType & faceFluxCorrectionPtr()
Return pointer to face-flux non-orthogonal correction field.
Definition: faMatrix.H:323
FieldField< Field, Type > & internalCoeffs() noexcept
Definition: faMatrix.H:299
tmp< GeometricField< Type, faePatchField, edgeMesh > > flux() const
Return the face-flux field from the matrix.
Definition: faMatrix.C:677
void setValues(const labelUList &faceLabels, const Type &value)
Definition: faMatrix.C:394
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
Definition: faMatrix.H:306
ClassName("faMatrix")
void setReference(const label facei, const Type &value, const bool forceReference=false)
Set reference level for solution.
Definition: faMatrix.C:427
void setReferences(const labelUList &faceLabels, const Type &value, const bool forceReference=false)
Set reference level for solution.
Definition: faMatrix.C:446
void operator+=(const faMatrix< Type > &)
Definition: faMatrix.C:815
const GeometricField< Type, faPatchField, areaMesh > & psi() const
Definition: faMatrix.H:270
GeometricField< Type, faePatchField, edgeMesh > * faceFluxFieldPtrType
Declare return type of the faceFluxCorrectionPtr() function.
Definition: faMatrix.H:320
const dimensionSet & dimensions() const noexcept
Definition: faMatrix.H:275
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
Definition: faMatrix.C:633
void addCmptAvBoundaryDiag(scalarField &diag) const
Definition: faMatrix.C:135
void addBoundarySource(Field< Type > &source, const bool couples=true) const
Definition: faMatrix.C:151
void setComponentReference(const label patchi, const label facei, const direction cmpt, const scalar value)
Definition: faMatrixSolve.C:38
GeometricField< Type, faPatchField, areaMesh > psiFieldType
The geometric field type for psi.
Definition: faMatrix.H:84
virtual ~faMatrix()
Destructor.
Definition: faMatrix.C:291
tmp< areaScalarField > A() const
Return the central coefficient.
Definition: faMatrix.C:606
void operator-=(const faMatrix< Type > &)
Definition: faMatrix.C:849
tmp< Field< Type > > residual() const
Return the matrix residual.
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
Definition: faMatrix.C:117
void negate()
Inplace negate.
Definition: faMatrix.C:800
void setValuesFromList(const labelUList &faceLabels, const ListType< Type > &values)
Set solution in given faces to the specified values.
Definition: faMatrix.C:305
tmp< scalarField > D() const
Return the matrix diagonal.
Definition: faMatrix.C:597
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
Definition: faMatrix.C:80
bool hasFaceFluxCorrection() const noexcept
True if face-flux non-orthogonal correction field exists.
Definition: faMatrix.H:329
FieldField< Field, Type > & boundaryCoeffs() noexcept
Definition: faMatrix.H:313
Field< Type > & source() noexcept
Definition: faMatrix.H:280
void operator*=(const areaScalarField::Internal &)
Definition: faMatrix.C:978
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: faPatchField.H:82
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:84
scalarField & diag()
Definition: lduMatrix.C:192
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
bool
Definition: EEqn.H:20
Namespace for OpenFOAM.
void checkMethod(const faMatrix< Type > &, const faMatrix< Type > &, const char *)
Definition: faMatrix.C:1050
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
uint8_t direction
Definition: direction.H:56
const direction noexcept
Definition: Scalar.H:223
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
volScalarField & alpha
CEqn solve()
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition: stdFoam.H:52