.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/basic/cantilever_beam_3d_nlgeom.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_cantilever_beam_3d_nlgeom.py: 3D cantilever beam with geometric nonlinearities ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Large deflection of a ``hex8`` cantilever beam (updated Lagrangian formulation, ``nlgeom=True``): a transverse displacement of half the beam length is imposed on the top edge of the free end. .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python import fedoo as fd .. GENERATED FROM PYTHON SOURCE LINES 13-15 Pre-treatment: mesh and problem definition ------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 15-52 .. code-block:: Python fd.ModelingSpace("3D") # Units: N, mm, MPa mesh = fd.mesh.box_mesh( nx=31, ny=7, nz=7, x_min=0, x_max=1000, y_min=0, y_max=100, z_min=0, z_max=100, elm_type="hex8", name="Domain", ) # Material definition fd.constitutivelaw.ElasticIsotrop(200e3, 0.3, name="ElasticLaw") wf = fd.weakform.StressEquilibrium("ElasticLaw", nlgeom=True) # Assembly assemb = fd.Assembly.create(wf, mesh, "hex8", name="Assembling") # Type of problem pb = fd.problem.NonLinear("Assembling") # Boundary conditions nodes_left = mesh.find_nodes("X", mesh.bounding_box.xmin) nodes_load = mesh.find_nodes( f"X=={mesh.bounding_box.xmax} and Y=={mesh.bounding_box.ymax}" ) pb.bc.add("Dirichlet", nodes_left, "Disp", 0) pb.bc.add("Dirichlet", nodes_load, "DispY", -500) .. rst-class:: sphx-glr-script-out .. code-block:: none Dirichlet boundary condition: var = 'DispY' n_nodes = 7 value = -500 .. GENERATED FROM PYTHON SOURCE LINES 53-56 Solve and plot the results -------------------------- The prescribed displacement is applied in 5 increments. .. GENERATED FROM PYTHON SOURCE LINES 56-61 .. code-block:: Python pb.nlsolve(dt=0.2) res = pb.get_results("Assembling", ["Stress", "Disp"]) res.plot("Stress", "XX", "Node", show_edges=False) .. image-sg:: /examples/basic/images/sphx_glr_cantilever_beam_3d_nlgeom_001.png :alt: cantilever beam 3d nlgeom :srcset: /examples/basic/images/sphx_glr_cantilever_beam_3d_nlgeom_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Iter 1 - Time: 0.20000 - dt 0.20000 - NR iter: 3 - Err: 0.00011 Iter 2 - Time: 0.40000 - dt 0.25000 - NR iter: 3 - Err: 0.00040 Iter 3 - Time: 0.60000 - dt 0.25000 - NR iter: 3 - Err: 0.00023 Iter 4 - Time: 0.80000 - dt 0.25000 - NR iter: 3 - Err: 0.00011 Iter 5 - Time: 1.00000 - dt 0.25000 - NR iter: 3 - Err: 0.00015 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.348 seconds) .. _sphx_glr_download_examples_basic_cantilever_beam_3d_nlgeom.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: cantilever_beam_3d_nlgeom.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: cantilever_beam_3d_nlgeom.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: cantilever_beam_3d_nlgeom.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_