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 &) | |
Copy constructor. More... | |
lduMatrix (lduMatrix &, bool reuse) | |
Copy constructor or re-use as specified. More... | |
lduMatrix (const lduMesh &, Istream &) | |
Construct given an LDU addressed mesh and an Istream. More... | |
~lduMatrix () | |
Destructor. More... | |
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... | |
scalarField & | lower () |
scalarField & | diag () |
scalarField & | upper () |
scalarField & | lower (const label size) |
scalarField & | diag (const label nCoeffs) |
scalarField & | upper (const label nCoeffs) |
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. More... | |
void | Tmul (scalarField &, const tmp< scalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const |
Matrix transpose multiplication with updated interfaces. More... | |
void | sumA (scalarField &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &) const |
Sum the coefficients on each row of the matrix. More... | |
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. More... | |
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. More... | |
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 |
InfoProxy< lduMatrix > | info () const |
Return info proxy. More... | |
void | operator= (const lduMatrix &) |
void | negate () |
void | operator+= (const lduMatrix &) |
void | operator-= (const lduMatrix &) |
void | operator*= (const scalarField &) |
void | operator*= (scalar) |
void | operator/= (const scalarField &) |
void | operator/= (scalar) |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | H (const Field< Type > &psi) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | H (const tmp< Field< Type >> &tpsi) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | faceH (const Field< Type > &psi) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | faceH (const tmp< Field< Type >> &tpsi) const |
Friends | |
Ostream & | operator<< (Ostream &, const lduMatrix &) |
Ostream & | operator<< (Ostream &, const InfoProxy< lduMatrix > &) |
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 hierarchy starting from an empty matrix, then deriving diagonal, symmetric and asymmetric matrices.
Definition at line 79 of file lduMatrix.H.
Construct given an LDU addressed mesh.
The coefficients are initially empty for subsequent setting.
Definition at line 43 of file lduMatrix.C.
Referenced by lduMatrix::preconditioner::preconditionT().
Copy constructor.
Definition at line 52 of file lduMatrix.C.
Copy constructor or re-use as specified.
Definition at line 76 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.
References lduMatrix::hasDiag().
~lduMatrix | ( | ) |
Destructor.
Definition at line 149 of file lduMatrix.C.
Referenced by lduMatrix::preconditioner::preconditionT().
ClassName | ( | "lduMatrix" | ) |
Referenced by lduMatrix::preconditioner::preconditionT().
|
inline |
Return the LDU mesh from which the addressing is obtained.
Definition at line 544 of file lduMatrix.H.
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), GAMGAgglomeration::New(), PCG::solve(), PBiCG::solve(), smoothSolver::solve(), and PBiCGStab::solve().
|
inline |
Return the LDU addressing.
Definition at line 550 of file lduMatrix.H.
References lduMesh::lduAddr().
Referenced by DICPreconditioner::calcReciprocalD(), DILUPreconditioner::calcReciprocalD(), fvMatrix< Type >::DD(), lduMatrix::diag(), lduMatrix::faceH(), lduMatrix::H(), fvMatrix< Type >::H1(), lduMatrix::H1(), lduMatrix::lower(), LUscalarMatrix::LUscalarMatrix(), lduMatrix::negSumDiag(), lduMatrix::operator*=(), lduMatrix::operator/=(), lduMatrix::patchSchedule(), fvMatrix< Type >::relax(), GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), nonBlockingGaussSeidelSmoother::smooth(), lduMatrix::sumDiag(), lduMatrix::sumMagOffDiag(), and lduMatrix::upper().
|
inline |
Return the patch evaluation schedule.
Definition at line 556 of file lduMatrix.H.
References lduMatrix::diag(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::patchSchedule(), and lduMatrix::upper().
Foam::scalarField & lower | ( | ) |
Definition at line 168 of file lduMatrix.C.
References lduMatrix::lduAddr().
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), DILUPreconditioner::calcReciprocalD(), lduMatrix::faceH(), gaussConvectionScheme< Type >::fvmDiv(), GAMGSolver::GAMGSolver(), lduMatrix::H(), lduMatrix::H1(), LUscalarMatrix::LUscalarMatrix(), lduMatrix::negSumDiag(), lduMatrix::operator*=(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator/=(), Foam::operator<<(), lduMatrix::operator=(), lduMatrix::patchSchedule(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), nonBlockingGaussSeidelSmoother::smooth(), lduMatrix::sumDiag(), and lduMatrix::sumMagOffDiag().
Foam::scalarField & diag | ( | ) |
Definition at line 186 of file lduMatrix.C.
References lduMatrix::lduAddr().
Referenced by solidificationMeltingSource::addSup(), fixedCoeff::correct(), powerLaw::correct(), DarcyForchheimer::correct(), powerLawLopesdaCosta::correct(), solidification::correct(), fvMatrix< Type >::D(), fvMatrix< Type >::DD(), EulerD2dt2Scheme< Type >::fvmD2dt2(), EulerDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), CrankNicolsonDdtScheme< Type >::fvmDdt(), GAMGSolver::GAMGSolver(), LUscalarMatrix::LUscalarMatrix(), lduMatrix::negSumDiag(), nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother(), lduMatrix::operator+=(), lduMatrix::operator-=(), Foam::operator<<(), lduMatrix::operator=(), lduMatrix::patchSchedule(), fvMatrix< Type >::relax(), fvMatrix< Type >::setReference(), GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), nonBlockingGaussSeidelSmoother::smooth(), GAMGSolver::solve(), and lduMatrix::sumDiag().
Foam::scalarField & upper | ( | ) |
Definition at line 197 of file lduMatrix.C.
References lduMatrix::lduAddr().
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), DICPreconditioner::calcReciprocalD(), DILUPreconditioner::calcReciprocalD(), lduMatrix::faceH(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), lduMatrix::H(), lduMatrix::H1(), LUscalarMatrix::LUscalarMatrix(), lduMatrix::negSumDiag(), lduMatrix::operator*=(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator/=(), Foam::operator<<(), lduMatrix::operator=(), lduMatrix::patchSchedule(), GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), nonBlockingGaussSeidelSmoother::smooth(), lduMatrix::sumDiag(), and lduMatrix::sumMagOffDiag().
Foam::scalarField & lower | ( | const label | size | ) |
Definition at line 215 of file lduMatrix.C.
Foam::scalarField & diag | ( | const label | nCoeffs | ) |
Definition at line 233 of file lduMatrix.C.
Foam::scalarField & upper | ( | const label | nCoeffs | ) |
Definition at line 244 of file lduMatrix.C.
const Foam::scalarField & lower | ( | ) | const |
Definition at line 262 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
const Foam::scalarField & diag | ( | ) | const |
Definition at line 282 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
const Foam::scalarField & upper | ( | ) | const |
Definition at line 295 of file lduMatrix.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Definition at line 580 of file lduMatrix.H.
Referenced by lduMatrix::lduMatrix(), and Foam::operator<<().
|
inline |
Definition at line 585 of file lduMatrix.H.
Referenced by Foam::operator<<().
|
inline |
Definition at line 590 of file lduMatrix.H.
Referenced by algebraicPairGAMGAgglomeration::algebraicPairGAMGAgglomeration(), and Foam::operator<<().
|
inline |
Definition at line 595 of file lduMatrix.H.
References UPstream::parRun(), and List< T >::size().
Referenced by lduMatrix::solver::New(), lduMatrix::operator+=(), and lduMatrix::operator-=().
|
inline |
Definition at line 609 of file lduMatrix.H.
References UPstream::parRun(), and List< T >::size().
Referenced by lduMatrix::solver::New(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), lduMatrix::operator*=(), lduMatrix::operator+=(), lduMatrix::operator-=(), and lduMatrix::operator/=().
|
inline |
Definition at line 623 of file lduMatrix.H.
References lduMatrix::Amul(), lduMatrix::faceH(), lduMatrix::H(), lduMatrix::H1(), lduMatrix::info(), lduMatrix::initMatrixInterfaces(), lduMatrix::negate(), lduMatrix::negSumDiag(), lduMatrix::operator*=(), lduMatrix::operator+=(), lduMatrix::operator-=(), lduMatrix::operator/=(), lduMatrix::operator<<, lduMatrix::operator=(), UPstream::parRun(), psi, lduMatrix::residual(), List< T >::size(), source(), lduMatrix::sumA(), lduMatrix::sumDiag(), lduMatrix::sumMagOffDiag(), lduMatrix::Tmul(), and lduMatrix::updateMatrixInterfaces().
Referenced by lduMatrix::solver::New(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), lduMatrix::operator*=(), lduMatrix::operator+=(), 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().
Referenced by lduMatrix::asymmetric().
void negSumDiag | ( | ) |
Definition at line 55 of file lduMatrixOperations.C.
References lduMatrix::diag(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), UList< T >::size(), lduMatrix::sumMagOffDiag(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by lduMatrix::asymmetric(), gaussConvectionScheme< Type >::fvmDiv(), and gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected().
void sumMagOffDiag | ( | scalarField & | sumOff | ) | const |
Definition at line 78 of file lduMatrixOperations.C.
References lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), Foam::mag(), UList< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by lduMatrix::asymmetric(), lduMatrix::negSumDiag(), and fvMatrix< Type >::relax().
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(), psi, and lduMatrix::Tmul().
Referenced by lduMatrix::asymmetric().
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(), psi, and lduMatrix::sumA().
Referenced by lduMatrix::Amul(), and lduMatrix::asymmetric().
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, patchi, lduMatrix::residual(), and UPtrList< T >::set().
Referenced by lduMatrix::asymmetric(), and lduMatrix::Tmul().
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, patchi, UPtrList< T >::set(), and UPtrList< T >::size().
Referenced by lduMatrix::asymmetric(), fvMatrix< Type >::residual(), and lduMatrix::sumA().
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 psi, tmp< T >::ref(), scalarField(), List< T >::size(), and source().
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, FatalErrorInFunction, forAll, UPtrList< T >::set(), UPtrList< T >::size(), List< T >::size(), and lduMatrix::updateMatrixInterfaces().
Referenced by lduMatrix::asymmetric(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), and nonBlockingGaussSeidelSmoother::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 97 of file lduMatrixUpdateMatrixInterfaces.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, UPtrList< T >::set(), UPtrList< T >::size(), and List< T >::size().
Referenced by lduMatrix::asymmetric(), lduMatrix::initMatrixInterfaces(), symGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), and nonBlockingGaussSeidelSmoother::smooth().
Referenced by lduMatrix::asymmetric(), lduMatrix::H(), and fvMatrix< Type >::H().
Foam::tmp< Foam::scalarField > H1 | ( | ) | const |
Definition at line 298 of file lduMatrixATmul.C.
References UList< T >::begin(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), tmp< T >::ref(), List< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::H1().
Referenced by lduMatrix::asymmetric(), lduMatrix::faceH(), and fvMatrix< Type >::flux().
Return info proxy.
Used to print matrix information to a stream
Definition at line 736 of file lduMatrix.H.
Referenced by lduMatrix::asymmetric().
void operator= | ( | const lduMatrix & | A | ) |
Definition at line 103 of file lduMatrixOperations.C.
References Foam::abort(), lduMatrix::diag(), Foam::FatalError, lduMatrix::lower(), and lduMatrix::upper().
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator=().
void negate | ( | ) |
Definition at line 140 of file lduMatrixOperations.C.
References Field< Type >::negate().
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::negate().
void operator+= | ( | const lduMatrix & | A | ) |
Definition at line 159 of file lduMatrixOperations.C.
References lduMatrix::asymmetric(), lduMatrix::diag(), lduMatrix::diagonal(), Foam::endl(), lduMatrix::lower(), Foam::nl, lduMatrix::symmetric(), lduMatrix::upper(), and WarningInFunction.
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator+=().
void operator-= | ( | const lduMatrix & | A | ) |
Definition at line 238 of file lduMatrixOperations.C.
References lduMatrix::asymmetric(), lduMatrix::diag(), lduMatrix::diagonal(), Foam::endl(), lduMatrix::lower(), Foam::nl, lduMatrix::symmetric(), lduMatrix::upper(), and WarningInFunction.
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator-=().
void operator*= | ( | const scalarField & | sf | ) |
Definition at line 317 of file lduMatrixOperations.C.
References lduMatrix::asymmetric(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), sf(), List< T >::size(), lduMatrix::symmetric(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator*=().
void operator*= | ( | scalar | s | ) |
Definition at line 347 of file lduMatrixOperations.C.
References s().
void operator/= | ( | const scalarField & | sf | ) |
Definition at line 366 of file lduMatrixOperations.C.
References lduMatrix::asymmetric(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), sf(), List< T >::size(), lduMatrix::symmetric(), lduMatrix::upper(), and lduAddressing::upperAddr().
Referenced by lduMatrix::asymmetric(), and fvMatrix< Type >::operator/=().
void operator/= | ( | scalar | s | ) |
Definition at line 396 of file lduMatrixOperations.C.
References s().
Foam::tmp<Foam::Field<Type> > H | ( | const Field< Type > & | psi | ) | const |
Definition at line 34 of file lduMatrixTemplates.C.
References UList< Type >::begin(), UList< T >::begin(), lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), tmp< T >::ref(), List< T >::size(), lduMatrix::upper(), lduAddressing::upperAddr(), and Foam::Zero.
Foam::tmp<Foam::Field<Type> > H | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 69 of file lduMatrixTemplates.C.
References lduMatrix::H().
Foam::tmp<Foam::Field<Type> > faceH | ( | const Field< Type > & | psi | ) | const |
Definition at line 79 of file lduMatrixTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, lduMatrix::lduAddr(), lduMatrix::lower(), lduAddressing::lowerAddr(), tmp< T >::ref(), List< T >::size(), UList< T >::size(), lduMatrix::upper(), and lduAddressing::upperAddr().
Foam::tmp<Foam::Field<Type> > faceH | ( | const tmp< Field< Type >> & | tpsi | ) | const |
Definition at line 115 of file lduMatrixTemplates.C.
References lduMatrix::faceH().
Referenced by lduMatrix::asymmetric().