FEniCS-Shells / fenicsx-shells

A FEniCS Project-based library for simulating thin structures
GNU Lesser General Public License v3.0
18 stars 4 forks source link

dolfinx.cpp.geometry.compute_colliding_cells -> dolfinx.geometry.compute_colliding_cells #6

Closed sanguinariojoe closed 1 year ago

sanguinariojoe commented 1 year ago

dolfinx.cpp.geometry.compute_colliding_cells() expects a dolfinx.cpp.mesh.Mesh_float64, while in the tests and demos a dolfinx.mesh.Mesh is generated. Thus, the following error is always received:

Traceback (most recent call last):
  File "/home/pepe/CoreMarine/exmar/fenicsx/fenicsx-shells/demo/demo_kirchhoff-love-clamped.py", line 216, in <module>
    cells = dolfinx.cpp.geometry.compute_colliding_cells(
TypeError: compute_colliding_cells(): incompatible function arguments. The following argument types are supported:
    1. (mesh: dolfinx.cpp.mesh.Mesh_float64, candidate_cells: dolfinx.cpp.graph.AdjacencyList_int32, points: numpy.ndarray[numpy.float64]) -> Union[dolfinx.cpp.graph.AdjacencyList_int32, numpy.ndarray[numpy.int32]]

Invoked with: <dolfinx.mesh.Mesh object at 0x7f1f7c66ba00>, <AdjacencyList> with 1 nodes
  0: [263 247 279 294 217 232 264 248 ]
, array([0.5, 0.5, 0. ])

The solution is calling directly dolfinx.geometry.compute_colliding_cells(), which has been available since dolfinx 0.4.0