.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/LinearizedElasticity/Elas2.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_LinearizedElasticity_Elas2.py: Elas2 ===== Bending bracket component. .. GENERATED FROM PYTHON SOURCE LINES 11-81 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas2_001.png :alt: TETRA10: Ne = 2088, Nn = 3537 :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas2_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas2_002.png :alt: Boundary conditions :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas2_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas2_003.png :alt: $\sigma_{vm}$ :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas2_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ==================== Mesh ==================== Element type: TETRA10 Ne = 2088, Nn = 3537 ==================== Model ==================== ElasIsot: E = 2.10e+05, v = 0.3 solver : pypardiso ============= Boundary Conditions ============= Unspecified. =================== Results =================== W def = 4.04 Svm max = 10.32 Evm max = 0.01 % Ux max = 2.12e-03 Ux min = -2.88e-03 Uy max = 5.15e-05 Uy min = -1.01e-02 Uz max = 2.47e-04 Uz min = -2.41e-04 =================== TicTac =================== Mesh : 322.339 ms Boundary Conditions : 719.786 µs Matrix : 2.200 s Solver : 5.382 s Display : 404.923 ms PostProcessing : 234.529 ms Resolution hyperelastic : 6.641 s PyVista_Interface : 18.472 s | .. code-block:: Python :lineno-start: 12 from EasyFEA import Display, Models, plt, np, ElemType, Simulations from EasyFEA.Geoms import Point, Points if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- # geom dim = 3 L = 120 # mm h = L * 0.3 # model E = 210000 # MPa (Young's modulus) v = 0.3 # Poisson's ratio coef = 1 # load load = 800 # ---------------------------------------------- # Mesh # ---------------------------------------------- # Define points and crack geometry for the mesh pt1 = Point(isOpen=True, r=-10) pt2 = Point(x=L) pt3 = Point(x=L, y=h) pt4 = Point(x=h, y=h, r=10) pt5 = Point(x=h, y=L) pt6 = Point(y=L) pt7 = Point(x=h, y=h) contour = Points([pt1, pt2, pt3, pt4, pt5, pt6], h / 3) if dim == 2: mesh = contour.Mesh_2D([], ElemType.TRI3) elif dim == 3: mesh = contour.Mesh_Extrude([], [0, 0, -h], [4], elemType=ElemType.TETRA10) nodes_x0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0) nodes_xL = mesh.Nodes_Conditions(lambda x, y, z: x == L) # ---------------------------------------------- # Simulation # ---------------------------------------------- material = Models.ElasIsot(dim, E, v, planeStress=True, thickness=h) simu = Simulations.ElasticSimu(mesh, material) simu.add_dirichlet(nodes_x0, [0] * dim, simu.Get_unknowns()) simu.add_surfLoad(nodes_xL, [-800 / (h * h)], ["y"]) sol = simu.Solve() simu.Save_Iter() # ---------------------------------------------- # Results # ---------------------------------------------- print(simu) Display.Plot_Mesh(simu, h / 2 / np.abs(sol).max()) Display.Plot_BoundaryConditions(simu) Display.Plot_Result(simu, "Svm", nodeValues=True, coef=1 / coef, ncolors=20) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.854 seconds) .. _sphx_glr_download_examples_LinearizedElasticity_Elas2.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Elas2.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Elas2.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Elas2.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_