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 77f6adfb2a
commit 860fa2b289
3 changed files with 19 additions and 3 deletions

View file

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

View file

@ -295,7 +295,19 @@ bool Foam::BlockLduMatrix<Type>::symmetric() const
<< abort(FatalError); << 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++) 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++) 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]]);
} }
} }
} }