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...
#include <OpenFOAM/lduMatrix.H>
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.
It might be better if this class were organised as a hierachy starting from an empty matrix, then deriving diagonal, symmetric and asymmetric matrices.
Definition at line 76 of file lduMatrix.H.
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...
| |
class | solverPerformance |
Class returned by the solver, containing performance statistics. More...
| |
Public Member Functions | |
ClassName ("lduMatrix") | |
lduMatrix (const lduMesh &) | |
Construct given an LDU addressed mesh.
| |
lduMatrix (const lduMatrix &) | |
Construct as copy.
| |
lduMatrix (lduMatrix &, bool reUse) | |
Construct as copy or re-use as specified.
| |
lduMatrix (const lduMesh &, Istream &) | |
Construct given an LDU addressed mesh and an Istream.
| |
~lduMatrix () | |
const lduMesh & | mesh () const |
Return the LDU mesh from which the addressing is obtained.
| |
const lduAddressing & | lduAddr () const |
Return the LDU addressing.
| |
const lduSchedule & | patchSchedule () const |
Return the patch evaluation schedule.
| |
scalarField & | lower () |
scalarField & | diag () |
scalarField & | upper () |
const scalarField & | lower () const |
const scalarField & | diag () const |
const scalarField & | upper () const |
bool | hasDiag () const |
bool | hasUpper () const |
bool | hasLower () const |
bool | diagonal () const |
bool | symmetric () const |
bool | asymmetric () const |
void | sumDiag () |
void | negSumDiag () |
void | sumMagOffDiag (scalarField &sumOff) const |
void | Amul (scalarField &, const tmp< scalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const |
Matrix multiplication with updated interfaces.
| |
void | Tmul (scalarField &, const tmp< scalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const |
Matrix transpose multiplication with updated interfaces.
| |
void | sumA (scalarField &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &) const |
Sum the coefficients on each row of the matrix.
| |
void | residual (scalarField &rA, const scalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const |
tmp< scalarField > | residual (const scalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const |
void | initMatrixInterfaces (const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const |
Initialise the update of interfaced interfaces.
| |
void | updateMatrixInterfaces (const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const scalarField &psiif, scalarField &result, const direction cmpt) const |
Update interfaced interfaces for matrix operations.
| |
template<class Type > | |
tmp< Field< Type > > | H (const Field< Type > &) const |
template<class Type > | |
tmp< Field< Type > > | H (const tmp< Field< Type > > &) const |
tmp< scalarField > | H1 () const |
template<class Type > | |
tmp< Field< Type > > | faceH (const Field< Type > &) const |
template<class Type > | |
tmp< Field< Type > > | faceH (const tmp< Field< Type > > &) const |
void | operator= (const lduMatrix &) |
void | negate () |
void | operator+= (const lduMatrix &) |
void | operator-= (const lduMatrix &) |
void | operator*= (const scalarField &) |
void | operator*= (scalar) |
Static Public Attributes | |
static const scalar | great_ = 1.0e+20 |
Large scalar for the use in solvers.
| |
static const scalar | small_ = 1.0e-20 |
Small scalar for the use in solvers.
| |
Friends | |
Ostream & | operator<< (Ostream &, const lduMatrix &) |
Construct given an LDU addressed mesh.
The coefficients are initially empty for subsequent setting.
Definition at line 42 of file lduMatrix.C.
Construct as copy.
Definition at line 51 of file lduMatrix.C.
Construct as copy or re-use as specified.
Definition at line 75 of file lduMatrix.C.
Construct given an LDU addressed mesh and an Istream.
from which the coefficients are read
Definition at line 123 of file lduMatrix.C.
~lduMatrix | ( | ) |
Definition at line 135 of file lduMatrix.C.
ClassName | ( | "lduMatrix" | ) |
const lduMesh& mesh | ( | ) | const [inline]
|
Return the LDU mesh from which the addressing is obtained.
Definition at line 671 of file lduMatrix.H.
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), and GAMGAgglomeration::New().
const lduAddressing& lduAddr | ( | ) | const [inline]
|
Return the LDU addressing.
Definition at line 677 of file lduMatrix.H.
References lduMesh::lduAddr().
Referenced by DILUPreconditioner::calcReciprocalD(), DICPreconditioner::calcReciprocalD(), lduMatrix::H(), LUscalarMatrix::LUscalarMatrix(), lduMatrix::patchSchedule(), GaussSeidelSmoother::smooth(), and lduMatrix::sumDiag().
const lduSchedule& patchSchedule | ( | ) | const [inline]
|
Return the patch evaluation schedule.
Definition at line 683 of file lduMatrix.H.
References lduMatrix::lduAddr(), and lduAddressing::patchSchedule().
Foam::scalarField & lower | ( | ) |
Definition at line 154 of file lduMatrix.C.
Referenced by DILUPreconditioner::calcReciprocalD(), lduMatrix::faceH(), gaussConvectionScheme< Type >::fvmDiv(), lduMatrix::H(), lduMatrix::negSumDiag(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator=(), GaussSeidelSmoother::smooth(), lduMatrix::sumDiag(), and lduMatrix::sumMagOffDiag().
Foam::scalarField & diag | ( | ) |
Definition at line 172 of file lduMatrix.C.
Referenced by porousZone::addResistance(), EulerD2dt2Scheme< Type >::fvmD2dt2(), SLTSDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), EulerDdtScheme< Type >::fvmDdt(), CrankNicholsonDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), boundedBackwardDdtScheme::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), porousZone::modifyDdt(), Foam::operator&(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator=(), GaussSeidelSmoother::smooth(), Foam::fvm::Sp(), lduMatrix::sumDiag(), and Foam::fvm::SuSp().
Foam::scalarField & upper | ( | ) |
Definition at line 183 of file lduMatrix.C.
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), DILUPreconditioner::calcReciprocalD(), DICPreconditioner::calcReciprocalD(), lduMatrix::faceH(), gaussConvectionScheme< Type >::fvmDiv(), lduMatrix::H(), lduMatrix::negSumDiag(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator=(), GaussSeidelSmoother::smooth(), lduMatrix::sumDiag(), and lduMatrix::sumMagOffDiag().
const Foam::scalarField & lower | ( | ) | const |
Definition at line 201 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
const Foam::scalarField & diag | ( | ) | const |
Definition at line 221 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
const Foam::scalarField & upper | ( | ) | const |
Definition at line 234 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
bool hasDiag | ( | ) | const [inline]
|
Definition at line 699 of file lduMatrix.H.
bool hasUpper | ( | ) | const [inline]
|
Definition at line 704 of file lduMatrix.H.
Referenced by Foam::correction().
bool hasLower | ( | ) | const [inline]
|
Definition at line 709 of file lduMatrix.H.
Referenced by Foam::correction().
bool diagonal | ( | ) | const [inline]
|
Definition at line 714 of file lduMatrix.H.
Referenced by lduMatrix::solver::New(), lduMatrix::operator+=(), and lduMatrix::operator-=().
bool symmetric | ( | ) | const [inline]
|
Definition at line 719 of file lduMatrix.H.
Referenced by lduMatrix::solver::New(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), lduMatrix::operator+=(), and lduMatrix::operator-=().
bool asymmetric | ( | ) | const [inline]
|
Definition at line 724 of file lduMatrix.H.
Referenced by lduMatrix::solver::New(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), lduMatrix::operator+=(), and lduMatrix::operator-=().
void sumDiag | ( | ) |
Definition at line 33 of file lduMatrixOperations.C.
References lduMatrix::diag(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), UList< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().
void negSumDiag | ( | ) |
Definition at line 50 of file lduMatrixOperations.C.
References Foam::diag(), lduMatrix::lower(), UList< T >::size(), and lduMatrix::upper().
Referenced by gaussConvectionScheme< Type >::fvmDiv().
void sumMagOffDiag | ( | scalarField & | sumOff ) | const |
Definition at line 68 of file lduMatrixOperations.C.
References lduMatrix::lower(), Foam::mag(), UList< T >::size(), and lduMatrix::upper().
void Amul | ( | scalarField & | Apsi, |
const tmp< scalarField > & | tpsi, | ||
const FieldField< Field, scalar > & | interfaceBouCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces, | ||
const direction | cmpt | ||
) | const |
Matrix multiplication with updated interfaces.
Definition at line 35 of file lduMatrixATmul.C.
References UList< T >::begin(), tmp< T >::clear(), Foam::diag(), and psi.
void Tmul | ( | scalarField & | Tpsi, |
const tmp< scalarField > & | tpsi, | ||
const FieldField< Field, scalar > & | interfaceIntCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces, | ||
const direction | cmpt | ||
) | const |
Matrix transpose multiplication with updated interfaces.
Definition at line 96 of file lduMatrixATmul.C.
References UList< T >::begin(), tmp< T >::clear(), Foam::diag(), and psi.
void sumA | ( | scalarField & | sumA, |
const FieldField< Field, scalar > & | interfaceBouCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces | ||
) | const |
Sum the coefficients on each row of the matrix.
Definition at line 155 of file lduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), forAll, and UPtrList< T >::set().
void residual | ( | scalarField & | rA, |
const scalarField & | psi, | ||
const scalarField & | source, | ||
const FieldField< Field, scalar > & | interfaceBouCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces, | ||
const direction | cmpt | ||
) | const |
Definition at line 204 of file lduMatrixATmul.C.
References UList< T >::begin(), Foam::diag(), forAll, UPtrList< T >::set(), and PtrList< T >::size().
Referenced by fvMatrix< Type >::residual().
Foam::tmp< Foam::scalarField > residual | ( | const scalarField & | psi, |
const scalarField & | source, | ||
const FieldField< Field, scalar > & | interfaceBouCoeffs, | ||
const lduInterfaceFieldPtrsList & | interfaces, | ||
const direction | cmpt | ||
) | const |
Definition at line 284 of file lduMatrixATmul.C.
References List< T >::size().
void initMatrixInterfaces | ( | const FieldField< Field, scalar > & | interfaceCoeffs, |
const lduInterfaceFieldPtrsList & | interfaces, | ||
const scalarField & | psiif, | ||
scalarField & | result, | ||
const direction | cmpt | ||
) | const |
Initialise the update of interfaced interfaces.
for matrix operations
Definition at line 31 of file lduMatrixUpdateMatrixInterfaces.C.
References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, UPtrList< T >::set(), UPtrList< T >::size(), and List< T >::size().
Referenced by GaussSeidelSmoother::smooth().
void updateMatrixInterfaces | ( | const FieldField< Field, scalar > & | interfaceCoeffs, |
const lduInterfaceFieldPtrsList & | interfaces, | ||
const scalarField & | psiif, | ||
scalarField & | result, | ||
const direction | cmpt | ||
) | const |
Update interfaced interfaces for matrix operations.
Definition at line 99 of file lduMatrixUpdateMatrixInterfaces.C.
References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, UPtrList< T >::set(), UPtrList< T >::size(), and List< T >::size().
Referenced by GaussSeidelSmoother::smooth().
Foam::tmp< Foam::Field< Type > > H | ( | const Field< Type > & | psi ) | const |
Definition at line 34 of file lduMatrixTemplates.C.
References UList< T >::begin(), UList< Type >::begin(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), List< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by fvMatrix< Type >::H().
Foam::tmp< Foam::Field< Type > > H | ( | const tmp< Field< Type > > & | tpsi ) | const |
Definition at line 69 of file lduMatrixTemplates.C.
Foam::tmp< Foam::scalarField > H1 | ( | ) | const |
Reimplemented in fvMatrix< Type >, fvMatrix< Type >, and fvMatrix< Type >.
Definition at line 332 of file lduMatrixOperations.C.
References UList< T >::begin().
Referenced by fvMatrix< Type >::H1().
Foam::tmp< Foam::Field< Type > > faceH | ( | const Field< Type > & | psi ) | const |
Definition at line 79 of file lduMatrixTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorIn, lduMatrix::lower(), UList< T >::size(), List< T >::size(), and lduMatrix::upper().
Referenced by fvMatrix< Type >::flux().
Foam::tmp< Foam::Field< Type > > faceH | ( | const tmp< Field< Type > > & | tpsi ) | const |
Definition at line 113 of file lduMatrixTemplates.C.
void operator= | ( | const lduMatrix & | A ) |
Definition at line 88 of file lduMatrixOperations.C.
References Foam::abort(), lduMatrix::diag(), Foam::diag(), Foam::FatalError, lduMatrix::lower(), and lduMatrix::upper().
Referenced by fvMatrix< Type >::operator=().
void negate | ( | ) |
Reimplemented in fvMatrix< Type >.
Definition at line 125 of file lduMatrixOperations.C.
Referenced by fvMatrix< Type >::negate().
void operator+= | ( | const lduMatrix & | A ) |
Definition at line 144 of file lduMatrixOperations.C.
References Foam::abort(), lduMatrix::asymmetric(), lduMatrix::diag(), Foam::diag(), lduMatrix::diagonal(), Foam::FatalError, FatalErrorIn, lduMatrix::lower(), lduMatrix::symmetric(), and lduMatrix::upper().
Referenced by fvMatrix< Type >::operator+=().
void operator-= | ( | const lduMatrix & | A ) |
Definition at line 212 of file lduMatrixOperations.C.
References Foam::abort(), lduMatrix::asymmetric(), lduMatrix::diag(), Foam::diag(), lduMatrix::diagonal(), Foam::FatalError, FatalErrorIn, lduMatrix::lower(), lduMatrix::symmetric(), and lduMatrix::upper().
Referenced by fvMatrix< Type >::operator-=().
void operator*= | ( | const scalarField & | sf ) |
Definition at line 280 of file lduMatrixOperations.C.
References List< T >::size().
Referenced by fvMatrix< Type >::operator*=().
void operator*= | ( | scalar | s ) |
Definition at line 313 of file lduMatrixOperations.C.
const Foam::scalar great_ = 1.0e+20 [static]
|
Large scalar for the use in solvers.
Definition at line 638 of file lduMatrix.H.
const Foam::scalar small_ = 1.0e-20 [static]
|
Small scalar for the use in solvers.
Definition at line 641 of file lduMatrix.H.