Mesh faces selection for applying BCs and Loads #837
Replies: 3 comments 3 replies
-
Hi @yvanblanchard, in FElupe, there exists only a method to extract cell faces which are on the surface. You have to create a boundary region to access the attribute import felupe as fem
import numpy as np
import pyvista as pv
radius = 1.0
mesh = fem.Circle(n=4, radius=radius)
region = fem.RegionQuadBoundary(mesh)
faces = region.mesh.cells_faces
assert np.allclose(mesh.x[faces] ** 2 + mesh.y[faces] ** 2, radius)
plotter = pv.Plotter()
actor = plotter.add_points(
np.pad(mesh.points[np.unique(faces)], ((0, 0), (0, 1))),
point_size=20,
color="red",
)
mesh.plot(plotter=plotter, opacity=0.7).show() Here you may find some more examples: https://felupe.readthedocs.io/en/latest/felupe/dof.html#felupe.Boundary I'm no PyVista expert, so you'd have to ask your question in their repo how to do that in PyVista. See Also |
Beta Was this translation helpful? Give feedback.
-
Thank you ! Here is my part. Do you know if I can easily retrieve the regions (vertices or faces), using coordinates en length ? Thank you again. |
Beta Was this translation helpful? Give feedback.
-
To mask the points you mentioned: import felupe as fem
import numpy as np
mesh = fem.mesh.read("PATTE.STL")[0]
mask = np.logical_and.reduce(
[mesh.x >= 0, mesh.x <= 10, mesh.z >= 5, mesh.y >= -12.5, mesh.y <= 12.5]
)
point_ids = np.arange(mesh.npoints)[mask] However, there must be some problem with the model orientation or the units, because no points are selected. Could you please double-check your STL-file (or plotter = mesh.plot()
plotter.show_grid()
plotter.show() P.S.: Your mesh contains triangles of a solid body in 3D space. FElupe requires solid cells to work, e.g. triangles in 2D and tetrahedrons in 3D space. You must use some external library to create a tet-mesh from the surface triangles. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to know if it would be possible to select/pick some faces (pick on 3D view of geometry, or select faces by Identifiers), using pyVista or other lib (NB: faces could be retrieved from mesh using 'edges detection').
Then the vertices (or elements faces) linked to those faces would be used to apply boundary conditions and/or loads, for doing analysis in Felupe.
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions