Mercurial > repos > public > sbplib
comparison +rv/+diffops/constructSymmetricD2.m @ 1225:68ee061639a1 feature/rv
Make sure matrices are sparse.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 06 Nov 2019 14:52:07 +0100 |
parents | 433c89bf19e0 |
children |
comparison
equal
deleted
inserted
replaced
1224:5271c4670733 | 1225:68ee061639a1 |
---|---|
10 | 10 |
11 switch g.D() | 11 switch g.D() |
12 case 1 | 12 case 1 |
13 e_r = ops{1}.e_r; | 13 e_r = ops{1}.e_r; |
14 e_l = ops{1}.e_l; | 14 e_l = ops{1}.e_l; |
15 Hi = ops{1}.HI; | 15 Hi = ops{1}.HI; |
16 B = e_r*e_r' - e_l*e_l'; | |
17 if isequal(opSet,@sbp.D1Upwind) | 16 if isequal(opSet,@sbp.D1Upwind) |
18 Dm = ops{1}.Dm; | 17 B = e_r*e_r' - e_l*e_l'; |
19 Dp = ops{1}.Dp; | 18 Dm = sparse(ops{1}.Dm); |
20 M = Dm - Hi*B; | 19 Dp = sparse(ops{1}.Dp); |
20 M = sparse(Dm - Hi*B); | |
21 D2 = @(Viscosity) M*Viscosity*Dp; | 21 D2 = @(Viscosity) M*Viscosity*Dp; |
22 else | 22 else |
23 % TODO: Fix Viscosity not being vector | 23 % TODO: Fix Viscosity not being vector |
24 d1_r = ops{1}.d1_r'; | 24 d1_r = ops{1}.d1_r'; |
25 d1_l = ops{1}.d1_l'; | 25 d1_l = ops{1}.d1_l'; |