LduMatrix is a general matrix class in which the coefficients are stored as three arrays, one for the upper triangle, one for the lower triangle and a third for the diagonal. More...
Classes | |
class | preconditioner |
Abstract base-class for LduMatrix preconditioners. More... | |
class | smoother |
Abstract base-class for LduMatrix smoothers. More... | |
class | solver |
Abstract base-class for LduMatrix solvers. More... | |
Public Member Functions | |
ClassName ("LduMatrix") | |
LduMatrix (const lduMesh &mesh) | |
Construct given an LDU addressed mesh. More... | |
LduMatrix (const LduMatrix< Type, DType, LUType > &) | |
Copy construct. More... | |
LduMatrix (LduMatrix< Type, DType, LUType > &&) | |
Move construct. More... | |
LduMatrix (LduMatrix< Type, DType, LUType > &, bool reuse) | |
Construct as copy or re-use as specified. More... | |
LduMatrix (const lduMesh &mesh, Istream &is) | |
Construct given an LDU addressed mesh and an Istream from which the coefficients are read. More... | |
~LduMatrix ()=default | |
Destructor. More... | |
const lduMesh & | mesh () const noexcept |
Return the LDU mesh from which the addressing is obtained. More... | |
const lduAddressing & | lduAddr () const |
Return the LDU addressing. More... | |
const lduSchedule & | patchSchedule () const |
Return the patch evaluation schedule. More... | |
const LduInterfaceFieldPtrsList< Type > & | interfaces () const noexcept |
Const access to the interfaces. More... | |
LduInterfaceFieldPtrsList< Type > & | interfaces () noexcept |
Non-const access to the interfaces. More... | |
const Field< DType > & | diag () const |
const Field< LUType > & | upper () const |
const Field< LUType > & | lower () const |
const Field< Type > & | source () const |
Field< DType > & | diag () |
Field< LUType > & | upper () |
Field< LUType > & | lower () |
Field< Type > & | source () |
const FieldField< Field, LUType > & | interfacesUpper () const noexcept |
const FieldField< Field, LUType > & | interfacesLower () const noexcept |
FieldField< Field, LUType > & | interfacesUpper () noexcept |
FieldField< Field, LUType > & | interfacesLower () noexcept |
word | matrixTypeName () const |
The matrix type (empty, diagonal, symmetric, ...) More... | |
bool | hasDiag () const noexcept |
bool | hasUpper () const noexcept |
bool | hasLower () const noexcept |
bool | hasSource () const noexcept |
bool | diagonal () const noexcept |
Matrix has diagonal only. More... | |
bool | symmetric () const noexcept |
Matrix is symmetric. More... | |
bool | asymmetric () const noexcept |
Matrix is asymmetric (ie, full) More... | |
void | sumDiag () |
void | negSumDiag () |
void | sumMagOffDiag (Field< LUType > &sumOff) const |
void | Amul (Field< Type > &, const tmp< Field< Type >> &) const |
Matrix multiplication. More... | |
void | Tmul (Field< Type > &, const tmp< Field< Type >> &) const |
Matrix transpose multiplication. More... | |
void | sumA (Field< Type > &) const |
Sum the coefficients on each row of the matrix. More... | |
void | residual (Field< Type > &rA, const Field< Type > &psi) const |
tmp< Field< Type > > | residual (const Field< Type > &psi) const |
void | initMatrixInterfaces (const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const |
Initialise the update of interfaced interfaces. More... | |
void | updateMatrixInterfaces (const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result, const label startRequest) const |
Update interfaced interfaces for matrix operations. More... | |
tmp< Field< Type > > | H (const Field< Type > &) const |
tmp< Field< Type > > | H (const tmp< Field< Type >> &) const |
tmp< Field< Type > > | faceH (const Field< Type > &) const |
tmp< Field< Type > > | faceH (const tmp< Field< Type >> &) const |
void | operator= (const LduMatrix< Type, DType, LUType > &) |
Copy assignment. More... | |
void | operator= (LduMatrix< Type, DType, LUType > &&) |
Move assignment. More... | |
void | negate () |
void | operator+= (const LduMatrix< Type, DType, LUType > &) |
void | operator-= (const LduMatrix< Type, DType, LUType > &) |
void | operator*= (const scalarField &) |
void | operator*= (scalar) |
Friends | |
class | SolverPerformance< Type > |
Ostream & | operator (Ostream &, const LduMatrix< Type, DType, LUType > &) |
LduMatrix is a general matrix class in which the coefficients are stored as three arrays, one for the upper triangle, one for the lower triangle and a third for the diagonal.
Addressing arrays must be supplied for the upper and lower triangles.
Definition at line 68 of file LduMatrix.H.
Construct given an LDU addressed mesh.
The coefficients are initially empty for subsequent setting. Not yet 'explicit' (legacy code may rely on implicit construct)
Definition at line 28 of file LduMatrix.C.
Construct as copy or re-use as specified.
Construct given an LDU addressed mesh and an Istream from which the coefficients are read.
Definition at line 117 of file LduMatrix.C.
|
default |
Destructor.
ClassName | ( | "LduMatrix< Type, DType, LUType >" | ) |
|
inlinenoexcept |
Return the LDU mesh from which the addressing is obtained.
Definition at line 608 of file LduMatrix.H.
|
inline |
Return the LDU addressing.
Definition at line 616 of file LduMatrix.H.
Referenced by TDILUPreconditioner< Type, DType, LUType >::calcInvD(), and TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inline |
Return the patch evaluation schedule.
Definition at line 624 of file LduMatrix.H.
|
inlinenoexcept |
Const access to the interfaces.
Definition at line 632 of file LduMatrix.H.
|
inlinenoexcept |
Non-const access to the interfaces.
Definition at line 640 of file LduMatrix.H.
const Foam::Field< DType > & diag | ( | ) | const |
Definition at line 151 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by fvMatrix< Type >::solveCoupled(), and TGaussSeidelSmoother< Type, DType, LUType >::TGaussSeidelSmoother().
const Foam::Field< LUType > & upper | ( | ) | const |
Definition at line 178 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by TDILUPreconditioner< Type, DType, LUType >::calcInvD(), LduMatrix< Type, DType, LUType >::faceH(), LduMatrix< Type, DType, LUType >::negSumDiag(), TGaussSeidelSmoother< Type, DType, LUType >::smooth(), LduMatrix< Type, DType, LUType >::sumDiag(), and LduMatrix< Type, DType, LUType >::sumMagOffDiag().
const Foam::Field< LUType > & lower | ( | ) | const |
Definition at line 223 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by TDILUPreconditioner< Type, DType, LUType >::calcInvD(), LduMatrix< Type, DType, LUType >::faceH(), LduMatrix< Type, DType, LUType >::negSumDiag(), TGaussSeidelSmoother< Type, DType, LUType >::smooth(), LduMatrix< Type, DType, LUType >::sumDiag(), and LduMatrix< Type, DType, LUType >::sumMagOffDiag().
const Foam::Field< Type > & source | ( | ) | const |
Definition at line 267 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
Foam::Field< DType > & diag | ( | ) |
Definition at line 165 of file LduMatrix.C.
Foam::Field< LUType > & upper | ( | ) |
Definition at line 199 of file LduMatrix.C.
Foam::Field< LUType > & lower | ( | ) |
Definition at line 244 of file LduMatrix.C.
Foam::Field< Type > & source | ( | ) |
Definition at line 281 of file LduMatrix.C.
|
inlinenoexcept |
Definition at line 661 of file LduMatrix.H.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inlinenoexcept |
Definition at line 666 of file LduMatrix.H.
|
inlinenoexcept |
Definition at line 671 of file LduMatrix.H.
|
inlinenoexcept |
Definition at line 676 of file LduMatrix.H.
Foam::word matrixTypeName | ( | ) | const |
The matrix type (empty, diagonal, symmetric, ...)
Definition at line 133 of file LduMatrix.C.
|
inlinenoexcept |
Definition at line 689 of file LduMatrix.H.
|
inlinenoexcept |
Definition at line 690 of file LduMatrix.H.
|
inlinenoexcept |
Definition at line 691 of file LduMatrix.H.
|
inlinenoexcept |
Definition at line 692 of file LduMatrix.H.
|
inlinenoexcept |
Matrix has diagonal only.
Definition at line 697 of file LduMatrix.H.
Referenced by LduMatrix< Type, DType, LUType >::solver::New().
|
inlinenoexcept |
Matrix is symmetric.
Definition at line 705 of file LduMatrix.H.
Referenced by LduMatrix< Type, DType, LUType >::solver::New(), and LduMatrix< Type, DType, LUType >::smoother::New().
|
inlinenoexcept |
Matrix is asymmetric (ie, full)
Definition at line 713 of file LduMatrix.H.
Referenced by LduMatrix< Type, DType, LUType >::solver::New(), and LduMatrix< Type, DType, LUType >::smoother::New().
void sumDiag | ( | ) |
Definition at line 27 of file LduMatrixOperations.C.
References Foam::diag(), LduMatrix< Type, DType, LUType >::lower(), UList< T >::size(), and LduMatrix< Type, DType, LUType >::upper().
void negSumDiag | ( | ) |
Definition at line 45 of file LduMatrixOperations.C.
References Foam::diag(), LduMatrix< Type, DType, LUType >::lower(), UList< T >::size(), and LduMatrix< Type, DType, LUType >::upper().
void sumMagOffDiag | ( | Field< LUType > & | sumOff | ) | const |
Definition at line 64 of file LduMatrixOperations.C.
References Foam::cmptMag(), LduMatrix< Type, DType, LUType >::lower(), UList< T >::size(), and LduMatrix< Type, DType, LUType >::upper().
Matrix multiplication.
Definition at line 28 of file LduMatrixATmul.C.
References UList< Type >::begin(), Foam::diag(), Foam::dot(), Foam::stringOps::lower(), psi, and Foam::stringOps::upper().
Matrix transpose multiplication.
Definition at line 87 of file LduMatrixATmul.C.
References UList< Type >::begin(), Foam::diag(), Foam::dot(), Foam::stringOps::lower(), psi, and Foam::stringOps::upper().
void sumA | ( | Field< Type > & | sumA | ) | const |
Sum the coefficients on each row of the matrix.
Definition at line 145 of file LduMatrixATmul.C.
References UList< Type >::begin(), Foam::diag(), Foam::dot(), forAll, Foam::stringOps::lower(), and Foam::stringOps::upper().
Definition at line 193 of file LduMatrixATmul.C.
References UList< Type >::begin(), Foam::diag(), Foam::dot(), Foam::stringOps::lower(), psi, and Foam::stringOps::upper().
Foam::tmp< Foam::Field< Type > > residual | ( | const Field< Type > & | psi | ) | const |
Definition at line 253 of file LduMatrixATmul.C.
References Foam::New(), and psi.
void initMatrixInterfaces | ( | const bool | add, |
const FieldField< Field, LUType > & | interfaceCoeffs, | ||
const Field< Type > & | psiif, | ||
Field< Type > & | result | ||
) | const |
Initialise the update of interfaced interfaces.
for matrix operations
Definition at line 29 of file LduMatrixUpdateMatrixInterfaces.C.
References Foam::add(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
void updateMatrixInterfaces | ( | const bool | add, |
const FieldField< Field, LUType > & | interfaceCoeffs, | ||
const Field< Type > & | psiif, | ||
Field< Type > & | result, | ||
const label | startRequest | ||
) | const |
Update interfaced interfaces for matrix operations.
Definition at line 101 of file LduMatrixUpdateMatrixInterfaces.C.
References Foam::add(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and forAll.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
Foam::tmp< Foam::Field< Type > > H | ( | const Field< Type > & | psi | ) | const |
Definition at line 84 of file LduMatrixOperations.C.
References Foam::stringOps::lower(), Foam::New(), psi, and Foam::stringOps::upper().
Foam::tmp< Foam::Field< Type > > H | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 114 of file LduMatrixOperations.C.
References H().
Foam::tmp< Foam::Field< Type > > faceH | ( | const Field< Type > & | psi | ) | const |
Definition at line 124 of file LduMatrixOperations.C.
References LduMatrix< Type, DType, LUType >::lower(), Foam::New(), psi, UList< Type >::size(), UList< T >::size(), and LduMatrix< Type, DType, LUType >::upper().
Foam::tmp< Foam::Field< Type > > faceH | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 147 of file LduMatrixOperations.C.
void negate | ( | ) |
Definition at line 217 of file LduMatrixOperations.C.
References Foam::negate().
Definition at line 245 of file LduMatrixOperations.C.
References A, Foam::abort(), Foam::diag(), Foam::FatalError, FatalErrorInFunction, Foam::stringOps::lower(), and Foam::stringOps::upper().
Definition at line 322 of file LduMatrixOperations.C.
References A, Foam::abort(), Foam::diag(), Foam::FatalError, FatalErrorInFunction, Foam::stringOps::lower(), and Foam::stringOps::upper().
void operator*= | ( | const scalarField & | sf | ) |
Definition at line 400 of file LduMatrixOperations.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::stringOps::lower(), and Foam::stringOps::upper().
void operator*= | ( | scalar | s | ) |
Definition at line 447 of file LduMatrixOperations.C.
References s.
|
friend |
Definition at line 130 of file LduMatrix.H.