mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
LduMatrix: Sum-diag operations for diagonal matrices
This commit is contained in:
@ -30,6 +30,11 @@ License
|
||||
template<class Type, class DType, class LUType>
|
||||
void Foam::LduMatrix<Type, DType, LUType>::sumDiag()
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Field<LUType>& Lower = const_cast<const LduMatrix&>(*this).lower();
|
||||
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
|
||||
Field<DType>& Diag = diag();
|
||||
@ -48,6 +53,11 @@ void Foam::LduMatrix<Type, DType, LUType>::sumDiag()
|
||||
template<class Type, class DType, class LUType>
|
||||
void Foam::LduMatrix<Type, DType, LUType>::negSumDiag()
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Field<LUType>& Lower = const_cast<const LduMatrix&>(*this).lower();
|
||||
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
|
||||
Field<DType>& Diag = diag();
|
||||
@ -69,6 +79,11 @@ void Foam::LduMatrix<Type, DType, LUType>::sumMagOffDiag
|
||||
Field<LUType>& sumOff
|
||||
) const
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Field<LUType>& Lower = const_cast<const LduMatrix&>(*this).lower();
|
||||
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,6 +32,11 @@ Description
|
||||
|
||||
void Foam::lduMatrix::sumDiag()
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||
scalarField& Diag = diag();
|
||||
@ -49,6 +54,11 @@ void Foam::lduMatrix::sumDiag()
|
||||
|
||||
void Foam::lduMatrix::negSumDiag()
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||
scalarField& Diag = diag();
|
||||
@ -69,6 +79,11 @@ void Foam::lduMatrix::sumMagOffDiag
|
||||
scalarField& sumOff
|
||||
) const
|
||||
{
|
||||
if (!lowerPtr_ && !upperPtr_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user