From 88effc40ded8e2aeba93e9eaa8800a105d602ca5 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 2 Jan 2015 19:33:39 +0000 Subject: [PATCH] [lL]duMatrixOperations: Added support for scaling symmetric matrices Note: non-uniform scaling of a symmetric matrix generates an asymmetric matrix --- .../LduMatrix/LduMatrix/LduMatrixOperations.C | 17 +++++++---------- .../lduMatrix/lduMatrix/lduMatrixOperations.C | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C index d35c0c12..46d2a6e0 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -412,23 +412,20 @@ void Foam::LduMatrix::operator*= *sourcePtr_ *= sf; } - if (upperPtr_) + // Non-uniform scaling causes a symmetric matrix + // to become asymmetric + if (symmetric() || asymmetric()) { - Field& upper = *upperPtr_; + Field& upper = this->upper(); + Field& lower = this->lower(); const unallocLabelList& l = lduAddr().lowerAddr(); + const unallocLabelList& u = lduAddr().upperAddr(); for (register label face=0; face& lower = *lowerPtr_; - - const unallocLabelList& u = lduAddr().upperAddr(); for (register label face=0; faceupper(); + scalarField& lower = this->lower(); const labelUList& l = lduAddr().lowerAddr(); + const labelUList& u = lduAddr().upperAddr(); for (register label face=0; face