.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/boundary_conditions/rigid_tie.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_boundary_conditions_rigid_tie.py: Rigid tie constraint ~~~~~~~~~~~~~~~~~~~~ Example of a 2D rigid tie with :class:`fedoo.constraint.RigidTie2D`. The bottom face of a square is clamped and a rigid body rotation of 45° is imposed on the top face through the ``RigidRotZ`` degree of freedom added by the constraint, in finite strain (plane strain). .. GENERATED FROM PYTHON SOURCE LINES 10-45 .. code-block:: Python import fedoo as fd import numpy as np fd.ModelingSpace("2D") # plane strain assumption NLGEOM = True E = 200e3 nu = 0.3 mesh = fd.mesh.rectangle_mesh() material = fd.constitutivelaw.ElasticIsotrop(E, nu, name="ConstitutiveLaw") wf = fd.weakform.StressEquilibrium(material, nlgeom=NLGEOM, name="wf") assembly = fd.Assembly.create("wf", mesh) # node set for boundary conditions bottom = mesh.find_nodes("Y", mesh.bounding_box.ymin) top = mesh.find_nodes("Y", mesh.bounding_box.ymax) pb = fd.problem.NonLinear(assembly) pb.set_nr_criterion("Displacement", err0=1, tol=1e-2, max_subiter=5) results = pb.add_output( "results/rigid_tie_example", assembly, ["Disp", "Stress", "Strain", "Fext"] ) pb.bc.add(fd.constraint.RigidTie2D(top)) pb.bc.add("Dirichlet", bottom, "Disp", 0) pb.bc.add("Dirichlet", "RigidRotZ", -np.pi / 4) # Rigid rotation of the top pb.nlsolve(dt=0.2, tmax=1, update_dt=True, print_info=1, interval_output=0.2) .. rst-class:: sphx-glr-script-out .. code-block:: none Iter 1 - Time: 0.20000 - dt 0.20000 - NR iter: 3 - Err: 0.00021 Iter 2 - Time: 0.40000 - dt 0.20000 - NR iter: 3 - Err: 0.00018 Iter 3 - Time: 0.60000 - dt 0.20000 - NR iter: 3 - Err: 0.00018 Iter 4 - Time: 0.80000 - dt 0.20000 - NR iter: 3 - Err: 0.00021 Iter 5 - Time: 1.00000 - dt 0.20000 - NR iter: 3 - Err: 0.00028 .. GENERATED FROM PYTHON SOURCE LINES 46-47 Plot the YY stress component on the deformed configuration. .. GENERATED FROM PYTHON SOURCE LINES 47-50 .. code-block:: Python results.plot("Stress", component="YY", data_type="Node", show=True) .. image-sg:: /examples/boundary_conditions/images/sphx_glr_rigid_tie_001.png :alt: rigid tie :srcset: /examples/boundary_conditions/images/sphx_glr_rigid_tie_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 51-54 A movie of the whole loading can be written with ``results.write_movie("results/rigid_tie_example", "Stress", "vm", "Node")`` (requires ``imageio`` and ``imageio-ffmpeg``). .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.468 seconds) .. _sphx_glr_download_examples_boundary_conditions_rigid_tie.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: rigid_tie.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: rigid_tie.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: rigid_tie.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_