Missing transpose in BlockLduMatrix TMulCore and new formulation of symmetry for block matrix

This commit is contained in:
Vuko Vukcevic 2015-09-09 15:59:41 +02:00 committed by Hrvoje Jasak
parent 5489451f08
commit 0ed1532938
3 changed files with 19 additions and 3 deletions

View file

@ -257,6 +257,8 @@ public:
const CoeffField<Type>& f,
const labelList& addr
);
// Member operators
void operator=(const CoeffField<Type>&);

View file

@ -295,7 +295,19 @@ bool Foam::BlockLduMatrix<Type>::symmetric() const
<< abort(FatalError);
}
return (diagPtr_ && (!lowerPtr_ && upperPtr_));
// Assuming that the matrix is not symmetric if diag or upper are square
// type coefficients. VV and HJ, 9/Sep/2015.
bool activeSquare = false;
if
(
diagPtr_->activeType() == blockCoeffBase::SQUARE
|| upperPtr_->activeType() == blockCoeffBase::SQUARE
)
{
activeSquare = true;
}
return (diagPtr_ && (!lowerPtr_ && upperPtr_) && !activeSquare);
}

View file

@ -237,7 +237,8 @@ void Foam::BlockLduMatrix<Type>::TmulCore
for (register label coeffI = 0; coeffI < u.size(); coeffI++)
{
Tx[u[coeffI]] += mult(activeUpper[coeffI], x[l[coeffI]]);
// Bug fix: Missing transpose. VV, 31/Aug/2015.
Tx[u[coeffI]] += mult(activeUpper[coeffI].T(), x[l[coeffI]]);
}
}
@ -303,7 +304,8 @@ void Foam::BlockLduMatrix<Type>::TmulCore
for (register label coeffI = 0; coeffI < u.size(); coeffI++)
{
Tx[l[coeffI]] += mult(activeLower[coeffI], x[u[coeffI]]);
// Bug fix: Missing transpose. VV, 31/Aug/2015.
Tx[l[coeffI]] += mult(activeLower[coeffI].T(), x[u[coeffI]]);
}
}
}