mymesh.tree.Quadtree2Dual#

mymesh.tree.Quadtree2Dual(root, method='centroid')[source]#

Converts an quadtree to a mesh that is dual to the quadtree structure. This mesh contains quadrilateral elements with nodes contained inside quadtree nodes, rather than at the quadtree vertices. At transitions between quadtree node levels, some quads may be partially degenerate (i.e. form tris rather than quads). Based on the algorithm proposed by [SW05] and explained by [Hol10].

Parameters:
  • root (tree.QuadNode) – Root node of the quadtree

  • method (str, optional) –

    Method used for placing the dual vertices within the quadtree nodes, by default ‘centroid’.

    Currently the only implemented option is to place the vertices at the centroids of the octree nodes.

Returns:

  • DualCoords (np.ndarray) – Array of nodal coordinates.

  • DualConn (np.ndarray) – List of node connectivities for the dual mesh.