comparison +sbp/+implementations/d2_noneq_variable_4.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
121 R = (1/144 / h) * transpose(DD_4) * C1 * DD_4; 121 R = (1/144 / h) * transpose(DD_4) * C1 * DD_4;
122 D2 = D1 * C1 * D1 - H \ R; 122 D2 = D1 * C1 * D1 - H \ R;
123 end 123 end
124 124
125 % Wide stencil 125 % Wide stencil
126 function D2 = D2_wide(c) 126 function D2 = D2_fun_wide(c)
127 % Here we add variable diffusion 127 % Here we add variable diffusion
128 C1 = sparse(diag(c)); 128 C1 = sparse(diag(c));
129 D2 = D1 * C1 * D1; 129 D2 = D1 * C1 * D1;
130 end 130 end
131 131