注釈
Go to the end to download the full example code.
Voxelized Foot Bones#
A Region on a voxel-based mesh with uniform hexahedrons should be
created with uniform=True to enhance performance.
This example requires external packages.
pip install pypardiso

import numpy as np
import pypardiso
import felupe as fem
mesh = fem.mesh.read("ex12_foot-bones_mesh-voxels.vtu")[0]
region = fem.RegionHexahedron(mesh, uniform=True)
field = fem.FieldContainer([fem.Field(region, dim=3)])
boundaries = {
"fixed": fem.Boundary(field[0], fx=lambda x: x <= -110),
"fixed_plane": fem.Boundary(field[0], fz=mesh.z.min()),
}
umat = fem.LinearElastic(E=1000, nu=0.3)
solid = fem.SolidBody(umat, field)
gravity = fem.SolidBodyForce(field, values=[0, 0, -7e-2])
bottom = fem.ContactRigidPlane(
field,
points=np.arange(mesh.npoints),
centerpoint=-1,
normal=[0, 0, 1],
friction=0.0,
items=[solid],
)
step = fem.Step(items=[solid, gravity, bottom], boundaries=boundaries)
job = fem.Job(steps=[step]).evaluate(solver=pypardiso.spsolve, parallel=True)
plotter = solid.plot(
"Principal Values of Cauchy Stress",
show_edges=False,
show_undeformed=False,
clim=[0, 10],
)
bottom.plot(plotter=plotter, color="lightgrey", opacity=1.0).show()
Total running time of the script: (0 minutes 2.783 seconds)