Mercurial > repos > public > sbplib
diff spdiagsVariablePeriodic.m @ 799:8c65ef13df89 feature/poroelastic
Bort med martins hemska whitespace
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 26 Jul 2018 17:51:48 -0700 |
parents | 50e77b15d841 |
children | 87ea9cac3287 |
line wrap: on
line diff
--- a/spdiagsVariablePeriodic.m Thu Jul 26 10:53:05 2018 -0700 +++ b/spdiagsVariablePeriodic.m Thu Jul 26 17:51:48 2018 -0700 @@ -2,17 +2,17 @@ % Creates an m x m periodic discretization matrix. % vals - m x ndiags matrix of values % diags - 1 x ndiags vector of the 'center diagonals' that vals end up on - % vals that are not on main diagonal are going to spill over to + % vals that are not on main diagonal are going to spill over to % off-diagonal corners. default_arg('diags',0); - [m, ~] = size(vals); + [m, ~] = size(vals); A = sparse(m,m); for i = 1:length(diags) - + d = diags(i); a = vals(:,i); @@ -21,7 +21,7 @@ a_bulk = a(1+abs(d):end); a_corner = a(1:1+abs(d)-1); corner_diag = m-abs(d); - A = A + spdiagVariable(a_bulk, d); + A = A + spdiagVariable(a_bulk, d); A = A + spdiagVariable(a_corner, corner_diag); % Super-diagonals @@ -29,7 +29,7 @@ a_bulk = a(1:end-d); a_corner = a(end-d+1:end); corner_diag = -m + d; - A = A + spdiagVariable(a_bulk, d); + A = A + spdiagVariable(a_bulk, d); A = A + spdiagVariable(a_corner, corner_diag); % Main diagonal