FEniCS / basix

FEniCSx finite element basis evaluation library
https://fenicsproject.org
MIT License
89 stars 34 forks source link

Enum to string #839

Closed ampdes closed 4 months ago

ampdes commented 4 months ago

This is only done for the lagrange variant at the moment.

francesco-ballarin commented 4 months ago

Similar string to enum functions used to be available in basix, but were removed in #832 by @garth-wells.

Please give us more context on why you need those conversion functions to be reinstated, otherwise it's unlikely we'll decide to (conceptually [*]) revert #832 and accept this PR.

[*] I do realize that #832 removed the string representation on the python layer, while here you are trying to introduce it for the C++ one. While this PR would technically not be a revert of #832, IMHO conceptually it is.

ampdes commented 4 months ago

If this is really necessary is too early to speak about. This is needed in adios2 based checkpointing to store the enum types as strings.

I will then try to use maps, as is currently done in the C++ demo.

garth-wells commented 4 months ago

If this is really necessary is too early to speak about. This is needed in adios2 based checkpointing to store the enum types as strings.

I will then try to use maps, as is currently done in the C++ demo.

If something is needed only in the implementation, put it in an anonymous namespace, make private, etc.

garth-wells commented 4 months ago

Closing for now.