Пример #1
0
def test_space_is_compatible(grid):
    constant64 = PiecewiseConstantScalarSpace(grid, 'complex64')
    constant128 = PiecewiseConstantScalarSpace(grid, 'complex128')

    assert not constant64.is_compatible(constant128)
    assert not constant128.is_compatible(constant64)
    assert constant64.is_compatible(constant64)

    linear64 = PiecewiseLinearContinuousScalarSpace(grid, 'complex64')
    linear64b = PiecewiseLinearContinuousScalarSpace(grid, 'complex64')
    assert not constant64.is_compatible(linear64)
    assert linear64b.is_compatible(linear64)
    assert linear64.is_compatible(linear64b)

    dual = PiecewiseConstantDualGridScalarSpace(grid, 'complex64')
    assert not constant64.is_compatible(dual)
Пример #2
0
def test_space_is_compatible(grid):
    constant64 = PiecewiseConstantScalarSpace(grid, 'complex64')
    constant128 = PiecewiseConstantScalarSpace(grid, 'complex128')

    assert not constant64.is_compatible(constant128)
    assert not constant128.is_compatible(constant64)
    assert constant64.is_compatible(constant64)

    linear64 = PiecewiseLinearContinuousScalarSpace(grid, 'complex64')
    linear64b = PiecewiseLinearContinuousScalarSpace(grid, 'complex64')
    assert not constant64.is_compatible(linear64)
    assert linear64b.is_compatible(linear64)
    assert linear64.is_compatible(linear64b)

    dual = PiecewiseConstantDualGridScalarSpace(grid, 'complex64')
    assert not constant64.is_compatible(dual)
Пример #3
0
def test_grid_is_readonly(grid):
    from py.test import raises
    space = PiecewiseLinearContinuousScalarSpace(grid, 'complex128')
    with raises(AttributeError):
        space.grid = grid
Пример #4
0
def test_grid_is_readonly(grid):
    from py.test import raises
    space = PiecewiseLinearContinuousScalarSpace(grid, 'complex128')
    with raises(AttributeError):
        space.grid = grid