-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add create_entity_markers
function
#34
Conversation
Thanks this look great! Another option here is to pass the entities as a list of dictionaries so that the user can have entities both with and without entities = [
{"id": 1, "locator": left, "on_boundary": True},
{"id": 2, "locator": right, "on_boundary": False},
] Now, to type this we could use a import typing
class Tag(typingTypedDict):
id: int
locator: typing.Callable[[npt.NDArray[np.floating]], npt.NDArray[np.bool_]]
on_bounary: bool
entities: list[Tag] BTW, I solved this using a |
I am fine with that as long as we keep the complexity of the input arguments relatively low. Do you want to make these adaptations and make a test? |
Instead of using dictionaries we have now using tuples instead, where the elements are |
create_meshtags
functioncreate_entity_markers
function
Convenience function for creating meshtags based of python functions.
Based of what @bleyerj suggested in #26.
I've modified it slightly:
on_boundary
option.Added a demo to highlight how to use it and visualize meshtags with pyvista.