This section provides the auto-generated API for the Python modules hypoct and hypoct.tools.
Python module for interfacing with hypoct.
Build hyperoctree.
Parameters: |
|
---|
Find neighbors.
The definition of a neighbor depends on the element type (see Tree()).
For points (elem = ‘p’), the neighbors of a given node consist of:
For elements and sparse elements (elem = ‘e’ or ‘s’), first let the extension of a node be the spatial region corresponding to all possible point distributions belonging to that node.
Then for elements (elem = ‘e’), the neighbors of a given node consist of:
Finally, for sparse elements (elem = ‘s’), the neighbors consist of:
In all cases, a node is not considered its own neighbor.
This routine requires that the child and geometry data have already been generated. If this is not the case, then this is done automatically.
See generate_child_data() and generate_geometry_data().
Parameters: | per (numpy.ndarray) – Periodicity of root note. The domain is periodic in dimension i if per[i] = True. If per is a single bool, then it is automatically expanded into an appropriately sized constant array. Use ext in Tree() to control the extent of the root. |
---|
Generate child data.
Generate geometry data.
Get interaction lists.
The interaction list of a given node consists of:
This routine requires that the neighbor data have already been generated. If this is not the case, then this is done automatically (at default settings).
See find_neighbors().
Search hyperoctree.
The element type of the points to search for are assumed to be the same as that used to construct the tree (see Tree()).
This routine requires that the child and geometry data have already been generated. If this is not the case, then this is done automatically.
See generate_child_data() and generate_geometry_data().
Parameters: |
|
---|---|
Returns: | Tree traversal array. The node containing point i at level j has index trav[i,j]; if no such node exists, then trav[i,j] = 0. |
Return type: |
Additional tools for hypoct.
View binary and quadtrees (1D and 2D hyperoctrees).
Parameters: | tree (hypoct.Tree) – Hyperoctree. |
---|
Draw wireframe outlines of all nodes in the tree.
Accepts all matplotlib.pyplot.plot() keyword arguments.
Draw each node in the tree sequentially via an interactive session (press Enter to continue) along with all neighbor and interaction list data, if available.
All keyword arguments prefaced with ‘base_’ are passed to draw_base(); those prefaced with ‘node_’ are passed to draw_node() when drawing each node; those prefaced with ‘nbor_’ are passed to draw_node() when drawing each node neighbor; and those prefaced with ‘ilst_’ are passed to draw_node() when drawing each node in the interaction list.
See draw_base() and draw_node().
Parameters: |
---|
Draw node patch and, optionally, all points contained within it.
The node is drawn as a matplotlib.patches.Rectangle instance. Points are drawn using matplotlib.pyplot.scatter().
All keyword arguments prefaced with ‘node_’ are passed to the node drawing routine with the prefix stripped, and, similarly all arguments prefixed with ‘point_’ are passed to the point drawing routine with the prefix stripped. For example, setting node_color=’r’ and point_c=’b’ passes the keyword argument color=’r’ to the node drawer and c=’b’ to the point drawer.
Parameters: |
---|