Mercurial > repos > public > sbplib
changeset 188:c5ca9bbfed41 feature/grids
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 04 Mar 2016 17:19:18 +0100 |
parents | 770da87a6dc4 |
children | 6054dcd3c8a9 |
files | +grid/Cartesian.m +grid/CartesianTest.m +grid/Curvilinear.m +grid/CurvilinearTest.m +grid/Grid.m +grid/equidistantCurvilinearTest.m |
diffstat | 6 files changed, 46 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/Cartesian.m --- a/+grid/Cartesian.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/Cartesian.m Fri Mar 04 17:19:18 2016 +0100 @@ -122,5 +122,16 @@ function gf = projectFunc(obj, gf, g) error('grid:Cartesian:NotImplemented') end + + % Return the names of all boundaries in this grid. + function bs = getBoundaryNames(obj) + bs = []; + end + + % Return coordinates for the given boundary + function b = getBoundary(obj, name) + b = []; + end + end end \ No newline at end of file
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/CartesianTest.m --- a/+grid/CartesianTest.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/CartesianTest.m Fri Mar 04 17:19:18 2016 +0100 @@ -194,3 +194,12 @@ testCase.verifyEqual(g.scaling(),[2 1]); end + + +function testGetBoundaryNames(testCase) + testCase.verifyFail(); +end + +function testGetBoundary(testCase) + testCase.verifyFail(); +end
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/Curvilinear.m --- a/+grid/Curvilinear.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/Curvilinear.m Fri Mar 04 17:19:18 2016 +0100 @@ -80,6 +80,16 @@ end h = obj.logic.h; end + + % Return the names of all boundaries in this grid. + function bs = getBoundaryNames(obj) + bs = []; + end + + % Return coordinates for the given boundary + function b = getBoundary(obj, name) + b = []; + end end end
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/CurvilinearTest.m --- a/+grid/CurvilinearTest.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/CurvilinearTest.m Fri Mar 04 17:19:18 2016 +0100 @@ -67,7 +67,7 @@ end function testMappingInputError(testCase) - testCase.assumeFail(); + testCase.verifyFail(); end function testScaling(testCase) @@ -80,3 +80,11 @@ testCase.verifyEqual(g.scaling(),[2 1]); end +function testGetBoundaryNames(testCase) + testCase.verifyFail(); +end + +function testGetBoundary(testCase) + testCase.verifyFail(); +end +
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/Grid.m --- a/+grid/Grid.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/Grid.m Fri Mar 04 17:19:18 2016 +0100 @@ -15,5 +15,11 @@ % Projects the grid function gf on obj to the grid g. gf = projectFunc(obj, gf, g) + + % Return the names of all boundaries in this grid. + bs = getBoundaryNames(obj) + + % Return coordinates for the given boundary + b = getBoundary(obj, name) end end
diff -r 770da87a6dc4 -r c5ca9bbfed41 +grid/equidistantCurvilinearTest.m --- a/+grid/equidistantCurvilinearTest.m Fri Mar 04 17:18:20 2016 +0100 +++ b/+grid/equidistantCurvilinearTest.m Fri Mar 04 17:19:18 2016 +0100 @@ -3,5 +3,5 @@ end function testNoTests(testCase) - testCase.assumeFail(); + testCase.verifyFail(); end \ No newline at end of file