pack a volume with specified spheres

Asked by Jack Wang

Hi,
   When packing a volume, I want to create the spheres with specified ranges of radius and numbers,how should I do?
For example, I want 1000 spheres in all, 100 spheres whose radius from 2 to 4, 500 spheres from 4 to 7 and 400 spheres from 7 to 10 .

Thank you

Question information

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

Chareyre,

Maybe I don't understand the "makecloud" very clearly. Here is my modification:
 sp.makeCloud(Vector3(-1,-9,30),Vector3(1,-13,32),num=2000,psdSizes=[.0118/2,.0236/2,.0475/2,.095/2,.132/2,.16/2,.19/2],
psdCumm=[0,.6385,.8715,.9625,.9855,.9965,1])

When I run the example, a problem occurs. I don't know what to do then. Please give me some guidance. Thank you very much.

Welcome to Yade 0.50
TCP python prompt on localhost:9000, auth cookie `cadssy'
TCP info provider on localhost:21000
Running script lixi.py
Generating cloud…
Traceback (most recent call last):
  File "yade-0.50", line 112, in <module>
    execfile(args[0])
  File "lixi.py", line 44, in <module>
    psdCumm=[0,.6385,.8715,.9625,.9855,.9965,1])
ArgumentError: Python argument types in
    SpherePack.makeCloud(SpherePack, tuple, tuple)
did not match C++ signature:
    makeCloud(SpherePack {lvalue}, Eigen::Matrix<double, 3, 1, 2, 3, 1> minCorner, Eigen::Matrix<double, 3, 1, 2, 3, 1> maxCorner, double rMean, double rRelFuzz, int num=-1, bool periodic=False, double porosity=-1)

Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#3

The command you typed works for me. The problem is you are using Yade 0.50 which is more than 1 year old.
The makeCloud function received improvements as recently as last week... I would recommend yade-daily, but what you type should also work in 0.60 and later.

Revision history for this message
Jack Wang (songjiepy) said :
#4

Hi again,
 I finish installing yade-0.60.3, but there is a problem when I run the example.

jack@kinn:~/YADE603$ python yade-0.60.3 mill.py
python: can't open file 'yade-0.60.3': [Errno 2] No such file or directory

Thank you again.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#5

Hi Jack,

you should use:

yade-0.60.3 mill.py

The file you want to run e.g. mill.py must be in the current directory. Check
with command ls.

HTH

Klaus

On Tue, 8 Nov 2011 01:35:39 PM Jack Wang wrote:
> Question #177389 on Yade changed:
> https://answers.launchpad.net/yade/+question/177389
>
> Status: Answered => Open
>
> Jack Wang is still having a problem:
> Hi again,
> I finish installing yade-0.60.3, but there is a problem when I run the
> example.
>
> jack@kinn:~/YADE603$ python yade-0.60.3 mill.py
> python: can't open file 'yade-0.60.3': [Errno 2] No such file or directory
>
> Thank you again.

Revision history for this message
Jack Wang (songjiepy) said :
#6

Hi Klaus,
 Do you mean that I copy the examples to the directory " YADE603/bin" and then run the example in the directory with the command " yade-0.60.3 mill.py"? If so , the command can't be found.

jack@kinn:~/YADE603/bin$ ls
bulldozer.py funnel.py psd.py tunnel-pack.py
bulldozerVTK.py lixi.py rotating-cylinder.py yade-0.60.3
Cylinder.py mill.py rotatingCylinder.py yade-0.60.3-batch

jack@kinn:~/YADE603/bin$ yade-0.60.3 mill.py
yade-0.60.3:command not found

In addition, I can run the example in my way using yade-0.50, but it does not work in yade-0.60.3.

Thank you

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#7

Hi Jack,

in the same directory try:

./yade-0.60.3 mill.py

This should solve the problem.

Klaus

On Tue, 8 Nov 2011 05:41:05 PM Jack Wang wrote:
> Question #177389 on Yade changed:
> https://answers.launchpad.net/yade/+question/177389
>
> Status: Answered => Open
>
> Jack Wang is still having a problem:
> Hi Klaus,
> Do you mean that I copy the examples to the directory " YADE603/bin" and
> then run the example in the directory with the command " yade-0.60.3
> mill.py"? If so , the command can't be found.
>
> jack@kinn:~/YADE603/bin$ ls
> bulldozer.py funnel.py psd.py tunnel-pack.py
> bulldozerVTK.py lixi.py rotating-cylinder.py yade-0.60.3
> Cylinder.py mill.py rotatingCylinder.py yade-0.60.3-batch
>
> jack@kinn:~/YADE603/bin$ yade-0.60.3 mill.py
> yade-0.60.3:command not found
>
>
> In addition, I can run the example in my way using yade-0.50, but it does
> not work in yade-0.60.3.
>
> Thank you

Revision history for this message
Jack Wang (songjiepy) said :
#8

Hi
 The examples indeed could be run by the command "./yade-0.50 mill.py". It works in yade-0.50 but not in yade-0.60.3.

jack@kinn:~/YADE60/bin$ ./yade-0.60.3 mill.py
WARNING: non-debug build not available, running with --debug instead (try --rebuild to get the non-debug build).
Welcome to Yade 0.60.3
Traceback (most recent call last):
  File "./yade-0.60.3", line 105, in <module>
    import yade
ImportError: No module named yade

I think I have installed yade-0.60.3 successfully.

Thank you again

Revision history for this message
Jérôme Duriez (jduriez) said :
#9

Hello,

If I remember well, it's because of :
"WARNING: non-debug build not available, running with --debug instead (try --rebuild to get the non-debug build)."

I think you have to re-try with ./yade-0.60.3 --debug mill.py

Revision history for this message
Jack Wang (songjiepy) said :
#10

Thank you, jduriez, it works.

Revision history for this message
Jack Wang (songjiepy) said :
#11

Thanks Chareyre, that solved my question.