.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/basic/lattice_beam.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_basic_lattice_beam.py: Beam lattice structure using a beam model with geometric nonlinearities ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The edges of a structured box mesh are extracted to build a beam lattice. The left face is clamped and a large transverse displacement is imposed on the right face. The geometrically nonlinear beam problem uses the consistent corotational tangent of :py:class:`fedoo.weakform.BeamEquilibrium`. .. GENERATED FROM PYTHON SOURCE LINES 10-56 .. image-sg:: /examples/basic/images/sphx_glr_lattice_beam_001.png :alt: lattice beam :srcset: /examples/basic/images/sphx_glr_lattice_beam_001.png :class: sphx-glr-single-img .. code-block:: Python import fedoo as fd import numpy as np E = 1e5 nu = 0.3 radius = 1 k = 0.9 # shear shape factor. k=0 to neglect the shear effect (Bernoulli) n = 6 # n_nodes ndim = 3 if ndim == 2: fd.ModelingSpace("2D") else: fd.ModelingSpace("3D") material = fd.constitutivelaw.ElasticIsotrop(E, nu) beam_props = fd.constitutivelaw.BeamCircular(material, radius, k=k) # Extract a Lattice Mesh from a 3D mesh if ndim == 2: mesh = fd.mesh.extract_edges( fd.mesh.rectangle_mesh(n, n, x_max=100, y_max=100, ndim=ndim) ) else: mesh = fd.mesh.extract_edges( fd.mesh.box_mesh(n, n, n, x_max=100, y_max=100, z_max=100) ) nodes_left = mesh.find_nodes("X", mesh.bounding_box.xmin) nodes_right = mesh.find_nodes("X", mesh.bounding_box.xmax) wf = fd.weakform.BeamEquilibrium(beam_props, consistent_tangent=True) assembly = fd.Assembly.create(wf, mesh) pb = fd.problem.NonLinear(assembly, nlgeom=True) pb.bc.add("Dirichlet", nodes_left, ["Disp", "Rot"], 0) pb.bc.add("Dirichlet", nodes_right, "DispY", -50) pb.set_nr_criterion("Displacement", tol=5e-3, max_subiter=10) pb.nlsolve(dt=0.02, update_dt=True, print_info=0) # Post treatment results = pb.get_results(assembly, ["Disp", "Rot", "BeamStress"]) # component 0 of BeamStress is the axial force N results.plot("BeamStress", 0) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.020 seconds) .. _sphx_glr_download_examples_basic_lattice_beam.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: lattice_beam.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: lattice_beam.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: lattice_beam.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_