.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Hyperelasticity/Hyperelas1.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_Hyperelasticity_Hyperelas1.py: Hyperelas1 ========== A cantilever beam undergoing bending deformation. .. GENERATED FROM PYTHON SOURCE LINES 12-65 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas1_001.png :alt: Hyperelas1 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas1_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.0/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas1_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas1_002.png :alt: Hyperelas1 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas1_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.0/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas1_002.vtksz .. rst-class:: sphx-glr-script-out .. code-block:: none ===== hyperelastic problem at iteration 0 ===== At Newton iteration 1 norm is 2.871866871895e+02 At Newton iteration 2 norm is 5.537584333550e+03 At Newton iteration 3 norm is 4.394345963119e-01 At Newton iteration 4 norm is 1.725001838936e-08 | .. code-block:: Python :lineno-start: 13 from EasyFEA import Display, ElemType, Models, Simulations, PyVista from EasyFEA.Geoms import Domain if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- # geom L = 120 h = 13 # model lmbda = 121153.84615384616 # Mpa mu = 80769.23076923077 rho = 7850 * 1e-9 # kg/mm3 # ---------------------------------------------- # Mesh # ---------------------------------------------- meshSize = h / 2 contour = Domain((0, 0), (L, h), h / 3) mesh = contour.Mesh_Extrude( [], [0, 0, h], [h / meshSize], ElemType.HEXA20, isOrganised=True ) nodesX0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0) nodesXL = mesh.Nodes_Conditions(lambda x, y, z: x == L) # ---------------------------------------------- # Simulation # ---------------------------------------------- mat = Models.HyperElastic.SaintVenantKirchhoff(3, lmbda, mu) simu = Simulations.HyperElastic(mesh, mat) simu.add_dirichlet(nodesX0, [0, 0, 0], simu.Get_unknowns()) simu.add_volumeLoad(mesh.nodes, [-rho * 9.81], ["y"]) simu.add_surfLoad(nodesXL, [-800 / h / h], ["y"]) simu.Solve() # ---------------------------------------------- # Results # ---------------------------------------------- PyVista.Plot_BoundaryConditions(simu).show() PyVista.Plot(simu, "uy", 1, plotMesh=True).show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.084 seconds) .. _sphx_glr_download_examples_Hyperelasticity_Hyperelas1.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Hyperelas1.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Hyperelas1.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Hyperelas1.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_