예제 #1
0
파일: test_spaces.py 프로젝트: getzze/bempp
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
파일: test_spaces.py 프로젝트: getzze/bempp
def test_grid_is_readonly(grid):
    from py.test import raises
    space = PiecewiseLinearContinuousScalarSpace(grid, 'complex128')
    with raises(AttributeError):
        space.grid = grid