Boundary Node Identification
griff10000 opened this issue · 6 comments
griff10000 commented
What is the best way to extract boundary node indices from a finished mesh?
nschloe commented
mesh.is_boundary_point
should do it.
griff10000 commented
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 commented
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 commented
Thanks again.
ml14je commented
I believe mesh.is_boundary_node is no longer valid? It comes up with AttributeError: 'MeshTri' object has no attribute 'is_boundary_node'