.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/Beam/Beam4.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_Beam4.py: Beam4 ===== Frame with two beams. .. GENERATED FROM PYTHON SOURCE LINES 12-91 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/Beam/images/sphx_glr_Beam4_001.png :alt: SEG2: Ne = 14, Nn = 16 :srcset: /examples/Beam/images/sphx_glr_Beam4_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam4_002.png :alt: Boundary conditions :srcset: /examples/Beam/images/sphx_glr_Beam4_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam4_003.png :alt: $ux^{e}$ :srcset: /examples/Beam/images/sphx_glr_Beam4_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/Beam/images/sphx_glr_Beam4_004.png :alt: $uy^{e}$ :srcset: /examples/Beam/images/sphx_glr_Beam4_004.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 beam3. ==================== Mesh ==================== Element type: SEG2 Ne = 14, Nn = 16 ==================== Model ==================== solver:scipy ============= Boundary Conditions ============= Unspecified. =================== Results =================== Ux max = 0.00e+00 Ux min = -6.91e-01 Uy max = 0.00e+00 Uy min = -8.09e-01 Uz max = 1.94e+00 Uz min = 0.00e+00 =================== TicTac =================== Mesh: 9.328 ms Boundary Conditions: 65.327 µs Matrix: 5.811 ms Solver: 1.451 ms Display: 47.560 ms | .. code-block:: Python :lineno-start: 13 import matplotlib.pyplot as plt from EasyFEA import Display, Models, Mesher, ElemType, Simulations from EasyFEA.Geoms import Domain, Line if __name__ == "__main__": Display.Clear() # ---------------------------------------------- # Configuration # ---------------------------------------------- # geom L = 120 h = 13 b = 13 # model E = 210000 v = 0.3 # load load = 800 # ---------------------------------------------- # Mesh # ---------------------------------------------- elemType = ElemType.SEG2 # Create a section object for the beam mesh mesher = Mesher() section = mesher.Mesh_2D(Domain((0, 0), (b, h))) 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, elemType=elemType) # ---------------------------------------------- # Simulation # ---------------------------------------------- # Initialize the beam structure with the defined beam segments beamStructure = Models.Beam.BeamStructure(beams) # Create the beam simulation simu = Simulations.Beam(mesh, beamStructure) 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() # ---------------------------------------------- # Results # ---------------------------------------------- Display.Plot_Mesh(simu, L / 10 / sol.max()) Display.Plot_BoundaryConditions(simu) Display.Plot_Result(simu, "ux", L / 10 / sol.max()) Display.Plot_Result(simu, "uy", L / 10 / sol.max()) print(simu) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.275 seconds) .. _sphx_glr_download_examples_Beam_Beam4.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Beam4.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Beam4.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: Beam4.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_