.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Meshes/Mesh5_2D.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_Meshes_Mesh5_2D.py: Mesh5_2D ======== Mesh of a 2D cracked part. .. GENERATED FROM PYTHON SOURCE LINES 11-61 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh5_2D_001.png :alt: Mesh5 2D :srcset: /examples/Meshes/images/sphx_glr_Mesh5_2D_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.6.0/docs/examples/Meshes/images/sphx_glr_Mesh5_2D_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh5_2D_002.png :alt: Mesh5 2D :srcset: /examples/Meshes/images/sphx_glr_Mesh5_2D_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.6.0/docs/examples/Meshes/images/sphx_glr_Mesh5_2D_002.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh5_2D_003.png :alt: Mesh5 2D :srcset: /examples/Meshes/images/sphx_glr_Mesh5_2D_003.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.6.0/docs/examples/Meshes/images/sphx_glr_Mesh5_2D_003.vtksz .. code-block:: Python :lineno-start: 12 from EasyFEA import Display, ElemType, Models, Simulations, PyVista from EasyFEA.Geoms import Point, Line, Points, Domain if __name__ == "__main__": Display.Clear() L = 1 openCrack = True contour = Domain(Point(), Point(L, L)) # ---------------------------------------------- # CRACK # ---------------------------------------------- crack1 = Line(Point(L / 4, L / 2), Point(3 * L / 4, L / 2), isOpen=openCrack) crack2 = Line( Point(0, L / 3, isOpen=openCrack), Point(L / 2, L / 3), isOpen=openCrack ) crack3 = Line( Point(0, 2 * L / 3, isOpen=openCrack), Point(L / 2, 2 * L / 3), isOpen=openCrack ) crack4 = Line(Point(0, 4 * L / 5), Point(L, 4 * L / 5), isOpen=False) crack5 = Points( [Point(L / 2, L / 5), Point(2 * L / 3, L / 5), Point(L, L / 10, isOpen=True)], isOpen=True, ) cracks = [crack1, crack2, crack3, crack4, crack5] PyVista.Plot_Geoms([contour, *cracks]).show() mesh = contour.Mesh_2D([], ElemType.TRI6, cracks) PyVista.Plot_Tags(mesh).show() # ---------------------------------------------- # SIMU # ---------------------------------------------- material = Models.ElasIsot(2) simu = Simulations.ElasticSimu(mesh, material) simu.add_dirichlet( mesh.Nodes_Conditions(lambda x, y, z: y == 0), [0] * 2, simu.Get_unknowns() ) simu.add_dirichlet(mesh.Nodes_Conditions(lambda x, y, z: y == L), [L * 0.05], ["y"]) simu.Solve() PyVista.Plot(simu, "uy", 1, plotMesh=True).show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.663 seconds) .. _sphx_glr_download_examples_Meshes_Mesh5_2D.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Mesh5_2D.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Mesh5_2D.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Mesh5_2D.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_