Difference between revisions of "OpenFOAM guide/LduMatrix;;negSumDiag"

From OpenFOAMWiki
(Created page with 'Subtracts the off-diagonal entries from the diagonal. for (register label face=0; face<l.size(); face++) { Diag[l[face]] -= Lower[face]; Diag[u[face]] -= Upper[face]…')
 
 
(No difference)

Latest revision as of 19:24, 30 June 2010

Subtracts the off-diagonal entries from the diagonal.

for (register label face=0; face<l.size(); face++)
{
    Diag[l[face]] -= Lower[face];
    Diag[u[face]] -= Upper[face];
}

Where:

  • Diag is the diagonal coefficient;
  • l is the lduAddressing for the lower triangle;
  • u is the lduAddressing for the upper triangle;
  • Lower is the lower triangle; and
  • Upper is the upper triangle.

In terms of discretization coefficients, this is equivalent to:

A_p = \sum\limits_r A_r

and in terms of matrix coefficients, this is:

A_{ii} = -\sum\limits_o A_{o,i} -\sum\limits_n A_{n,i}

Where: