Mercurial > repos > public > sbplib
comparison operator_def/assemble_op.m @ 827:d1e5143d67ed feature/operator_files
add testfor D2 and sign in assemble_op
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Mon, 10 Sep 2018 18:50:29 +0200 |
parents | 95c26000c0ba |
children | e15a667ffde2 |
comparison
equal
deleted
inserted
replaced
826:b94bb6ffa38b | 827:d1e5143d67ed |
---|---|
1 function [D] = assemble_op(inner_stencil,boundary_block,m) | 1 function [D] = assemble_op(inner_stencil,boundary_block,m,sign) |
2 | |
3 [height_b, width_b] = size(boundary_block); | 2 [height_b, width_b] = size(boundary_block); |
4 width_i = length(inner_stencil); | 3 width_i = length(inner_stencil); |
5 | 4 |
6 max_offset = floor(width_i/2); | 5 max_offset = floor(width_i/2); |
7 diags = -max_offset:max_offset; | 6 diags = -max_offset:max_offset; |
8 | 7 |
9 | |
10 D = stripeMatrix(inner_stencil, diags, m); | 8 D = stripeMatrix(inner_stencil, diags, m); |
11 | 9 |
12 D(1:height_b,1:width_b) = boundary_block; | 10 D(1:height_b,1:width_b) = boundary_block; |
13 D(m-height_b+1:m,m-width_b+1:m) = rot90( -boundary_block ,2); | 11 D(m-height_b+1:m,m-width_b+1:m) = rot90( sign*boundary_block ,2); |
14 end | 12 end |