def test_single_block_no_restriction(mesh, FunctionSpace, BlockBCs):
    V = FunctionSpace(mesh)
    block_V = BlockFunctionSpace([V])
    block_form = get_lhs_block_form_1(block_V)
    block_bcs = BlockBCs(block_V)
    (lhs, block_lhs) = assemble_and_block_assemble_matrix(block_form)
    apply_bc_and_block_bc_matrix(lhs, block_lhs, block_bcs)
    assert_block_matrices_equal(lhs, block_lhs, block_V)
def test_two_blocks_no_restriction(mesh, FunctionSpaces, BlockBCs):
    (FunctionSpace1, FunctionSpace2) = FunctionSpaces
    V1 = FunctionSpace1(mesh)
    V2 = FunctionSpace2(mesh)
    block_V = BlockFunctionSpace([V1, V2])
    block_form = get_lhs_block_form_2(block_V)
    block_bcs = BlockBCs(block_V)
    (lhs, block_lhs) = assemble_and_block_assemble_matrix(block_form)
    apply_bc_and_block_bc_matrix(lhs, block_lhs, block_bcs)
    assert_block_matrices_equal(lhs, block_lhs, block_V)