.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/shells/laminate_cantilever.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_shells_laminate_cantilever.py: Laminated plate cantilever (ShellLaminate) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A rectangular plate (100 x 20, plate elements) is clamped on one end and loaded by a transverse force at the center of the other end. The section is a symmetric sandwich defined with :class:`fedoo.constitutivelaw.ShellLaminate`: two stiff skins (thickness 0.2) on a core ten times softer (thickness 1), with transverse shear (Reissner-Mindlin plate). The problem is linear (:class:`fedoo.weakform.PlateEquilibrium`, :class:`fedoo.problem.Linear`). The through-thickness distribution of :math:`\sigma_{xx}` at one Gauss point shows the stress jump at the skin/core interfaces; the von Mises stress on the lower face is then plotted. .. GENERATED FROM PYTHON SOURCE LINES 16-22 .. code-block:: Python import os import fedoo as fd from matplotlib import pylab as plt .. GENERATED FROM PYTHON SOURCE LINES 23-25 Materials, laminated section and mesh ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 25-57 .. code-block:: Python fd.ModelingSpace("3D") E = 1e5 nu = 0.3 L = 100 h = 20 F = -100 geom_elm_type = "quad4" # choose among 'tri3', 'tri6', 'quad4', 'quad8', 'quad9' # True, False or 'auto'. If True, use selective reduced integration (SRI) for # linear elements. If 'auto', use the PlateEquilibrium defaults. reduced_integration = "auto" save_results = True mat1 = fd.constitutivelaw.ElasticIsotrop(E, nu, name="Mat1") mat2 = fd.constitutivelaw.ElasticIsotrop(E / 10, nu, name="Mat2") # total thickness 1.4; by default k=1 i.e. with transverse shear fd.constitutivelaw.ShellLaminate( ["Mat1", "Mat2", "Mat1"], [0.2, 1, 0.2], name="PlateSection" ) mesh = fd.mesh.rectangle_mesh( 201, 21, 0, L, -h / 2, h / 2, geom_elm_type, name="plate", ndim=3 ) nodes_left = mesh.node_sets["left"] nodes_right = mesh.node_sets["right"] node_right_center = nodes_right[(mesh.nodes[nodes_right, 1] ** 2).argmin()] .. GENERATED FROM PYTHON SOURCE LINES 58-60 Plate weak form, assembly and problem ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 60-90 .. code-block:: Python fd.weakform.PlateEquilibrium("PlateSection", name="WFplate") if reduced_integration == "auto": plate_elm_type = None elif reduced_integration: if geom_elm_type not in ["tri3", "quad4"]: raise ValueError("SRI plate elements are only available for tri3 and quad4") plate_elm_type = f"p{geom_elm_type}sri" else: plate_elm_type = f"p{geom_elm_type}" if plate_elm_type is None: fd.Assembly.create("WFplate", "plate", name="plate") else: fd.Assembly.create("WFplate", "plate", plate_elm_type, name="plate") pb = fd.problem.Linear("plate") # create a 'results' folder and set the desired outputs if not (os.path.isdir("results")): os.mkdir("results") res = pb.add_output( "results/laminate", "plate", ["Disp", "Rot", "Stress"], file_format="npz", position=-1, ) # position = -1 for the lower face .. GENERATED FROM PYTHON SOURCE LINES 91-95 Boundary conditions and solve ----------------------------- Clamped left end (displacements and rotations), transverse force at the center of the right end. .. GENERATED FROM PYTHON SOURCE LINES 95-107 .. code-block:: Python pb.bc.add("Dirichlet", nodes_left, "Disp", 0) pb.bc.add("Dirichlet", nodes_left, "Rot", 0) pb.bc.add("Neumann", node_right_center, "DispZ", F) pb.apply_boundary_conditions() pb.solve() if save_results: pb.save_results() # save in npz .. GENERATED FROM PYTHON SOURCE LINES 108-110 Through-thickness stress and von Mises stress --------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 110-121 .. code-block:: Python # stress distribution through the thickness at Gauss point 200 z, StressDistribution = fd.ConstitutiveLaw["PlateSection"].get_stress_distribution( fd.Assembly["plate"], 200 ) plt.plot(StressDistribution[0], z) plt.xlabel("SXX") plt.ylabel("z") # von Mises stress on the lower face res.plot("Stress", component="vm") .. image-sg:: /examples/shells/images/sphx_glr_laminate_cantilever_001.png :alt: laminate cantilever :srcset: /examples/shells/images/sphx_glr_laminate_cantilever_001.png :class: sphx-glr-single-img .. image-sg:: /examples/shells/images/sphx_glr_laminate_cantilever_002.png :alt: laminate cantilever :srcset: /examples/shells/images/sphx_glr_laminate_cantilever_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.087 seconds) .. _sphx_glr_download_examples_shells_laminate_cantilever.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: laminate_cantilever.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: laminate_cantilever.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: laminate_cantilever.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_