<jupyter_start><jupyter_text>VMAP IO DemoThis demo shows the stress gradient calculation module. A gradient is calculated by fitting a plane into a node and its neighbor nodes of an FEM mesh.See [documentation](https://pylife.readthedocs.io/en/latest/mesh/gradient.html) for details on the module.<jupyter_code>import numpy as np
import pandas as pd
import pylife.vmap
import pylife.mesh.meshsignal
import pylife.stress.equistress
import pyvista as pv

pv.set_plot_theme('document')
pv.set_jupyter_backend('panel')<jupyter_output><empty_output><jupyter_text>Read in demo data and add the stress tensor dimensions for the third dimension.<jupyter_code>vm_mesh = pylife.vmap.VMAPImport("plate_with_hole.vmap")
pyLife_mesh = (vm_mesh.make_mesh('1', 'STATE-2')
               .join_coordinates()
               .join_variable('STRESS_CAUCHY')
               .join_variable('DISPLACEMENT')
               .to_frame())
pyLife_mesh.sample(10)
pyLife_mesh['mises'] = pyLife_mesh.equistress.mises()<jupyter_output><empty_output><jupyter_text>Plotting the structure using pyVista<jupyter_code>grid = pv.UnstructuredGrid(*pyLife_mesh.mesh.vtk_data())
plotter = pv.Plotter(window_size=[1920, 1080])
plotter.add_mesh(grid, scalars=pyLife_mesh.groupby('element_id')['mises'].mean().to_numpy(),
                show_edges=True, cmap='jet')
plotter.add_scalar_bar()
plotter.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11190817790530846, 'fraction_numerical': 0.00860832137733142, 'mean_word_length': 5.458333333333333, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '158575', 'license': 'Apache-2.0', 'n_tokens_mistral': 494, 'n_tokens_neox': 470, 'n_words': 92, 'path': 'demos/VMAP_io.ipynb', 'repo_name': 'alexander-maier/pylife', 'size': '1394'}