-
Notifications
You must be signed in to change notification settings - Fork 12
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
Import pyvista.UnstructuredGrid
as MeshContainer
?
#830
Comments
pyvista.UnstructuredGrid
as mesh
pyvista.UnstructuredGrid
as meshpyvista.UnstructuredGrid
as Mesh
pyvista.UnstructuredGrid
as Mesh
pyvista.UnstructuredGrid
as Mesh
?
pyvista.UnstructuredGrid
as Mesh
?pyvista.UnstructuredGrid
as MeshContainer
?
Thank you for considering this. Currently, I am considering the following points in the new version of
|
Thanks for the information! I'll start with Task 1 (importing an unstructured grid) anyway and when a new version of scikit-gmsh is ready I'll add an example where the mesh is created by scikit-gmsh. |
Updated ExamplesThese code-blocks use 2D Plane Strainimport skgmsh as sg
import felupe as fem
shell = [(0, 0, 0), (0, 10, 0), (10, 10, 0), (10, 0, 0), (0, 0, 0)]
holes = [[(2, 2, 0), (2, 4, 0), (4, 4, 0), (4, 2, 0), (2, 2, 0)]]
alg = sg.Delaunay2D(shell=shell, holes=holes)
alg.cell_size = 0.3
grid = alg.mesh.split_bodies()[0]
mesh = fem.MeshContainer.from_unstructured_grid(grid, dim=2)[0]
mesh.update(cells=mesh.cells[:, ::-1])
region = fem.RegionTriangle(mesh)
field = fem.FieldContainer([fem.FieldPlaneStrain(region, dim=2)])
boundaries, loadcase = fem.dof.shear(
field,
sym=False,
moves=(3, 0, 0),
)
solid = fem.SolidBody(umat=fem.LinearElasticLargeStrain(E=1, nu=0.3), 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) 3Dimport pyvista as pv
import skgmsh as sg
edge_source = pv.Cylinder(resolution=16)
edge_source.merge(pv.PolyData(edge_source.points), merge_points=True, inplace=True)
alg = sg.Delaunay3D(edge_source)
alg.cell_size = 0.2
mesh = fem.MeshContainer.from_unstructured_grid(alg.mesh, dim=3)[0]
mesh.update(cells=mesh.cells[:, ::-1])
region = fem.RegionTetra(mesh)
field = fem.FieldContainer([fem.Field(region, dim=3)])
boundaries, loadcase = fem.dof.shear(
field,
axes=(1, 0),
sym=False,
moves=(1.5, -0.5, 0.5),
)
solid = fem.SolidBody(umat=fem.LinearElasticLargeStrain(E=1, nu=0.3), field=field)
step = fem.Step(items=[solid], boundaries=boundaries)
job = fem.Job(steps=[step]).evaluate()
solid.plot("Principal Values of Logarithmic Strain", project=fem.project).show() |
Take the
points
andcells_dict
of an unstructured grid and create aMeshContainer
. This should simplify things liketo
Tasks
MeshContainer.from_unstructured_grid()
#847scikit-gmsh
(as suggested in Capturing PyVista's user stories pyvista/pyvista#2133 (reply in thread) by @tkoyama010) once the importer is availableThe text was updated successfully, but these errors were encountered: