Skip to content
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

[FEATURE] Get number of geometric elements in domain subset (Lua) #39

Open
stephanmg opened this issue Sep 29, 2020 · 0 comments
Open
Assignees

Comments

@stephanmg
Copy link
Member

stephanmg commented Sep 29, 2020

Problem:

Given a domain, how can one find the number of a certain type of geometric element (e.g. Vertex, Edge) in a subset from Lua?

Workarounds (Thanks to @mastep84):

obj = Mesh()
LoadMesh(obj, gridName)
SelectSubset(obj, 0, false, true, false, false)
print(obj:selector():num_edges())

Proposed solution by @sreiter:

Use dom:subset_handler() which returns the subset handler of a domain (see domain_bridge.cpp).
And there is subset_handler_bridge.cpp, where the different subset-handlers are registered.
Here you could easily add the different overloads of num_vertices, num_edges, etc. methods
and use them directly in your script: dom:subset_handler():num_edges(subsetIndex)`.

See branch https://github.com/stephanmg/ugcore/tree/featureNumElements for details and status (WIP).

@stephanmg stephanmg self-assigned this Sep 29, 2020
@stephanmg stephanmg changed the title [FEATURE] Get number of geometric elements in subsets of domain from Lua [FEATURE] Get number of geometric elements in subsets of domain (Lua) Sep 29, 2020
@stephanmg stephanmg changed the title [FEATURE] Get number of geometric elements in subsets of domain (Lua) [FEATURE] Get number of geometric elements in domain subset (Lua) Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant