comparison +sbp/+implementations/d2_noneq_variable_6.m @ 1332:8e9df030a0a5 feature/D2_boundary_opt

Clarify comments
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 04 May 2022 08:42:13 +0200
parents 855871e0b852
children bcdb14b05d03
comparison
equal deleted inserted replaced
1331:60c875c18de3 1332:8e9df030a0a5
152 % Remainder term added to wide second derivative operator 152 % Remainder term added to wide second derivative operator
153 R = (1/3600 / h) * transpose(DD_6) * C1 * DD_6 + (1/600 / h) * transpose(DD_5) * C2 * DD_5 + (1/80 / h) * transpose(DD_4) * C3 * DD_4; 153 R = (1/3600 / h) * transpose(DD_6) * C1 * DD_6 + (1/600 / h) * transpose(DD_5) * C2 * DD_5 + (1/80 / h) * transpose(DD_4) * C3 * DD_4;
154 D2 = D1 * C1 * D1 - H \ R; 154 D2 = D1 * C1 * D1 - H \ R;
155 end 155 end
156 156
157 % Few additional grid point in interior stencil cmp. to minimal 157 % Non-minimal 9 point stencil width
158 function D2 = D2_fun_nonminimal(c) 158 function D2 = D2_fun_nonminimal(c)
159 % Here we add variable diffusion 159 % Here we add variable diffusion
160 C1 = sparse(diag(c)); 160 C1 = sparse(diag(c));
161 C2 = 1/2 * diag(ones(m - 1, 1), -1) + 1/2 * diag(ones(m, 1), 0); C2(1, 2) = 1/2; 161 C2 = 1/2 * diag(ones(m - 1, 1), -1) + 1/2 * diag(ones(m, 1), 0); C2(1, 2) = 1/2;
162 162