-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose basix::FiniteElement #2205
Conversation
The idea behind the original design was to hide the Basix implementation, for example to allow a user to hand-code an element. We've probably had some leakage over time, but is it still reasonable to try and hide the implementation? A benefit of wrapping parts of the Basix interface is that we can more easily evolve Basix and DOLFINx independently. Some changes in Basix are planned to remove xtensor. |
It seems that most natural way to creating a custom element is to use basix itself as demonstrated here. I can add back the wrapping methods for those who wish to inherit |
I agree with Nate that custom elements now are naturally supported through Basix. We also added the function space constructor that takes in a Basix element, and then create the dolfinx finite element. There are many cases where one would like to access functions we haven’t exposed, such as |
I also think it's a good idea to expose the basix element, although the wrapping methods provide more freedom for Basix. Otherwise, a change in basix interface would reflect in dolfinx API. |
We could keep the wrappers, but also expose the underlying element such that one can use the other functions (that are not used in the DOLFINx API). |
Yes, we could expose the Basix element. I'm not sure if this should be via a pointer or a reference given that not all I do think we should keep the wrapper functions for a few reasons:
|
This looks good to me, as the only methods being taken out of the DOLFINx FiniteElement are those that are rarely used and just called Basix anyway |
…/dolfinx into nate/expose-basix-element
I've reverted to the previous |
Exposure of the
basix::FiniteElement
underlyingdolfinx::fem::FiniteElement
is very useful for code building on top ofdolfinx
. Futhermore a number of methods indolfinx::fem::FiniteElement
needlessly wrap thebasix::FiniteElement
. Here we simplify the interface.