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 &) | |
Construct given an LDU addressed mesh. More... | |
LduMatrix (const LduMatrix< Type, DType, LUType > &) | |
Copy constructor. More... | |
LduMatrix (LduMatrix< Type, DType, LUType > &, bool reuse) | |
Copy constructor or reuse as specified. More... | |
LduMatrix (const lduMesh &, Istream &) | |
Construct given an LDU addressed mesh and an Istream. More... | |
~LduMatrix () | |
const lduMesh & | mesh () const |
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 |
Return interfaces. More... | |
LduInterfaceFieldPtrsList< Type > & | interfaces () |
Return interfaces. More... | |
Field< DType > & | diag () |
Field< LUType > & | upper () |
Field< LUType > & | lower () |
Field< Type > & | source () |
FieldField< Field, LUType > & | interfacesUpper () |
FieldField< Field, LUType > & | interfacesLower () |
const Field< DType > & | diag () const |
const Field< LUType > & | upper () const |
const Field< LUType > & | lower () const |
const Field< Type > & | source () const |
const FieldField< Field, LUType > & | interfacesUpper () const |
const FieldField< Field, LUType > & | interfacesLower () const |
bool | hasDiag () const |
bool | hasUpper () const |
bool | hasLower () const |
bool | hasSource () const |
bool | diagonal () const |
bool | symmetric () const |
bool | asymmetric () const |
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 FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const |
Initialise the update of interfaced interfaces. More... | |
void | updateMatrixInterfaces (const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) 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 > &) |
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.
Note: It might be better if this class were organised as a hierarchy starting from an empty matrix, then deriving diagonal, symmetric and asymmetric matrices.
Definition at line 84 of file LduMatrix.H.
Construct given an LDU addressed mesh.
The coefficients are initially empty for subsequent setting.
Definition at line 32 of file LduMatrix.C.
Copy constructor or reuse as specified.
Construct given an LDU addressed mesh and an Istream.
from which the coefficients are read
Definition at line 143 of file LduMatrix.C.
Definition at line 163 of file LduMatrix.C.
ClassName | ( | "LduMatrix< Type, DType, LUType >" | ) |
|
inline |
Return the LDU mesh from which the addressing is obtained.
Definition at line 492 of file LduMatrix.H.
|
inline |
Return the LDU addressing.
Definition at line 498 of file LduMatrix.H.
References lduMesh::lduAddr().
Referenced by TDILUPreconditioner< Type, DType, LUType >::calcInvD(), LduMatrix< Type, DType, LUType >::patchSchedule(), and TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inline |
Return the patch evaluation schedule.
Definition at line 504 of file LduMatrix.H.
References LduMatrix< Type, DType, LUType >::lduAddr(), and lduAddressing::patchSchedule().
|
inline |
Return interfaces.
Definition at line 510 of file LduMatrix.H.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inline |
Return interfaces.
Definition at line 516 of file LduMatrix.H.
Foam::Field< DType > & diag |
Definition at line 190 of file LduMatrix.C.
References Foam::Zero.
Foam::Field< LUType > & upper |
Definition at line 202 of file LduMatrix.C.
References Foam::Zero.
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().
Foam::Field< LUType > & lower |
Definition at line 225 of file LduMatrix.C.
References Foam::Zero.
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().
Foam::Field< Type > & source |
Definition at line 248 of file LduMatrix.C.
References Foam::Zero.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inline |
Definition at line 529 of file LduMatrix.H.
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
|
inline |
Definition at line 534 of file LduMatrix.H.
const Foam::Field< DType > & diag |
Definition at line 260 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
const Foam::Field< LUType > & upper |
Definition at line 274 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
const Foam::Field< LUType > & lower |
Definition at line 295 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
const Foam::Field< Type > & source |
Definition at line 316 of file LduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Definition at line 545 of file LduMatrix.H.
|
inline |
Definition at line 550 of file LduMatrix.H.
|
inline |
Definition at line 556 of file LduMatrix.H.
|
inline |
Definition at line 561 of file LduMatrix.H.
|
inline |
Definition at line 566 of file LduMatrix.H.
|
inline |
Definition at line 571 of file LduMatrix.H.
|
inline |
Definition at line 576 of file LduMatrix.H.
References UPstream::parRun(), and List< T >::size().
|
inline |
Definition at line 590 of file LduMatrix.H.
References UPstream::parRun(), and List< T >::size().
|
inline |
Definition at line 604 of file LduMatrix.H.
References UPstream::parRun(), and List< T >::size().
void sumDiag |
Definition at line 31 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 54 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 77 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 63 of file LduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), Foam::dot(), and psi.
Matrix transpose multiplication.
Definition at line 117 of file LduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), Foam::dot(), and psi.
void sumA | ( | Field< Type > & | sumA | ) | const |
Sum the coefficients on each row of the matrix.
Definition at line 170 of file LduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), Foam::dot(), forAll, and patchi.
Definition at line 218 of file LduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), Foam::dot(), forAll, patchi, psi, and PtrList< T >::set().
Foam::tmp< Foam::Field< Type > > residual | ( | const Field< Type > & | psi | ) | const |
Definition at line 283 of file LduMatrixATmul.C.
References psi, and tmp< T >::ref().
void initMatrixInterfaces | ( | 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 32 of file LduMatrixUpdateMatrixInterfaces.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and List< T >::size().
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
void updateMatrixInterfaces | ( | const FieldField< Field, LUType > & | interfaceCoeffs, |
const Field< Type > & | psiif, | ||
Field< Type > & | result | ||
) | const |
Update interfaced interfaces for matrix operations.
Definition at line 97 of file LduMatrixUpdateMatrixInterfaces.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and List< T >::size().
Referenced by TGaussSeidelSmoother< Type, DType, LUType >::smooth().
Foam::tmp< Foam::Field< Type > > H | ( | const Field< Type > & | psi | ) | const |
Definition at line 103 of file LduMatrixOperations.C.
References UList< T >::begin(), psi, and Foam::Zero.
Foam::tmp< Foam::Field< Type > > H | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 138 of file LduMatrixOperations.C.
Foam::tmp< Foam::Field< Type > > faceH | ( | const Field< Type > & | psi | ) | const |
Definition at line 148 of file LduMatrixOperations.C.
References LduMatrix< Type, DType, LUType >::lower(), psi, UList< T >::size(), List< T >::size(), and LduMatrix< Type, DType, LUType >::upper().
Foam::tmp< Foam::Field< Type > > faceH | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 171 of file LduMatrixOperations.C.
Definition at line 182 of file LduMatrixOperations.C.
References A, Foam::abort(), Foam::diag(), Foam::FatalError, and FatalErrorInFunction.
void negate |
Definition at line 227 of file LduMatrixOperations.C.
References Foam::negate().
Definition at line 255 of file LduMatrixOperations.C.
References A, Foam::abort(), Foam::diag(), Foam::FatalError, and FatalErrorInFunction.
Definition at line 332 of file LduMatrixOperations.C.
References A, Foam::abort(), Foam::diag(), Foam::FatalError, and FatalErrorInFunction.
void operator*= | ( | const scalarField & | sf | ) |
Definition at line 409 of file LduMatrixOperations.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, sf(), and List< T >::size().
void operator*= | ( | scalar | s | ) |
Definition at line 457 of file LduMatrixOperations.C.
References s().
|
friend |
Definition at line 104 of file LduMatrix.H.