Mercurial > repos > public > sbplib
diff +grid/funcToComponentsTest.m @ 832:5573913a0949 feature/burgers1d
Merged with default, and updated +scheme/Burgers1D accordingly
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 11 Sep 2018 15:58:35 +0200 |
parents | 3ea2ae2a3d15 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+grid/funcToComponentsTest.m Tue Sep 11 15:58:35 2018 +0200 @@ -0,0 +1,23 @@ +function tests = funcToComponentsTest() + tests = functiontests(localfunctions); +end + + +function testScalarGf(testCase) + g = getTestGrid(); + gf_in = [1; 2; 3]; + + testCase.verifyEqual(grid.funcToComponents(g, gf_in), gf_in); +end + +function testVectorGf(testCase) + g = getTestGrid(); + gf_in = [1; 2; 3; 4; 5; 6]; + out = [1 2; 3 4; 5 6]; + + testCase.verifyEqual(grid.funcToComponents(g, gf_in), out); +end + +function g = getTestGrid() + g = grid.equidistant(3,{0,2}); +end \ No newline at end of file