.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial/extut02_job.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_tutorial_extut02_job.py: Run a Job --------- .. topic:: Learn how to apply boundary conditions in a ramped manner within a **Step** and run a **Job**. * create a **Step** with ramped boundary conditions * run a **Job** and export a XDMF time-series file This tutorial once again covers the essential high-level parts of creating and solving problems with FElupe. This time, however, the external displacements are applied in a ramped manner. The prescribed displacements of a cube under non-homogenous :func:`uniaxial loading ` will be controlled within a :class:`step `. The :class:`Ogden-Roxburgh ` pseudo-elastic Mullins softening model is combined with an isotropic hyperelastic :class:`Neo-Hookean ` material formulation, which is further applied on a :class:`nearly incompressible solid body ` for a realistic analysis of rubber-like materials. Note that the bulk modulus is now an argument of the (nearly) incompressible solid body instead of the constitutive Neo-Hookean material definition. .. GENERATED FROM PYTHON SOURCE LINES 25-37 .. code-block:: Python import felupe as fem mesh = fem.Cube(n=6) region = fem.RegionHexahedron(mesh=mesh) field = fem.FieldContainer([fem.Field(region=region, dim=3)]) boundaries = fem.dof.uniaxial(field, clamped=True, return_loadcase=False) umat = fem.OgdenRoxburgh(material=fem.NeoHooke(mu=1), r=3, m=1, beta=0) body = fem.SolidBodyNearlyIncompressible(umat=umat, field=field, bulk=5000) .. GENERATED FROM PYTHON SOURCE LINES 38-42 The ramped prescribed displacements for 12 substeps are created with :func:`~felupe.math.linsteps`. A :class:`~felupe.Step` is created with a list of items to be considered (here, one single solid body) and a dict of ramped boundary conditions along with the prescribed values. .. GENERATED FROM PYTHON SOURCE LINES 42-47 .. code-block:: Python move = fem.math.linsteps([0, 2, 1.5], num=[8, 4]) uniaxial = fem.Step( items=[body], ramp={boundaries["move"]: move}, boundaries=boundaries ) .. GENERATED FROM PYTHON SOURCE LINES 48-52 This step is now added to a :class:`~felupe.Job`. The results are exported after each completed and successful substep as a time-series XDMF-file. A :class:`~felupe.CharacteristicCurve`-job logs the displacement and sum of reaction forces on a given boundary condition. .. GENERATED FROM PYTHON SOURCE LINES 52-57 .. code-block:: Python job = fem.CharacteristicCurve(steps=[uniaxial], boundary=boundaries["move"]) job.evaluate(filename="result.xdmf") field.plot("Principal Values of Logarithmic Strain").show() .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /tutorial/images/sphx_glr_extut02_job_001.png :alt: extut02 job :srcset: /tutorial/images/sphx_glr_extut02_job_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/felupe/checkouts/stable/docs/tutorial/images/sphx_glr_extut02_job_001.vtksz .. GENERATED FROM PYTHON SOURCE LINES 58-61 The sum of the reaction force in direction :math:`x` on the boundary condition ``"move"`` is plotted as a function of the displacement :math:`u` on the boundary condition ``"move"`` . .. GENERATED FROM PYTHON SOURCE LINES 61-65 .. code-block:: Python fig, ax = job.plot( xlabel=r"Displacement $u$ in mm $\longrightarrow$", ylabel=r"Normal Force $F$ in N $\longrightarrow$", ) .. image-sg:: /tutorial/images/sphx_glr_extut02_job_002.png :alt: extut02 job :srcset: /tutorial/images/sphx_glr_extut02_job_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.134 seconds) .. _sphx_glr_download_tutorial_extut02_job.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: extut02_job.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: extut02_job.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: extut02_job.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_