-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Take the points and cells_dict of an unstructured grid and create a MeshContainer. This should simplify things like
import felupe as fem
import pyvista as pv
import skgmsh as sg
source = pv.Polygon(n_sides=6, radius=1, fill=False)
delaunay_2d = sg.frontal_delaunay_2d(edge_source=source, target_sizes=0.1)
mesh = (
fem.Mesh(
points=delaunay_2d.points[:, :2], # in-plane points
cells=delaunay_2d.cells_dict[pv.CellType.TRIANGLE], # triangle cells
cell_type="triangle",
)
.flip()
.rotate(90, axis=2)
)
region = fem.RegionTriangle(mesh)
field = fem.FieldContainer([fem.FieldPlaneStrain(region, dim=2)])
boundaries, loadcase = fem.dof.shear(
field,
sym=False,
moves=(0.75, 0.0, 0.0),
)
solid = fem.SolidBody(umat=fem.LinearElastic(E=1, nu=0.4), field=field)
step = fem.Step(items=[solid], boundaries=boundaries)
job = fem.Job(steps=[step]).evaluate()
ax = solid.imshow("Principal Values of Logarithmic Strain", project=fem.project)to
source = pv.Polygon(n_sides=6, radius=1, fill=False)
delaunay_2d = sg.frontal_delaunay_2d(edge_source=source, target_sizes=0.1)
mesh = fem.mesh.from_unstructured_grid(delaunay_2d)[0].rotate(90, axis=2)
mesh.update(points=mesh.points[:, :2])
# ...Tasks
- Add an importer for an unstructured grid, see Add
MeshContainer.from_unstructured_grid()#847 - Add an example which uses
scikit-gmsh(as suggested in Capturing PyVista's user stories pyvista/pyvista#2133 (reply in thread) by @tkoyama010) once the importer is available
tkoyama010
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
