From 002c85dd67e109ade9285303f20844dfcf8f03fe Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 30 Mar 2009 09:29:27 +0100 Subject: [PATCH] Added "correction" function which return the correction form of the given matrix by subtracting the matrix multiplied by the current field. --- .../fvMatrices/fvMatrix/fvMatrix.C | 24 +++++++++++++++++-- .../fvMatrices/fvMatrix/fvMatrix.H | 12 ++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 2134420ead..0fcf2e626d 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -1168,7 +1168,7 @@ void Foam::fvMatrix::operator*= } -// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // template void Foam::checkMethod @@ -1297,7 +1297,27 @@ Foam::lduMatrix::solverPerformance Foam::solve(const tmp >& tfvm) } -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // +template +Foam::tmp > Foam::correction +( + const fvMatrix& A +) +{ + return A - (A & A.psi()); +} + + +template +Foam::tmp > Foam::correction +( + const tmp >& tA +) +{ + return tA - (tA() & tA().psi()); +} + + +// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // template Foam::tmp > Foam::operator== diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index e14c0fe497..8ae502cb57 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -547,6 +547,18 @@ template lduMatrix::solverPerformance solve(const tmp >&); +//- Return the correction form of the given matrix +// by subtracting the matrix multiplied by the current field +template +tmp > correction(const fvMatrix&); + + +//- Return the correction form of the given temporary matrix +// by subtracting the matrix multiplied by the current field +template +tmp > correction(const tmp >&); + + // * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * // template