How to run deformableBodies examples

Asked by Paul Pircher on 2021-01-12

Hi there,

lately I tried to run some of the examples for deformable elements from the more-examples section.
To be precise: The testDeformableBodies.py file. [1]

Apparently something has to be done in order to run those examples as there is already a hint:
"Did you compile yade with cmake option -DENABLE_FEMLIKE=1 ?"

It's is kinda straight forward, but I still some more detailed instruction for that.
What exactly is that command doing?
Do I need to reinstall yade completely? Or just run the command?
Does running that command do anything that needs to be considered for future use?

When I run the script without doing anything prior (like the cmake command) I receive the following error message multiple times:
<ERROR> DeformableCohesiveElement:54 bool yade::DeformableCohesiveElement::nodepair::operator<(const yade::DeformableCohesiveElement::nodepair&) const: Incomplete 'if' sequence

Is that the error message to expect when running the script without recompiling it first or is this something different?

The simulation still builds up and the body is shown. It kinda looks like in the video of the example.

When starting the simulation the following error occurs:

IndexError Traceback (most recent call last)
~/yade2020/install/bin/yade2020 in <module>
~/yade2020/install/bin/yade2020 in addplot()
    104
    105 def addplot():
--> 106 plot.addData(force=O.forces.f(forcebodies[1])[0],pos=(O.bodies[forcebodies[1]].state.pos[0]-initialpositions[forcebodies[1]][0]),vel=O.bodies[forcebodies[1]].state.vel[0],t=O.time,time=O.time,tm=O.time)
    107
    108 for i in forcebodies:
IndexError: list index out of range

Can someone please help me to run that example?
This could be really helpful to me if I understand that approach and can start to try out my own deformable element stuff.

[1] https://yade-dem.org/doc/tutorial-more-examples-fast.html#deformableelem

Question information

Language:
English Edit question
Status:
Open
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2021-01-18
Last reply:
2021-01-14
Janek Kozicki (cosurgi) said : #1

Let's start with a simple thing [1]. Does the command:

printAllVersions()

work for you? What does it print if it works?

[1] https://yade-dem.org/doc/user.html#questions-and-answers

Paul Pircher (chabs300) said : #2

Sorry, that I missed that. It works and here is the output:

In [1]: printAllVersions()

```
Yade version : 2020.01a
Yade features : BoostLog Odeint VTK OpenMP GTS GUI-Qt5 CGAL MPI FEMLIKE GL2PS PotentialParticles PotentialBlocks
Yade config dir: ~/.yade-2020.01a
```

Libraries used :

| library | cmake | C++ |
| ------------- | -------------------- | ------------------ |
| boost | 1.71.0 | 1.71.0 |
| cgal | | 5.0.2 |
| clp | | 1.17.5 |
| cmake | 3.16.3 | |
| compiler | /usr/bin/c++ 9.3.0 | gcc 9.3.0 |
| eigen | 3.3.7 | 3.3.7 |
| freeglut | 2.8.1 | |
| gl | | 20190805 |
| ipython | 7.13.0 | |
| metis | | 5.1.0 |
| mpi | 3.1 | ompi:4.0.3 |
| mpi4py | 3.0.3 | |
| openblas | | OpenBLAS 0.3.8 |
| python | 3.8.5 | 3.8.5 |
| qglviewer | | 2.6.3 |
| qt | | 5.12.8 |
| sphinx | 1.8.5-final-0 | |
| sqlite | | 3.31.1 |
| vtk | 6.3.0 | 6.3.0 |

Linux version: Ubuntu 20.04.1 LTS

Robert Caulk (rcaulk) said : #3

The error mentioned by OP is not the error of interest. I *guess* it is just a product of the main issue. When I test the same test script [1] on yadedaily 20201203-4444~b1faaf9~bionic1 and latest compiled trunk I get the following error first:

`
<ERROR> DeformableCohesiveElement:56 bool yade::DeformableCohesiveElement::nodepair::operator<(const yade::DeformableCohesiveElement::nodepair&) const: Incomplete 'if' sequence
`

Which suggests there is a problem somewhere in the function called "addNode()" [2]. Not sure I believe the "Incomplete 'if' sequence" complaint. But I'll try a couple changes to source to see if I can fix it.

[1]https://gitlab.com/yade-dev/trunk/-/blob/master/examples/deformableelem/testDeformableBodies.py
[2]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/fem/DeformableElement.cpp#L45

Paul Pircher (chabs300) said : #5

Thank you for your answer and for your time!

Is there something I can do in the meantime?

The approach with deformable elements would be really interesting and helpful for my project.
Until now I tried playing around with Nodes, CylinderConnections and PFacets to model a simple deformable cantilever beam. Quite similar to one of the PFacets examples [1] [2].
Since it seams that it is not quite possible to achieve correct mechanical (or phyiscal) behaviour, I wanted to try out deformable elements to compare it with my previous approach.

Thanks and best regards!

[1] https://gitlab.com/yade-dev/trunk/blob/master/examples/pfacet/mesh-pfacet.py
[2] https://yade-dem.org/doc/tutorial-more-examples-fast.html?highlight=more%20examples#pfacet

Can you help with this problem?

Provide an answer of your own, or ask Paul Pircher for more information if necessary.

To post a message you must log in.