.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/LinearizedElasticity/Elas4.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_Elas4.py: Elas4 ===== Plate with a hole subjected to uniform tensile loading. .. GENERATED FROM PYTHON SOURCE LINES 11-96 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas4_001.png :alt: TRI10: Ne = 104, Nn = 511 :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas4_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas4_002.png :alt: Boundary conditions :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas4_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas4_003.png :alt: $ux$ :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas4_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas4_004.png :alt: $uy$ :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas4_004.png :class: sphx-glr-multi-img * .. image-sg:: /examples/LinearizedElasticity/images/sphx_glr_Elas4_005.png :alt: $\sigma_{vm}^{e}$ :srcset: /examples/LinearizedElasticity/images/sphx_glr_Elas4_005.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ==================== Mesh ==================== Element type: TRI10 Ne = 104, Nn = 511 ==================== Model ==================== ElasIsot: E = 2.10e+05, v = 0.3 planeStress = True thickness = 1.00e+00 solver : scipy ============= Boundary Conditions ============= Unspecified. =================== Results =================== W def = 5.04 Svm max = 127.24 Evm max = 0.07 % Ux max = 1.27e-02 Ux min = 0.00e+00 Uy max = 0.00e+00 Uy min = -4.89e-03 =================== TicTac =================== Mesh : 318.986 ms Boundary Conditions : 826.597 µs Matrix : 2.812 s Solver : 3.980 s Display : 732.631 ms PostProcessing : 282.366 ms Resolution hyperelastic : 5.990 s PyVista_Interface : 17.804 s | .. code-block:: Python :lineno-start: 12 from EasyFEA import Display, ElemType, Models, Simulations from EasyFEA.Geoms import Point, Points, Domain, Circle if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- dim = 2 isSymmetric = True # geom a = 10 l = 50 h = 20 thickness = 1 # ---------------------------------------------- # Mesh # ---------------------------------------------- meshSize = h / 4 if isSymmetric: p0 = Point(0, 0, r=-a) p1 = Point(l, 0) p2 = Point(l, h) p3 = Point(0, h) contour = Points([p0, p1, p2, p3], meshSize) inclusions = [] else: p0 = Point(-l, -h) p1 = Point(l, h) contour = Domain(p0, p1, meshSize) inclusions = [Circle(Point(), 2 * a, meshSize, isHollow=True)] if dim == 2: mesh = contour.Mesh_2D(inclusions, elemType=ElemType.TRI10) else: mesh = contour.Mesh_Extrude( inclusions, [0, 0, thickness], [1], ElemType.PRISM18 ) # ---------------------------------------------- # Simu # ---------------------------------------------- material = Models.ElasIsot( dim, E=210000, v=0.3, planeStress=True, thickness=thickness ) simu = Simulations.ElasticSimu(mesh, material) if isSymmetric: nodes_x0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0) nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0) nodes_xl = mesh.Nodes_Conditions(lambda x, y, z: x == l) simu.add_dirichlet(nodes_x0, [0], ["x"]) simu.add_dirichlet(nodes_y0, [0], ["y"]) simu.add_surfLoad(nodes_xl, [800 / 20], ["x"]) else: nodes_pl = mesh.Nodes_Conditions(lambda x, y, z: x == l) nodes_ml = mesh.Nodes_Conditions(lambda x, y, z: x == -l) nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0) simu.add_dirichlet(nodes_y0, [0], ["y"]) simu.add_surfLoad(nodes_pl, [800 / 20], ["x"]) simu.add_surfLoad(nodes_ml, [-800 / 20], ["x"]) simu.Solve() # ---------------------------------------------- # Results # ---------------------------------------------- uxMax = simu.Result("ux").max() Display.Plot_Mesh(simu, deformFactor=2 / uxMax) Display.Plot_BoundaryConditions(simu) Display.Plot_Result(simu, "ux", ncolors=10) Display.Plot_Result(simu, "uy", ncolors=10) Display.Plot_Result(simu, "Svm", ncolors=10, nodeValues=False, plotMesh=True) print(simu) Display.plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.392 seconds) .. _sphx_glr_download_examples_LinearizedElasticity_Elas4.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Elas4.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Elas4.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Elas4.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_