.. _examples:

Examples with tutorial
======================

The `online version <https://yade-dem.org/doc/tutorial-examples.html>`_ of this tutorial contains embedded videos.

.. _bouncing-sphere:

Bouncing sphere
---------------

Following example is in file :ysrc:`doc/sphinx/tutorial/01-bouncing-sphere.py`.

.. youtube:: CMfL8PGq-xQ

.. literalinclude:: tutorial/01-bouncing-sphere.py


.. _gravity-deposition:

Gravity deposition
------------------

Following example is in file :ysrc:`doc/sphinx/tutorial/02-gravity-deposition.py`.

.. youtube:: YUlUSI9YADM

.. literalinclude:: tutorial/02-gravity-deposition.py


.. _oedometric-test:

Oedometric test
----------------

Following example is in file :ysrc:`doc/sphinx/tutorial/03-oedometric-test.py`.

.. youtube:: RjH1v-Fth34

.. literalinclude:: tutorial/03-oedometric-test.py

Batch table
^^^^^^^^^^^^

To run the same script :ysrc:`doc/sphinx/tutorial/03-oedometric-test.py` in batch mode to test different parameters, execute command ``yade-batch 03-oedometric-test.table 03-oedometric-test.py``, also visit page http://localhost:9080 to see the batch simulation progress.

.. literalinclude:: tutorial/03-oedometric-test.table


.. _periodic-simple-shear:

Periodic simple shear
---------------------

Following example is in file :ysrc:`doc/sphinx/tutorial/04-periodic-simple-shear.py`.

.. FIXME - this example is broken.

.. youtube:: ZKHrILQCyZs

.. literalinclude:: tutorial/04-periodic-simple-shear.py


.. _3d-postprocessing:

3d postprocessing
-----------------

Following example is in file :ysrc:`doc/sphinx/tutorial/05-3d-postprocessing.py`. This example will run for 20000 iterations, saving ``*.png`` snapshots, then it will make a video ``3d.mpeg`` out of those snapshots.

.. youtube:: XpCWWPptQN4

.. literalinclude:: tutorial/05-3d-postprocessing.py

.. _periodic-triaxial-test:

Periodic triaxial test
----------------------

Following example is in file :ysrc:`doc/sphinx/tutorial/06-periodic-triaxial-test.py`. A variant of this exemple includes capillary forces, see :ysrc:`doc/sphinx/tutorial/06-periodic-triaxial-test-capillarity.py`

.. youtube:: utTDLZz0y_w

.. literalinclude:: tutorial/06-periodic-triaxial-test.py



Fluid injection
---------------

Following example is in file :ysrc:`doc/sphinx/tutorial/07-fluid-injection.py`.
The video below results from post-processing with paraview

.. youtube:: gH585XaQEcY

.. literalinclude:: tutorial/07-fluid-injection.py

