ymport textExt attrs

Asked by bruna

Hello everyone!

I am trying to use a pre created agglomerate in a compression test. For this I use export and ymport textExt.
In the creating script I use after creating my aggregate :

part = export.textExt('Agregado2.txt',format='x_y_z_r_attrs',attrs=['b.material.normalCohesion', 'b.material.shearCohesion'])

The file created contains all properties I need. Everything is working fine until here.
 Although, when I import the aggregate in the compression script, spheres don't present the attrs that I exported before. I am using:

aggregate = ymport.textIExt('Agregado2.txt', material = CohFrictMat(), format = 'x_y_z_r_attrs', attrs=['b.material.normalCohesion', 'b.material.shearCohesion'])
O.bodies.append(aggregate)

The spheres imported has CohFrictMat() material but the normalCohesion and shearCohesion are equal to -1 (would it be the default value?).

I would like to know if it is possible to export and import the normal and shear Cohesion. If it is possible, am I doing something wrong? Why my final script doesn't import the attrs that I have exported?

Many thanks!

Bruna.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

>>am I doing something wrong?

Without an MWE there is no way to know [1]. I am happy to help trouble shoot with you if you post one.

Cheers,

Robert

[1]https://yade-dem.org/wiki/Howtoask

Revision history for this message
Best Jan Stránský (honzik) said :
#2

Hi Bruna,
have a look at the usage at [1,2,3]. You have to pass empty list as attrs argument and then "manually" use the values.
Next time, please consider Robert's note about MWE.
cheers
Jan

[1] https://github.com/yade/trunk/tree/master/examples/agglomerate
[2] https://github.com/yade/trunk/blob/master/examples/agglomerate/compress.py#L16
[3] https://github.com/yade/trunk/blob/master/examples/agglomerate/simulation.py#L16

Revision history for this message
bruna (brunamot) said :
#3

Thanks Jan Stránský, that solved my question.

Revision history for this message
bruna (brunamot) said :
#4

Thanks for the answer and sorry for the lack of information.
Next time I will pay more attention in my question informations.

Cheers,

Bruna.