discretize.utils.index_cube

discretize.utils.index_cube(nodes, grid_size, n=None)[source]

Returns the index of nodes on the mesh.

Input:

nodes - string of which nodes to return. e.g. ‘ABCD’ grid_size - size of the nodal grid n - number of nodes each i,j,k direction: [ni,nj,nk]

Output:

index - index in the order asked e.g. ‘ABCD’ –> (A,B,C,D)

TWO DIMENSIONS:

node(i,j)          node(i,j+1)
     A -------------- B
     |                |
     |    cell(i,j)   |
     |        I       |
     |                |
    D -------------- C
node(i+1,j)        node(i+1,j+1)

THREE DIMENSIONS:

      node(i,j,k+1)       node(i,j+1,k+1)
          E --------------- F
         /|               / |
        / |              /  |
       /  |             /   |
node(i,j,k)         node(i,j+1,k)
     A -------------- B     |
     |    H ----------|---- G
     |   /cell(i,j)   |   /
     |  /     I       |  /
     | /              | /
     D -------------- C
node(i+1,j,k)      node(i+1,j+1,k)