d = 3 # d+1 nodes per element num_elements = 4 num_nodes = num_elements*d + 1 nodes = [i*0.5 for i in range(num_nodes)] elements = [[i*d+j for j in range(d+1)] for i in range(num_elements)]