.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Meshes/Mesh11.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_Mesh11.py: Mesh11 ====== Meshing of a specimen for a spatially oriented tensile test. .. GENERATED FROM PYTHON SOURCE LINES 12-76 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh11_001.png :alt: Mesh11 :srcset: /examples/Meshes/images/sphx_glr_Mesh11_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.3/docs/examples/Meshes/images/sphx_glr_Mesh11_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/Meshes/images/sphx_glr_Mesh11_002.png :alt: Mesh11 :srcset: /examples/Meshes/images/sphx_glr_Mesh11_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/easyfea/checkouts/v1.8.3/docs/examples/Meshes/images/sphx_glr_Mesh11_002.vtksz .. code-block:: Python :lineno-start: 13 import numpy as np from EasyFEA import Display, ElemType, PyVista from EasyFEA.Geoms import Point, Line, CircleArc, Contour, Domain if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- # geom L = 1 H = 2 e = L * 0.5 # ---------------------------------------------- # Mesh # ---------------------------------------------- p1 = Point(-L / 2) p2 = Point(L / 2) p3 = p2 + [0, H] p4 = p1 + [0, H] p5 = Point(e / 2, H / 2) p6 = Point(-e / 2, H / 2) l1 = Line(p1, p2) l2 = CircleArc(p2, p3, P=p5) l3 = Line(p3, p4) l4 = CircleArc(p4, p1, P=p6) contour = Contour([l1, l2, l3, l4]) contour2 = Domain(p1 - [0, H / 2], p2, isFilled=True) contour3 = contour2.copy() contour3.Translate(dy=H + H / 2) surfaces = [contour2, contour3] PyVista.Plot_Geoms([contour, *surfaces]).show() mesh = contour.Mesh_Extrude( [], [0, 0, e], [3], isOrganised=True, elemType=ElemType.HEXA8, additionalSurfaces=surfaces, ) # ---------------------------------------------- # Update coords # ---------------------------------------------- oldArea = mesh.area mesh.Rotate(-45, mesh.center) assert np.abs(mesh.area - oldArea) / oldArea <= 1e-12 mesh.Rotate(45, mesh.center, (1, 0)) assert np.abs(mesh.area - oldArea) / oldArea <= 1e-12 PyVista.Plot_Mesh(mesh).show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.382 seconds) .. _sphx_glr_download_examples_Meshes_Mesh11.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Mesh11.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Mesh11.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Mesh11.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_