Mercurial > repos > public > sbplib
view 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 |
line wrap: on
line source
function tests = assemble_opTest() tests = functiontests(localfunctions); end function TestAssemble_op(testCase) m = 10; op = sbp.D2Standard(m,{0 1},4); h = op.h; boundary_block = op.D1(1:4,1:6)*h; inner = op.D1(5,3:7)*h; D1_new = assemble_op(inner,boundary_block,m)/h; verifyEqual(testCase,D1_new,op.D1,'AbsTol',1e-10) end function TestAssembleD1(testCase) m = 10; op = sbp.D2Standard(m,{0 3},2); h = op.h; [D1,e_l,e_r] = assemble_D1('d2_2',h,m); verifyEqual(testCase,D1,op.D1,'AbsTol',1e-10) verifyEqual(testCase,e_l,op.e_l,'AbsTol',1e-10) verifyEqual(testCase,e_r,op.e_r,'AbsTol',1e-10) end