parameters: (corners, subdiv_order)
return_statement: return subcell_corners
docstring: Vertex indices   Edge indices
                           2
      3 +------+ 2     +------+
        |      |     3 |      | 1
        |      |       |      |
      0 +------+ 1     +------+
                           0
docstring_summary: Vertex indices   Edge indices
                           2
      3 +------+ 2     +------+
        |      |     3 |      | 1
        |      |       |      |
      0 +------+ 1     +------+
                           0
docstring_tokens: Vertex indices Edge indices 2 3 + ------ + 2 + ------ + | | 3 | | 1 | | | | 0 + ------ + 1 + ------ + 0
function: def subdivide_quad(corners, subdiv_order):
      """
      Vertex indices   Edge indices
                           2
      3 +------+ 2     +------+
        |      |     3 |      | 1
        |      |       |      |
      0 +------+ 1     +------+
                           0
      """
      if subdiv_order == 0:
          return [corners]
      face_center = np.mean(corners, axis=0)
      edge_centers = [
              0.5 * (corners[0] + corners[1]),
              0.5 * (corners[1] + corners[2]),
              0.5 * (corners[2] + corners[3]),
              0.5 * (corners[3] + corners[0]) ]
  
      subcells = [
              [corners[0], edge_centers[0], face_center, edge_centers[3]],
              [edge_centers[0], corners[1], edge_centers[1], face_center],
              [face_center, edge_centers[1], corners[2], edge_centers[2]],
              [edge_centers[3], face_center, edge_centers[2], corners[3]] ]
  
      subcell_corners = []
      for cell in subcells:
          subcell_corners += subdivide_quad(cell, subdiv_order-1)
      return subcell_corners
function_tokens: def subdivide_quad ( corners , subdiv_order ) : if subdiv_order == 0 : return [ corners ] face_center = np . mean ( corners , axis = 0 ) edge_centers = [ 0.5 * ( corners [ 0 ] + corners [ 1 ] ) , 0.5 * ( corners [ 1 ] + corners [ 2 ] ) , 0.5 * ( corners [ 2 ] + corners [ 3 ] ) , 0.5 * ( corners [ 3 ] + corners [ 0 ] ) ] subcells = [ [ corners [ 0 ] , edge_centers [ 0 ] , face_center , edge_centers [ 3 ] ] , [ edge_centers [ 0 ] , corners [ 1 ] , edge_centers [ 1 ] , face_center ] , [ face_center , edge_centers [ 1 ] , corners [ 2 ] , edge_centers [ 2 ] ] , [ edge_centers [ 3 ] , face_center , edge_centers [ 2 ] , corners [ 3 ] ] ] subcell_corners = [ ] for cell in subcells : subcell_corners += subdivide_quad ( cell , subdiv_order - 1 ) return subcell_corners