.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Hyperelasticity/Hyperelas3.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_Hyperelas3.py: Hyperelas3 ========== A L shape part undergoing bending deformation. .. GENERATED FROM PYTHON SOURCE LINES 12-81 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_001.png :alt: Hyperelas3 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.1/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas3_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_002.png :alt: Hyperelas3 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.1/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas3_002.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_003.png :alt: Hyperelas3 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_003.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.1/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas3_003.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_004.png :alt: Hyperelas3 :srcset: /examples/Hyperelasticity/images/sphx_glr_Hyperelas3_004.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.1/docs/examples/Hyperelasticity/images/sphx_glr_Hyperelas3_004.vtksz .. rst-class:: sphx-glr-script-out .. code-block:: none ===== hyperelastic problem at iteration 0 ===== At Newton iteration 1 norm is 6.497862896539e+05 At Newton iteration 2 norm is 2.235820378954e+06 At Newton iteration 3 norm is 3.844274348567e+03 At Newton iteration 4 norm is 9.791107560451e+00 At Newton iteration 5 norm is 7.112049689310e-07 ==================== Mesh ==================== Element type: PRISM6 Ne = 2370, Nn = 1744 ==================== Model ==================== solver : scipy ============= Boundary Conditions ============= Unspecified. =================== Results =================== Unspecified. =================== TicTac =================== Mesh : 57.712 ms Boundary Conditions : 13.351 µs Matrix : 357.993 ms Solver : 561.665 ms Resolution hyperelastic : 935.294 ms PyVista_Interface : 165.596 ms | .. code-block:: Python :lineno-start: 13 from EasyFEA import Display, Models, ElemType, Simulations, PyVista from EasyFEA.Geoms import Point, Points if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- dim = 3 # geom L = 250 thickness = 50 w = 50 # load sigMax = 8 * 1e5 / (w * thickness) # ---------------------------------------------- # Mesh # ---------------------------------------------- meshSize = L / 10 p1 = Point(0, 0) p2 = Point(L, 0) p3 = Point(L, L, r=50) p4 = Point(2 * L - w, L) p5 = Point(2 * L, L) p6 = Point(2 * L, 2 * L) p7 = Point(2 * L - w, 2 * L) p8 = Point(0, 2 * L) contour = Points([p1, p2, p3, p4, p5, p6, p7, p8], meshSize) if dim == 2: mesh = contour.Mesh_2D([], ElemType.TRI3) else: mesh = contour.Mesh_Extrude([], [0, 0, -thickness], [3], ElemType.PRISM6) nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0) nodes_Load = mesh.Nodes_Conditions(lambda x, y, z: x == 2 * L) # ---------------------------------------------- # Simulation # ---------------------------------------------- elas = Models.Elastic.Isotropic(dim, E=210000, v=0.25, planeStress=True) material = Models.HyperElastic.SaintVenantKirchhoff( dim, elas.get_lambda(), elas.get_mu(), thickness=thickness ) simu = Simulations.HyperElastic(mesh, material) simu.add_dirichlet(nodes_y0, [0] * dim, simu.Get_unknowns()) simu.add_surfLoad(nodes_Load, [sigMax], ["y"]) simu.Solve() # ---------------------------------------------- # Results # ---------------------------------------------- PyVista.Plot_Mesh(simu).show() PyVista.Plot_BoundaryConditions(simu).show() PyVista.Plot(simu, "ux", deformFactor=1).show() PyVista.Plot(simu, "uy", deformFactor=1).show() print(simu) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.671 seconds) .. _sphx_glr_download_examples_Hyperelasticity_Hyperelas3.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Hyperelas3.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Hyperelas3.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Hyperelas3.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_