mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
lduMatrixOperations: Added support for scaling symmetric matrices
Note: non-uniform scaling of a symmetric matrix generates an asymmetric matrix
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -306,23 +306,20 @@ void Foam::lduMatrix::operator*=(const scalarField& sf)
|
||||
*diagPtr_ *= sf;
|
||||
}
|
||||
|
||||
if (upperPtr_)
|
||||
// Non-uniform scaling causes a symmetric matrix
|
||||
// to become asymmetric
|
||||
if (symmetric() || asymmetric())
|
||||
{
|
||||
scalarField& upper = *upperPtr_;
|
||||
scalarField& upper = this->upper();
|
||||
scalarField& lower = this->lower();
|
||||
|
||||
const labelUList& l = lduAddr().lowerAddr();
|
||||
const labelUList& u = lduAddr().upperAddr();
|
||||
|
||||
for (register label face=0; face<upper.size(); face++)
|
||||
{
|
||||
upper[face] *= sf[l[face]];
|
||||
}
|
||||
}
|
||||
|
||||
if (lowerPtr_)
|
||||
{
|
||||
scalarField& lower = *lowerPtr_;
|
||||
|
||||
const labelUList& u = lduAddr().upperAddr();
|
||||
|
||||
for (register label face=0; face<lower.size(); face++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user