.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Beam/Beam7.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_Beam_Beam7.py: Beam7 ===== Frame with two beams in dynamic. .. GENERATED FROM PYTHON SOURCE LINES 12-138 .. image-sg:: /examples/Beam/images/sphx_glr_Beam7_001.gif :alt: Beam7 :srcset: /examples/Beam/images/sphx_glr_Beam7_001.gif :class: sphx-glr-single-img .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/Beam/images/sphx_glr_Beam7_002.png :alt: Boundary conditions :srcset: /examples/Beam/images/sphx_glr_Beam7_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam7_003.png :alt: $uy^{e}$ :srcset: /examples/Beam/images/sphx_glr_Beam7_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam7_004.png :alt: Section :srcset: /examples/Beam/images/sphx_glr_Beam7_004.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam7_005.png :alt: SEG3: Ne = 14, Nn = 30 :srcset: /examples/Beam/images/sphx_glr_Beam7_005.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none The beam's vertical axis has been selected incorrectly (collinear with the beam x-axis). Axis [-1. 0. 0.] has been assigned for beam12. Generate movie 01/20 (5.00 %) 2.29 s Generate movie 02/20 (10.00 %) 1.66 s Generate movie 03/20 (15.00 %) 1.60 s Generate movie 04/20 (20.00 %) 1.51 s Generate movie 05/20 (25.00 %) 1.39 s Generate movie 06/20 (30.00 %) 1.32 s Generate movie 07/20 (35.00 %) 1.23 s Generate movie 08/20 (40.00 %) 1.14 s Generate movie 09/20 (45.00 %) 1.03 s Generate movie 10/20 (50.00 %) 944.65 ms Generate movie 11/20 (55.00 %) 836.07 ms Generate movie 12/20 (60.00 %) 737.44 ms Generate movie 13/20 (65.00 %) 658.00 ms Generate movie 14/20 (70.00 %) 554.36 ms Generate movie 15/20 (75.00 %) 463.18 ms Generate movie 16/20 (80.00 %) 372.46 ms Generate movie 17/20 (85.00 %) 274.04 ms Generate movie 18/20 (90.00 %) 185.45 ms Generate movie 19/20 (95.00 %) 93.14 ms Generate movie 20/20 (100.00 %) 0.00 µs ==================== Mesh ==================== Element type: SEG3 Ne = 14, Nn = 30 ==================== Model ==================== solver:scipy ============= Boundary Conditions ============= Unspecified. =================== Results =================== Ux max = 1.23e-01 Ux min = 0.00e+00 Uy max = 1.90e-01 Uy min = 0.00e+00 Uz max = 4.62e-02 Uz min = -5.45e-01 =================== TicTac =================== Mesh: 16.101 ms Boundary Conditions: 176.191 µs Matrix: 69.093 ms Solver: 150.188 ms Display: 15.812 ms PyVista_Interface: 3.056 s | .. code-block:: Python :lineno-start: 13 import matplotlib.pyplot as plt from EasyFEA import ( Folder, Display, Models, Mesher, ElemType, Simulations, Paraview, PyVista, ) from EasyFEA.Geoms import Circle, Line if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- # outputs folder = Folder.Results_Dir() makeParaview = False makeMovie = True result = "uy" # geom L = 120 h = 13 b = 13 # model E = 210000 v = 0.3 rho = 7850 * 1e-9 # load load = 800 # time Tmax = 1 / 4 N = 50 dt = Tmax / N # ---------------------------------------------- # Mesh # ---------------------------------------------- # Create a section object for the beam mesh mesher = Mesher() section = mesher.Mesh_2D(Circle((0, 0), h), elemType=ElemType.TRI6) p1 = (0, 0) p2 = (0, L) p3 = (L / 2, L) line1 = Line(p1, p2, L / 9) line2 = Line(p2, p3, L / 9) beam1 = Models.Beam.Isotropic(3, line1, section, E, v) beam2 = Models.Beam.Isotropic(3, line2, section, E, v) beams = [beam1, beam2] mesh = mesher.Mesh_Beams(beams=beams) # ---------------------------------------------- # Simulation # ---------------------------------------------- # Initialize the beam structure with the defined beam segments beamStructure = Models.Beam.BeamStructure(beams) # Create the beam simulation simu = Simulations.Beam(mesh, beamStructure) simu.rho = rho dof_n = simu.Get_dof_n() # Apply boundary conditions simu.add_dirichlet(mesh.Nodes_Point(p1), [0] * dof_n, simu.Get_unknowns()) simu.add_neumann(mesh.Nodes_Point(p3), [-load, load], ["y", "z"]) if beamStructure.nBeam > 1: simu.add_connection_fixed(mesh.Nodes_Point(p2)) # Solve the beam problem and get displacement results sol = simu.Solve() simu.Save_Iter() simu.Solver_Set_Hyperbolic_Algorithm(dt) simu.Bc_Init() simu.add_dirichlet(mesh.Nodes_Point(p1), [0] * dof_n, simu.Get_unknowns()) if beamStructure.nBeam > 1: simu.add_connection_fixed(mesh.Nodes_Point(p2)) for _ in range(N): simu.Solve() simu.Save_Iter() # ---------------------------------------------- # Results # ---------------------------------------------- Display.Plot_BoundaryConditions(simu) if makeParaview: Paraview.Save_simu(simu, folder) deform = 10 if makeMovie: PyVista.Movie_simu( simu, f"{result}", folder, f"{result}.gif", N=20, deformFactor=deform, plotMesh=True, ) print(simu) Display.Plot_Result(simu, result, deformFactor=deform) ax = Display.Plot_Mesh(section) ax.set_title("Section") Display.Plot_Mesh(simu, deformFactor=deform) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.475 seconds) .. _sphx_glr_download_examples_Beam_Beam7.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Beam7.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Beam7.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Beam7.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_