How to locate elements enclosed in a large bounding box?

I am using dolfin. I have seen the following code to locate which element a point might collide.

from dolfin import *

meshlevel =10
degree = 1
dim = 2
mesh = UnitDiscMesh.create(MPI.comm_world,meshlevel, degree, dim)

Px = -0.519
Py = 0.33
Pz = 0.0

p = Point(Px, Py, Pz)
tree = BoundingBoxTree()
tree.build(mesh)
first = tree.compute_first_entity_collision(p)
print(first)
c_to_v = mesh.topology()(mesh.topology().dim(), 0)
print(c_to_v(first), mesh.coordinates()[c_to_v(first)])

However, I need to get the element indices in a user-defined axis aligned bounding box. What function can help me to do this?

If the bounding box is user-defined, you would have to supply your definition (code) for it to make sense for anyone how to help you. It

I would most likely build a boundingboxtree with a single element (the user supplied box), and use compute_collisions on this. See Bitbucket

Thanks! I haven’t written the code yet, but the bounding box is defined by n_dim vertices indicating the largest and smallest vertices. I will check the code.