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

Boundary Node Identification #60

Closed
griff10000 opened this issue Dec 14, 2020 · 6 comments
Closed

Boundary Node Identification #60

griff10000 opened this issue Dec 14, 2020 · 6 comments

Comments

@griff10000
Copy link

What is the best way to extract boundary node indices from a finished mesh?

@nschloe
Copy link
Collaborator

nschloe commented Dec 14, 2020

mesh.is_boundary_point should do it.

@griff10000
Copy link
Author

griff10000 commented Dec 14, 2020

Many thanks for your prompt response. I used the following approach to generate the boundary nodes:

import meshplex
mesh = meshplex.MeshTri(X, cells)

idx = np.where(mesh.is_boundary_node == True)
x, y = X[idx,0].flatten(), X[idx,1].flatten()

I appreciate that this may not be optimal. However, I wonder if there is way of directly accessing an 'ordered list' of boundary nodes as I assume such a list is being generated for the show() function?

@nschloe
Copy link
Collaborator

nschloe commented Dec 14, 2020

Better use the boolean index directly:

Xb = X[mesh.is_boundary_node]

Or, if you need the coords separately,

x, y = X[mesh.is_boundary_node].T

@griff10000
Copy link
Author

Thanks again.

@ml14je
Copy link

ml14je commented Apr 7, 2021

I believe mesh.is_boundary_node is no longer valid? It comes up with AttributeError: 'MeshTri' object has no attribute 'is_boundary_node'

@nschloe
Copy link
Collaborator

nschloe commented Apr 7, 2021

@ml14je Try is_boundary_point. ipythons expansions can also help exploring a module if you're unsure about a method name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants