Welcome to ask.woodem.org. You may post when you login through your GitHub account.

The sequence about the Engine

0 votes
56 views
asked Sep 20, 2016 by MarcoTar (770 points)

Hi

Thanks for the answer about the previous question. It's really helpful.

One more question is about the sequence of the simulation.

More detailed, I create

1. 10,000 soil grains

2. A RC membrane

3. A rockfall boulder

Can I set the sequence of the simulation like this way:

firstly, let the membrane deform by its self-weight (gravity) generating the deflection

secondly, let the 10,000 soil grains settle to the membrane

lastly, let the rockfall drop to the grains.

Is it possible to create the engine to do the simulation step by step like the above procedure?

Well, a more detailed graph I can offer to you is the following

As it's shown, the red ball is the rockfall imposed by the initial velocity, the box filled with the soil grains and the bottom membrane.

If you can, please tell me if it's possible to create the engine sequence like what I stated. Or what I should do in order to get what I want.

Besides, there do has one #bug# about the box creation. In this analysis, I always need to do the code for a second time. The first time will show some error about the box creation, the SCENE has everthing except the box. And I need to do the same and exact code as the first time again, then the box will appear. I don't think it's the error about my code.

Thanks again

Waiting for your answer.

Feixiang Xuan

 

1 Answer

+1 vote
answered Sep 21, 2016 by eudoxos (43,490 points)

Hi, for the bug, please report it and describe it in more detail at https://github.com/woodem/woo/issues . I need the exact error message (it should be providing some explanation), and perhaps also the script which causes the behavior.

The sequence of simulation can be done in different ways, but the best way is to create a sort-of state machine, where a periodically function checks for the condition to move to the next stage and so on. Check out examples/oedometric.py, that's a good example how this can be done -- the stage is stored in S.lab.stage and the logic is hidden in checkProgress.

Make sure that you always store such variables in S.lab (and pass S as function parameter), that was everything will work even if you save and load your scene.

HTH, Vaclav

commented Sep 21, 2016 by MarcoTar (770 points)

Hi Vaclav
Again, thanks for your help.
But this script doesn't work again. It' not updated, because it still use the Api=10102.
Please fix it if you can

commented Sep 21, 2016 by MarcoTar (770 points)

Besides, I will upload the code which has the bug i discussed later in order to improve the code you delevoped.
See you soon.
Feixiang Xuan

commented Sep 21, 2016 by eudoxos (43,490 points)

The oedometric.py script works with git, I checked twice. What is the error you see? It is not helpful to say "it does not work". The API is OK, it produces no warning as it does not use features changed for 10103.

commented Sep 22, 2016 by MarcoTar (770 points)

Hi Valclav
I copy the code oedometric.py and paste in the Woo window, it always display this:

ERROR build-src-tree/../core/Scene.cpp:92 backgroundLoop: Exception:
PyRunner exception in 'checkProgress(S)':
: name 'checkProgress' is not defined: File "", line 1, in

I didn't modify anything.
So what's your suggestion?
Besides I upload the code which I suspected to the link you suggested.
Thanks again.
Feixiang Xuan

commented Sep 22, 2016 by eudoxos (43,490 points)

You can't copy & paste, you have to run "woo oedometric.py" (or something like that) from the command-line. Then it will work. Please read the tutorial for that, in particular https://woodem.org/tutorial/basic.html#running .

commented Sep 22, 2016 by MarcoTar (770 points)

Thanks Valclav.

Exactly, it works well now.

...