1from dune.grid import structuredGrid 2 3def test_subIndices(gridView): 4 indexSet = gridView.indexSet 5 for intersection in gridView.boundaryIntersections: 6 entity = intersection.inside 7 subentity = (intersection.indexInInside, 1) 8 indices_global = indexSet.subIndices(entity, subentity, 2) 9 indices_reference = entity.referenceElement.subEntities(subentity, 2) 10 indices_lookup = indexSet.subIndices(entity, 2) 11 assert len(indices_global) == len(indices_reference) 12 for i, j in zip(indices_global, indices_reference): 13 assert i == indices_lookup[j] 14 15if __name__ == "__main__": 16 gridView = structuredGrid([0,0],[1,1],[10,10]) 17 test_subIndices(gridView) 18