Save the simulation result without OpenGL GLX

Asked by Milly Ro on 2020-11-20

Hello,

I have the following question: how can I save my simulation result (for examply for script pack_cloud.py from GitLab https://gitlab.com/yade-dev/trunk/-/blob/master/examples/test/pack-cloud.py but with my own particle distribution) without graphics drivers. It seems that the server I am usig for YADE does not have the necessary graphics driver, because I have got the error "OpenGL GLX extension not supported by display". Since I do not have administrator rights, I cannot install anything myself. Actually I do not need the graphic representation of my simulation, but only the result/calculation.

P.S. I am working on Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-178-generic x86_64) and my YADE version is 1.20.0.

Best regards,
Milly

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Jan Stránský (honzik) said : #1

Hello,

what is the problem? saving result? running simulation itself? ... ?
As you said, normally you do not need the graphics for "crunching numbers"..
Can you test the scenario locally?

> P.S. I am working on Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-178-generic x86_64) and my YADE version is 1.20.0.

consider updating both OS and Yade. Old version is not a problem for general questions/problems, but might become a bigger problem for specific problems, fixes etc.

cheers
Jan

Milly Ro (milly93) said : #2

Hello Jan,

thank you for your reply. The problem ist that I cannot get any results (numbers) because of this error with OpenGL. The process of calculation stops as soon as the simulation window cannot be open.

Best regards,
Milly

Jérôme Duriez (jduriez) said : #3

Maybe I did not get your question. This being said

- saving the current state of a simulation in order to be able to relaunch it after closing and reopening Yade is obtained using O.save: https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.save

- inkoking Yade with yade* -n (where yade* = yade or yadedaily or ..) cancels the call to Graphical User Interface

Milly Ro (milly93) said : #4

Hello Jerome,

sorry for the delay. My question was not about the saving of the state of simulation, but about the saving of the positions of all generated spheres as text data without running (3D) simulation in the graphics window. So I have the following Python code for packing spheres in cylinder:

sp0=pack.SpherePack();
sp0.makeCloud((-20,-5,-20),(20,5,20),psdSizes=psdSizes,psdCumm=psdCumm, rRelFuzz=.65, distributeMass=False)
pred = pack.inCylinder((0,-5,0),(0,5,0),radius=25)
for c,r in sp0:
 if pred(c,r):
   O.bodies.append(sphere(c,r))

My questions are:

1. How can I save each positions and size of my spheres in cylinder as text file?

2. If I write in makeCloud the values for psdSize and psdCumm, will an additional parameter 'rRelFuzz' be taken into account? Or it will be ignored because the particle distribution is known?

I hope you understand what I mean :)

Kind regards,
Milly

Jan Stránský (honzik) said : #5

Hi,

1) e.g. [1]

2) rRelFuzz is NOT taken into account if psdSizes is specified[2].
psdSizes makes the mode RDIST_PSD [3].
With this mode, rRelFuzz is not used [4]

cheers
Jan

[1] https://yade-dem.org/doc/yade.export.html#yade.export.text
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/SpherePack.cpp#L112
[3] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/SpherePack.cpp#L177
[4] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/SpherePack.cpp#L261

Milly Ro (milly93) said : #6

Thanks a lot. I will try it

Best regards
Milly

Milly Ro (milly93) said : #7

Hello Jan,

I have one more question about saving the text file. I tried to do it, but this command saves all spheres generated in the box. But I want to save the positions only of spheres in my cylinder ('pred' in the code above). The command that I usually use in python does not work here. Should I maybe change something in the 'mask' parameter in yade.export.text(filename, mask=-1)?

Best regards
Milly

Milly Ro (milly93) said : #8

Hello Jan,

I have found my mistake and the last question is not relevant any more :)

Best regards,
Milly

Janek Kozicki (cosurgi) said : #9

You should at least tell others what was your mistake, in case if someone stumbles on exact same problem. He will verify if your solution (however irrelevant) helps him https://xkcd.com/979/

Milly Ro (milly93) said : #10

My mistake was in the dimension of my box an cylinder. The box was smaller than cylinder and because of it the final figure looked like a box, although it was actually a cylinder.

Milly Ro (milly93) said : #11

Hello,

I have an additional question about saving of simulation results. So I generate spheres in a cube and then apply the gravity. How can I save the positions of my spheres after applying the gravity. In the graphic window I saw that the gravity was applied, but my saved text file gives me only the positions of spheres before gravity applying. I used Oedometric test section of https://yade-dem.org/doc/tutorial-examples.html. Can you please tell me how to save the position of spheres after gravity in the given example code.

I used this command: file = export.text('test.txt',mask=-1).

Best wishes
Milly

Jan Stránský (honzik) said : #12

> I have an additional question

next time or if you want to continue in this discussion, please open a new question [1]

> I used this command: file = export.text('test.txt',mask=-1).

this export spheres at the time when python evaluates it. So probably the line is "misplaced" in the code you are using.

cheers
Jan

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

Milly Ro (milly93) said : #13

Hi Jan,

thank you for your answer, I will do it next time.

The export command is at the last line, but it seems like gravity ist not applied after saving the text file.

Let me know if I need to create a new thread.

Best wishes,
Milly

Jan Stránský (honzik) said : #14

Last line in python script can easily be just the beginning of simulation.
It depends how you use O.run, O.step, GUI play button...
As discussed, please open a new question for a new question.
cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask Milly Ro for more information if necessary.

To post a message you must log in.