comparison +sbp/+implementations/d2_noneq_variable_10.m @ 1326:c2d716c4f1ed feature/D2_boundary_opt

Fix bug when using wide stencils
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sun, 13 Feb 2022 20:58:35 +0100
parents 1b0f2415237f
children 855871e0b852
comparison
equal deleted inserted replaced
1325:1b0f2415237f 1326:c2d716c4f1ed
281 R = (1/1587600 / h) * transpose(DD_10) * C1 * DD_10 + (1/317520 / h) * transpose(DD_9) * C2 * DD_9 + (1/60480 / h) * transpose(DD_8) * C3 * DD_8 + (1/10584 / h) * transpose(DD_7) * C4 * DD_7; 281 R = (1/1587600 / h) * transpose(DD_10) * C1 * DD_10 + (1/317520 / h) * transpose(DD_9) * C2 * DD_9 + (1/60480 / h) * transpose(DD_8) * C3 * DD_8 + (1/10584 / h) * transpose(DD_7) * C4 * DD_7;
282 D2 = D1 * C1 * D1 - H \ R; 282 D2 = D1 * C1 * D1 - H \ R;
283 end 283 end
284 284
285 % Wide stencil 285 % Wide stencil
286 function D2 = D2_wide(c) 286 function D2 = D2_fun_wide(c)
287 % Here we add variable diffusion 287 % Here we add variable diffusion
288 C1 = sparse(diag(c)); 288 C1 = sparse(diag(c));
289 D2 = D1 * C1 * D1; 289 D2 = D1 * C1 * D1;
290 end 290 end
291 291