discretize.TreeMesh.insert_cells

TreeMesh.insert_cells(self, points, levels, finalize=True)

Insert cells into the TreeMesh that contain given points

Insert cell(s) into the TreeMesh that contain the given point(s) at the assigned level(s).

Parameters
points(N, dim) array_like
levels(N) array_like of int
finalizebool, optional

Whether to finalize after inserting point(s)

Examples

>>> from discretize import TreeMesh
>>> mesh = TreeMesh([32,32])
>>> mesh.insert_cells([0.5, 0.5], mesh.max_level)
>>> mesh
QuadTreeMesh: 3.91%% filled
Level : Number of cells               Mesh Extent               Cell Widths
-----------------------           min     ,     max            min   ,   max
  2   :       12             ---------------------------   --------------------
  3   :       13          x:      0.0     ,     1.0         0.03125  ,    0.25
  4   :       11          y:      0.0     ,     1.0         0.03125  ,    0.25
  5   :        4
-----------------------
Total :       40