Mercurial > repos > public > sbplib
view isEquidistantTest.m @ 1012:1e437c9e5132 feature/advectionRV
Create residual viscosity package +rv and generalize the ResidualViscosity class
- Generalize residual viscosity, by passing user-defined flux and calculating the time derivative outside of the update.
- Create separate RungekuttaRV specifically using interior RV updates
- Separate the artifical dissipation operator from the scheme AdvectionRV1D so that the same scheme can be reused for creating the diff op used by the ResidualViscosity class
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 05 Dec 2018 13:44:10 +0100 |
parents | b43c4d841afe |
children |
line wrap: on
line source
function tests = isEquidistantTest() tests = functiontests(localfunctions); end function testTooShortInput(testCase) testCase.verifyError(@()isEquidistant([]), 'sbplib:isEquidistant:inputTooShort') end function testCorrectOutput(testCase) cases = { % {input, expected}, {[0,0,0,0,0], true}, {[1,1,1,1,1], true}, {[1,2,3,4,5], true}, {[1,3,4,5], false}, {[1,2,3,5], false}, {[1,2,4,5], false}, {linspace(0,pi, 3), true}, {linspace(0,1, 4), true}, {linspace(0,1, 4123), true}, {linspace(0,sin(1), 123), true}, }; for i = 1:length(cases) input = cases{i}{1}; expected = cases{i}{2}; result = isEquidistant(input); testCase.verifyEqual(result,expected); end end