Scene radius must be positive - Ignoring value

Asked by Mahdeyeh

Hello dear

I use yadedaily:
Yade 20210909-5909~5b11526~focal1
Using python version: 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0]

Ubuntu 20.04

I'm trying to generate clumps. Sometime I must save simulation of base script and finishing run with base script and then load saved simulation.In this run I run a script for restore simulation ; so in controller window when I click "show 3D" or click "Reference" or "Center" to show the model in different direction, there will be:
In [1]: Scene radius must be positive - Ignoring value
With this notification, the scene moves strange when I adjust it through mouse.

or there will be this warning:
In [2]: <WARNING> GLViewer:248 virtual void yade::GLViewer::postDraw(): More than 500 grid segments (currently: 550) take too long to draw, using previous value: 6. If you need denser grid try calling: yade.qt.center(suggestedRadius,gridOrigin,suggestedCenter,gridDecimalPlaces); (each parameter is optional) to reduce scene grid radius. Current values are: yade.qt.center(suggestedRadius=13.717,gridOrigin=(0,0,0),suggestedCenter=(6.06378,9.62361,0),gridDecimalPlaces=4)
Press '-' (decrease grid density) in View window to remove this warning.

I couldn`t see model and check it.

 My script has 2 files as input data .The below link shows my script for loading saved simulation and clump data files:
https://www.filemail.com/d/fnbgmkpuvqwgynu

Please help me about this error.
Best regards,

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#1

Hi,

according to [1] question should not contain external links. I haven't opened your link. Have you tried to manipulate view by commands in the terminal?

###
from yade import qt
#open the view (If you have open any other view before this, please close it manually.)
v = qt.View()
# and try one of these
qt.center()
#or
v.showEntireScene()
###

Best wishes,
Karol

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

Revision history for this message
Mahdeyeh (mahdiye.sky) said :
#2

Thank you Karol for reply.

> from yade import qt
#open the view (If you have open any other view before this, please close it manually.)
v = qt.View()
# and try one of these
qt.center()
#or
v.showEntireScene()

I try it but nothing change. Again I had this warninig:

In [2]: <WARNING> GLViewer:248 virtual void yade::GLViewer::postDraw(): More than 500 grid segments (currently: 550) take too long to draw, using previous value: 6. If you need denser grid try calling: yade.qt.center(suggestedRadius,gridOrigin,suggestedCenter,gridDecimalPlaces); (each parameter is optional) to reduce scene grid radius. Current values are: yade.qt.center(suggestedRadius=13.717,gridOrigin=(0,0,0),suggestedCenter=(6.06378,9.62361,0),gridDecimalPlaces=4)
Press '-' (decrease grid density) in View window to remove this warning.

Revision history for this message
Karol Brzezinski (kbrzezinski) said (last edit ):
#3

Hi Mahdeyeh,

try to check the model in another way, not only visually. Check whether there are any bodies in the simulation
###
len(O.bodies)>0
###

or whether your simulation didn't explode. For example, if dimensions of the current simulation aren't excessively high
###
aabbDim()
###

If so, you can try to remove particles that are further than an expected radius and refresh the view.

###
maxDist = 1
for b in O.bodies:
    if b.state.pos.norm()>maxDist:
        O.bodies.erase(b.id)
###

Best wishes,
Karol

Revision history for this message
Mahdeyeh (mahdiye.sky) said :
#4

> len(O.bodies)>0
> aabbDim()
All bodies are in simulation and everything goes good in running just could n`t see it.

> you can try to remove particles that are further than an expected radius and refresh the view.
I should n`t change radius of particles due to outputs. Although the particle radius has n`t changed compared to before this event (event: I mean moving model to far away and it can not be magnified enough . In this case, in primary view window, the number written next to the coordinate axis is equal to 10000.)

Thank you Karol for your time

Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#5

By expected radius, I just meant how big is your model. Let us say all the particles should be contained in a box 1x1x1 m. So you expect them to be no further than approx 2 meters. If your simulation exploded or some of the particles leaked out of the box, the size of your model will be much bigger (like 10 000 m) and you won't be able to see any details. That is why, I advised removing the particles. If you want to keep only the particles not further than two meters from the origin set maxDist = 2, and use the code that I proposed earlier. It will not fix your simulation or anything, but you might be able to solve the visualization problem (and discover that it is not the problem, the output of the simulation is). Or instead of removing particles, you can just count the particles further than a certain radius. It will not fix the visualization issue, but it won't mess your simulation and give you the answer "how bad is it?":

###
maxDist = 2# change it to some distance representing expected size of your model
counter = 0
for b in O.bodies:
    if b.state.pos.norm()>maxDist:
        counter += 1
print('{:d} particles escaped from your box ;)'.format(counter))
###

Cheers,
Karol

Revision history for this message
Mahdeyeh (mahdiye.sky) said :
#6

Thanks Karol Brzezinski, that solved my question.

Revision history for this message
Mahdeyeh (mahdiye.sky) said :
#7

Thank you very much Karol, You are so good.

Some of particles moved far away and I deleted them, so every thing going best.

Thanks alot

Best regards,
Mahdeyeh