Skip to content

Expose set original cell index to python - #3504

Merged
jorgensd merged 3 commits into
mainfrom
dokken/expose_set_original_cell_index
Nov 12, 2024
Merged

Expose set original cell index to python#3504
jorgensd merged 3 commits into
mainfrom
dokken/expose_set_original_cell_index

Conversation

@jorgensd

@jorgensd jorgensd commented Nov 9, 2024

Copy link
Copy Markdown
Member

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.

@jorgensd
jorgensd requested a review from garth-wells November 9, 2024 22:47
@garth-wells

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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 👍🏻

@jorgensd jorgensd added the nanobind Issues related to nanobindings label Nov 11, 2024
@jorgensd
jorgensd added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit f629d4d Nov 12, 2024
@jorgensd
jorgensd deleted the dokken/expose_set_original_cell_index branch November 12, 2024 14:25
schnellerhase pushed a commit to schnellerhase/fenics-dolfinx that referenced this pull request Dec 28, 2024
* Expose set original cell index to python

* Create read-write property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nanobind Issues related to nanobindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants