comparison operator_def/assemble_opTest.m @ 825:32c360bb480e feature/operator_files

Add test and fix typo
author Ylva Rydin <ylva.rydin@telia.com>
date Mon, 10 Sep 2018 17:42:30 +0200
parents 95c26000c0ba
children b94bb6ffa38b
comparison
equal deleted inserted replaced
824:ed8d34894589 825:32c360bb480e
1 1
2 function tests = assemble_opTest() 2 function tests = assemble_opTest()
3 tests = functiontests(localfunctions); 3 tests = functiontests(localfunctions);
4 end 4 end
5 5
6 function TestAssembleD1(testCase) 6 function TestAssemble_op(testCase)
7 m = 10; 7 m = 10;
8 op = sbp.D2Standard(m,{0 1},4); 8 op = sbp.D2Standard(m,{0 1},4);
9 h = op.h; 9 h = op.h;
10 10
11 boundary_block = op.D1(1:4,1:6)*h; 11 boundary_block = op.D1(1:4,1:6)*h;
12 inner = op.D1(5,3:7)*h; 12 inner = op.D1(5,3:7)*h;
13 13 D1_new = assemble_op(inner,boundary_block,m)/h;
14 D1_new = assemble_op(inner,boundary_block,h,m);
15 14
16 verifyEqual(testCase,D1_new,op.D1,'AbsTol',1e-10) 15 verifyEqual(testCase,D1_new,op.D1,'AbsTol',1e-10)
17 16
18 end 17 end
19 18
19 function TestAssembleD1(testCase)
20 m = 10;
21 op = sbp.D2Standard(m,{0 3},2);
22 h = op.h;
20 23
24 [D1,e_l,e_r] = assemble_D1('d2_2',h,m);
21 25
22 26 verifyEqual(testCase,D1,op.D1,'AbsTol',1e-10)
23 27 verifyEqual(testCase,e_l,op.e_l,'AbsTol',1e-10)
24 28 verifyEqual(testCase,e_r,op.e_r,'AbsTol',1e-10)
29 end