pyvista.examples.downloads.download_fea_hertzian_contact_cylinder#

download_fea_hertzian_contact_cylinder(load=True)[source]#

Download a hertzian contact finite element solution.

Hertzian contact is referred to the frictionless contact between two bodies. Spherical contact is a special case of the Hertz contact, which is between two spheres, or as in the case of this dataset, between a sphere and the surface of a half space (flat plane).

Parameters:
loadbool, default: True

Load the dataset after downloading it when True. Set this to False and only the filename will be returned.

Returns:
pyvista.UnstructuredGrid | str

DataSet or filename depending on load.

Examples

Plot by part ID.

>>> import numpy as np
>>> import pyvista as pv
>>> from pyvista import examples
>>> grid = examples.download_fea_hertzian_contact_cylinder()
>>> grid.plot(
...     scalars='PartID', cmap=['green', 'blue'], show_scalar_bar=False
... )
../../../_images/pyvista-examples-downloads-download_fea_hertzian_contact_cylinder-1_00_00.png

Plot the absolute value of the component stress in the Z direction.

>>> pl = pv.Plotter()
>>> z_stress = np.abs(grid['Stress'][:, 2])
>>> _ = pl.add_mesh(
...     grid,
...     scalars=z_stress,
...     clim=[0, 1.2e9],
...     cmap='jet',
...     lighting=True,
...     show_edges=False,
...     ambient=0.2,
... )
>>> pl.camera_position = 'xz'
>>> pl.camera.zoom(1.4)
>>> pl.show()
../../../_images/pyvista-examples-downloads-download_fea_hertzian_contact_cylinder-1_01_00.png