Mercurial > repos > public > sbplib
comparison +multiblock/DiffOpTest.m @ 886:8894e9c49e40 feature/timesteppers
Merge with default for latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 15 Nov 2018 16:36:21 -0800 |
parents | 38f203f00f3a |
children |
comparison
equal
deleted
inserted
replaced
816:b5e5b195da1e | 886:8894e9c49e40 |
---|---|
1 function tests = DiffOpTest() | |
2 tests = functiontests(localfunctions); | |
3 end | |
4 | |
5 function testCreation(testCase) | |
6 do = newMultiblockOp(); | |
7 end | |
8 | |
9 function testSplitOp(testCase) | |
10 testCase.verifyFail(); | |
11 end | |
12 | |
13 function testBoundary_condition(testCase) | |
14 testCase.verifyFail(); | |
15 end | |
16 | |
17 function testInterface(testCase) | |
18 testCase.verifyFail(); | |
19 end | |
20 | |
21 function testSize(testCase) | |
22 mbDo = newMultiblockOp(); | |
23 testCase.verifyEqual(mbDo.size(), 15) | |
24 end | |
25 | |
26 | |
27 function do = mockDiffOp(size, bc, interface) | |
28 do.H = 1; | |
29 do.D = 1; | |
30 | |
31 do.size = size; | |
32 do.boundary_condition = bc; | |
33 do.interface = interface; | |
34 end | |
35 | |
36 | |
37 function do = newMultiblockOp() | |
38 grids = { | |
39 grid.Cartesian([0 1 2], [3 4 5]); | |
40 grid.Cartesian([1 2 3], [10 20]); | |
41 }; | |
42 | |
43 conn = cell(2,2); | |
44 conn{1, 2} = {'s','n'}; | |
45 | |
46 mbGrid = multiblock.Grid(grids, conn); | |
47 | |
48 function [c, p] = boundary_condition(~,~,~,~) | |
49 c = 1; p = 1; | |
50 end | |
51 | |
52 function [c, p] = interface(~,~,~,~) | |
53 c = 1; p = 1; | |
54 end | |
55 | |
56 doHand = @(grid,~)mockDiffOp(@(~)prod(grid.size()), @boundary_condition, @interface); | |
57 | |
58 do = multiblock.DiffOp(doHand, mbGrid, 0); | |
59 end |