FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
792 stars 182 forks source link

Expose set original cell index to python #3504

Closed jorgensd closed 1 week ago

jorgensd commented 2 weeks ago

To be able to make a valid geometry from Python (without using create_topology, as one wants to avoid re-distribution of data), one has to expose the original_cell_index attribute to Python. As we have used this as a public variable in C++, I've gone down the route of creating a setter function in the Python binding, rather than exposing a "list-of-lists" to Python, as we would rather like it to be numpy based.

garth-wells commented 2 weeks ago

Mixed topology support is still highly experimental and under review, so we shouldn’t expose the mixed topology version of original_cell_index yet.

When it’s ready, no need to add a function with ‘set’ in the name. Could be a nanobind read/write property.

jorgensd commented 2 weeks ago

Mixed topology support is still highly experimental and under review, so we shouldn’t expose the mixed topology version of original_cell_index yet.

When it’s ready, no need to add a function with ‘set’ in the name. Could be a nanobind read/write property.

agreed, much cleaner solution 👍🏻