Skip to content
Snippets Groups Projects
Commit 35889702 authored by Henry's avatar Henry
Browse files

LduMatrixOperations: Added support for scaling symmetric matrices

Note: non-uniform scaling of a symmetric matrix generates an asymmetric matrix
parent 1a7a53a2
Branches
Tags
No related merge requests found
......@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rAU = 1.0/UEqn.A();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
......
......@@ -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<Type, DType, LUType>::operator*=
*sourcePtr_ *= sf;
}
if (upperPtr_)
// Non-uniform scaling causes a symmetric matrix
// to become asymmetric
if (symmetric() || asymmetric())
{
Field<LUType>& upper = *upperPtr_;
Field<LUType>& upper = this->upper();
Field<LUType>& lower = this->lower();
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
for (register label face=0; face<upper.size(); face++)
{
upper[face] *= sf[l[face]];
}
}
if (lowerPtr_)
{
Field<LUType>& lower = *lowerPtr_;
const unallocLabelList& u = lduAddr().upperAddr();
for (register label face=0; face<lower.size(); face++)
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment