Hello,
I am trying to identifying the displacement value at the point at the top of my mesh (a blind ended tube), and for that i followed the tutorial and the code in Implementation — FEniCSx tutorial
from dolfinx import geometry
points = np.array([[0, Length + R_outer - 0.001, 0]], dtype=np.float64).reshape(3, 1)
bb_tree = geometry.BoundingBoxTree(domain)
cells = []
points_on_proc = []
# Find cells whose bounding-box collide with the the points
cell_candidates = geometry.compute_collisions_points(bb_tree, points.T)
# Choose one of the cells that contains the point
colliding_cells = geometry.compute_colliding_cells(domain, cell_candidates, points.T)
for i, point in enumerate(points.T):
if len(colliding_cells.links(i)) > 0:
points_on_proc.append(point)
cells.append(colliding_cells.links(i)[0])
print("Points on process:", points_on_proc)
print("Colliding cells:", cells)
points_on_proc = np.array(points_on_proc, dtype=np.float64)
But when i run the code, even though i can’t see an issue i get this error:
TypeError: compute_collisions_points(): incompatible function arguments. The following argument types are supported:
1. compute_collisions_points(tree: dolfinx.cpp.geometry.BoundingBoxTree_float32, points: ndarray[dtype=float32, writable=False, shape=(3), order='C']) -> dolfinx.cpp.graph.AdjacencyList_int32
2. compute_collisions_points(tree: dolfinx.cpp.geometry.BoundingBoxTree_float32, points: ndarray[dtype=float32, writable=False, shape=(*, 3), order='C']) -> dolfinx.cpp.graph.AdjacencyList_int32
3. compute_collisions_points(tree: dolfinx.cpp.geometry.BoundingBoxTree_float64, points: ndarray[dtype=float64, writable=False, shape=(3), order='C']) -> dolfinx.cpp.graph.AdjacencyList_int32
4. compute_collisions_points(tree: dolfinx.cpp.geometry.BoundingBoxTree_float64, points: ndarray[dtype=float64, writable=False, shape=(*, 3), order='C']) -> dolfinx.cpp.graph.AdjacencyList_int32
Invoked with types: dolfinx.mesh.Mesh, ndarray
I have tried reshaping my point array, but it doesn’t work. Any suggestions?
EDIT
To add precisions the mesh is in 2D
Thank you