Saving, loading cylinders

Asked by Kneib François

Hi

I've got a problem while saving/loading simulations with chainedCylinders.
This appends only when :
- I run a simulation with more than one chainedCylinder.
- I have some interactions between some spheres and the cylinders
- I save/load the simulation (I succeed to load the simulation)
Then if I try to perform one more step of DEM, I get a segmentation fault.
The debug mode displays this error :

in Ig2_Sphere_ChainedCylinder_CylScGeom::go (this=0x7f83b09fd880, cm1=..., cm2=..., state1=..., state2=..., shift2=..., force=@0x7f839f0398ab, c=...) at pkg/common/Cylinder.cpp:56

and at line 56 of my Cylinder.cpp :

54 shared_ptr<const ChainedState> statePrev;
55 if (cylinderSt->rank>0)
56 statePrev = YADE_PTR_CAST<const ChainedState> (Body::byId(cylinderSt->chains[cylinderSt->chainNumber][cylinderSt->rank-1],scene)->state);

I think that when saving/loading the simulation YADE creates the chainedCylinders, but the information about which cylinder belongs to which chainedCylinder is not totally created. Maybe the chains array is not completed ?

I noticed that in the Python console the chainNumber argument of the cylinder's state is preserved through the saving/loading operation. The currentChain attribute of each cylinder is lost and set to 0 when I load a simulation.

Do you think there is a way to bypass the problem ?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Thank you for detailed report.
currentChain is only a static attribute pointing to the chain where next
bodies will be appended. Therefore it is not registered at the bodies
level (only chainNumber is), and it is not surprising if currentChain is
not preserved in save/load cycles. It should be harmless in itslef.
I guess there is something else going wrong at reload time.

Since this code is still in development, I can't give any ETA for a fix.
Could you please open a bug so we don't forget this problem? You can
just copy/paste you message below. If you investigate more, please let
us know what you find and append the data in the same bug.

Thanks.

Bruno

On 18/07/11 16:21, franz wrote:
> New question #165210 on Yade:
> https://answers.launchpad.net/yade/+question/165210
>
> Hi
>
> I've got a problem while saving/loading simulations with chainedCylinders.
> This appends only when :
> - I run a simulation with more than one chainedCylinder.
> - I have some interactions between some spheres and the cylinders
> - I save/load the simulation (I succeed to load the simulation)
> Then if I try to perform one more step of DEM, I get a segmentation fault.
> The debug mode displays this error :
>
> in Ig2_Sphere_ChainedCylinder_CylScGeom::go (this=0x7f83b09fd880, cm1=..., cm2=..., state1=..., state2=..., shift2=..., force=@0x7f839f0398ab, c=...) at pkg/common/Cylinder.cpp:56
>
> and at line 56 of my Cylinder.cpp :
>
> 54 shared_ptr<const ChainedState> statePrev;
> 55 if (cylinderSt->rank>0)
> 56 statePrev = YADE_PTR_CAST<const ChainedState> (Body::byId(cylinderSt->chains[cylinderSt->chainNumber][cylinderSt->rank-1],scene)->state);
>
> I think that when saving/loading the simulation YADE creates the chainedCylinders, but the information about which cylinder belongs to which chainedCylinder is not totally created. Maybe the chains array is not completed ?
>
> I noticed that in the Python console the chainNumber argument of the cylinder's state is preserved through the saving/loading operation. The currentChain attribute of each cylinder is lost and set to 0 when I load a simulation.
>
> Do you think there is a way to bypass the problem ?
>
> Thanks
>

--
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________

Revision history for this message
Yade Guide (yade-guide) said :
#2

Hey there! As an automated bot, I've gone through your question and found a few related threads that might interest you. Feel free to explore these topics further by clicking on the links below.

Title: "after loading simulation "
User encounters issues with 'simul.py' due to type mismatch while attempting to add oscillations and modify iterations for a falling cylinder simulation. Jan recommends using O.run(11200, True) instead of O.save('init_config.yade.gz') and suggests checking if the second script includes a Cylinder object and if saving the packing would suffice. The user also inquired about appending harmonic motion.
https://answers.launchpad.net/yade/+question/678583

Title: "Problems with manipulation force container after erasing some bodies"
The user encounters a segmentation core fault due to force container manipulation after erasing bodies from the simulation, suspecting that manually resetting forces after stepping might be causing the issue in various versions of Yade and Yadedaily. Jan confirms it's not a silly bug but a regular one.
https://answers.launchpad.net/yade/+question/699375

Can you help with this problem?

Provide an answer of your own, or ask Kneib François for more information if necessary.

To post a message you must log in.